[Discussion] Convert Xvim to an Xcode extension #964

Open
FWFabio opened this Issue Jun 14, 2016 · 62 comments

Comments

Projects
None yet
@FWFabio

FWFabio commented Jun 14, 2016

The new Xcode 8 won't allow plugins anymore. Instead they're launching a new extension mechanism that allow for direct access to the source code editor view.

I'm planning to explore the possibility at WWDC and will update the issue as soon as I have more info.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/35165827-discussion-convert-xvim-to-an-xcode-extension?utm_campaign=plugin&utm_content=tracker%2F252770&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F252770&utm_medium=issues&utm_source=github).
@JugglerShu

This comment has been minimized.

Show comment
Hide comment
@JugglerShu

JugglerShu Jun 14, 2016

Contributor

Finally this day comes...
I don't know if this turns out good news or bad one.
I hope we can reuse the code we made so far.

Contributor

JugglerShu commented Jun 14, 2016

Finally this day comes...
I don't know if this turns out good news or bad one.
I hope we can reuse the code we made so far.

@duhanebel

This comment has been minimized.

Show comment
Hide comment
@duhanebel

duhanebel Jun 14, 2016

There is not much details for now. We surely can't use the text editor extension because as far as I can see those are triggered by menu items.
There's zero documentation on the topic at the moment and I believe most of feature didn't make into the first beta of Xcode 8. It's quite hard to understand what's the way forward.

What's worse is that I think Apple is killing the standard plugin architecture with Xcode 8 to boost security: only signed extensions can be loaded and they execute in a separate process.

duhanebel commented Jun 14, 2016

There is not much details for now. We surely can't use the text editor extension because as far as I can see those are triggered by menu items.
There's zero documentation on the topic at the moment and I believe most of feature didn't make into the first beta of Xcode 8. It's quite hard to understand what's the way forward.

What's worse is that I think Apple is killing the standard plugin architecture with Xcode 8 to boost security: only signed extensions can be loaded and they execute in a separate process.

@FWFabio FWFabio changed the title from Convert Xvim to a Xcode extension to [Discussion] Convert Xvim to an Xcode extension Jun 14, 2016

@JugglerShu

This comment has been minimized.

Show comment
Hide comment
@JugglerShu

JugglerShu Jun 15, 2016

Contributor

I think at least there should be work around. The only thing I need to make XVim work is that a dynamic library can be loaded into Xcode process.
Because Xcode7.3 and before the plugin system loads a plugin I used it to load a dynamic library.
Even if new Xcode itself doesn't load any 3rd party library, if we have root privilege we can inject a dynamic library into Xcode process by ourself.

Contributor

JugglerShu commented Jun 15, 2016

I think at least there should be work around. The only thing I need to make XVim work is that a dynamic library can be loaded into Xcode process.
Because Xcode7.3 and before the plugin system loads a plugin I used it to load a dynamic library.
Even if new Xcode itself doesn't load any 3rd party library, if we have root privilege we can inject a dynamic library into Xcode process by ourself.

@cielpy

This comment has been minimized.

Show comment
Hide comment
@cielpy

cielpy Jun 15, 2016

Apple add a quick comment feature for Xcode 8 by use VVDocumenter-Xcode
image
(https://twitter.com/onevcat/status/742732675983638533)
there maybe some way to convert standard plugins to new Xcode extensions.

cielpy commented Jun 15, 2016

Apple add a quick comment feature for Xcode 8 by use VVDocumenter-Xcode
image
(https://twitter.com/onevcat/status/742732675983638533)
there maybe some way to convert standard plugins to new Xcode extensions.

@duhanebel

This comment has been minimized.

Show comment
Hide comment
@duhanebel

duhanebel Jun 15, 2016

@JugglerShu that won't work because Xcode 8 library loading is protected by System integrity Protection :/

@JugglerShu that won't work because Xcode 8 library loading is protected by System integrity Protection :/

@bjaskj

This comment has been minimized.

Show comment
Hide comment
@bjaskj

bjaskj Jun 15, 2016

Bump, vim func in Xcode is a must.

bjaskj commented Jun 15, 2016

Bump, vim func in Xcode is a must.

@haaakon

This comment has been minimized.

Show comment
Hide comment
@haaakon

haaakon Jun 15, 2016

It does not look good for XVim on XCode 8. Can everyone please send radars and try to get Apple to let this be possible in XCode 8? Not looking forward to using XCode without Vim mode :(

haaakon commented Jun 15, 2016

It does not look good for XVim on XCode 8. Can everyone please send radars and try to get Apple to let this be possible in XCode 8? Not looking forward to using XCode without Vim mode :(

@SixFiveSoftware

This comment has been minimized.

Show comment
Hide comment
@SixFiveSoftware

SixFiveSoftware Jun 15, 2016

I submitted a radar for vim key bindings a few months ago and it was closed as a duplicate.

I submitted a radar for vim key bindings a few months ago and it was closed as a duplicate.

@squarefrog

This comment has been minimized.

Show comment
Hide comment
@squarefrog

squarefrog Jun 15, 2016

Contributor

I wonder if we'll have a better idea after Session 414: Using and Extending the Xcode Source Editor. @haaakon what have you put in your radar? What exactly are extensions lacking?

Contributor

squarefrog commented Jun 15, 2016

I wonder if we'll have a better idea after Session 414: Using and Extending the Xcode Source Editor. @haaakon what have you put in your radar? What exactly are extensions lacking?

@jklausa

This comment has been minimized.

Show comment
Hide comment
@jklausa

jklausa Jun 15, 2016

@duhanebel would disabling SIP help? I'd really fucking hate to run an unsafe system just to able to use the IDE, but if this is what it takes...

jklausa commented Jun 15, 2016

@duhanebel would disabling SIP help? I'd really fucking hate to run an unsafe system just to able to use the IDE, but if this is what it takes...

@duhanebel

This comment has been minimized.

Show comment
Hide comment
@duhanebel

duhanebel Jun 15, 2016

Disabling SIP should be enough but it's a pain in the back to disable it on each software update and I'm not sure how long Apple will allow us to.

Disabling SIP should be enough but it's a pain in the back to disable it on each software update and I'm not sure how long Apple will allow us to.

@haaakon

This comment has been minimized.

Show comment
Hide comment
@haaakon

haaakon Jun 15, 2016

@squarefrog The System integrity Protection should allow the plugin. Maybe the plugin has to be integrated directly to XCode as the VVDocumenter plugin has?

@duhanebel have you confirmed that its possible to disable it and then run XVim?

haaakon commented Jun 15, 2016

@squarefrog The System integrity Protection should allow the plugin. Maybe the plugin has to be integrated directly to XCode as the VVDocumenter plugin has?

@duhanebel have you confirmed that its possible to disable it and then run XVim?

@duhanebel

This comment has been minimized.

Show comment
Hide comment
@duhanebel

duhanebel Jun 15, 2016

@haaakon I'm not running 10.12 yet but even so, this first Xcode beta seems fairly incomplete. I need to go to the lab this afternoon (it's 9am here) and confirm with somebody form the Xcode team. Provided that they're willing to tell me!

@haaakon I'm not running 10.12 yet but even so, this first Xcode beta seems fairly incomplete. I need to go to the lab this afternoon (it's 9am here) and confirm with somebody form the Xcode team. Provided that they're willing to tell me!

@JugglerShu

This comment has been minimized.

Show comment
Hide comment
@JugglerShu

JugglerShu Jun 15, 2016

Contributor

So I made it work with Xcode 8.0 beta.
But it is tricky and I can't recommend you to do it by yourself. I'm working on how to make it possible by everyone now.
And due to the changes in Xcode 8.0, it seems XVim leads some crashes too (but this is not big problem since I can fix it anyway...)

Update: Well I found it's not as tricky as I expected... I think I can publish how to do it soon.

xvim

Contributor

JugglerShu commented Jun 15, 2016

So I made it work with Xcode 8.0 beta.
But it is tricky and I can't recommend you to do it by yourself. I'm working on how to make it possible by everyone now.
And due to the changes in Xcode 8.0, it seems XVim leads some crashes too (but this is not big problem since I can fix it anyway...)

Update: Well I found it's not as tricky as I expected... I think I can publish how to do it soon.

xvim

@squarefrog

This comment has been minimized.

Show comment
Hide comment
@squarefrog

squarefrog Jun 15, 2016

Contributor

👍 looks like a promising start!

Contributor

squarefrog commented Jun 15, 2016

👍 looks like a promising start!

@duhanebel

This comment has been minimized.

Show comment
Hide comment
@duhanebel

duhanebel Jun 15, 2016

@JugglerShu how did you manage to load it? Do you want me to ask anything to the Apple engineers at WWDC?

duhanebel commented Jun 15, 2016

@JugglerShu how did you manage to load it? Do you want me to ask anything to the Apple engineers at WWDC?

@keith

This comment has been minimized.

Show comment
Hide comment
@keith

keith Jun 15, 2016

Contributor

After asking in the WWDC labs it sounds like providing a rich enough API to be able to build XVim isn't something that is currently planned.

Contributor

keith commented Jun 15, 2016

After asking in the WWDC labs it sounds like providing a rich enough API to be able to build XVim isn't something that is currently planned.

@duhanebel

This comment has been minimized.

Show comment
Hide comment
@duhanebel

duhanebel Jun 15, 2016

@keith that doesn't sound good. Not even with the editor extensions? I haven't seen any docs on that after the announcement but perhaps is coming in a future seed?

@keith that doesn't sound good. Not even with the editor extensions? I haven't seen any docs on that after the announcement but perhaps is coming in a future seed?

@JugglerShu

This comment has been minimized.

Show comment
Hide comment
@JugglerShu

JugglerShu Jun 16, 2016

Contributor

@keith Ask them how apple engineers are using Xcode without XVim? hah.

@duhanebel It was actually easy. Please wait my announcement about it. Also I think APIs cannot have enough flexibility to support XVim since it is really complex and cannot be done with just simple method calls. It should require some callbacks or rather a kind of framework that is dedicated to support XVim.

Contributor

JugglerShu commented Jun 16, 2016

@keith Ask them how apple engineers are using Xcode without XVim? hah.

@duhanebel It was actually easy. Please wait my announcement about it. Also I think APIs cannot have enough flexibility to support XVim since it is really complex and cannot be done with just simple method calls. It should require some callbacks or rather a kind of framework that is dedicated to support XVim.

@haaakon

This comment has been minimized.

Show comment
Hide comment
@haaakon

haaakon Jun 16, 2016

@JugglerShu maybe your plugin can get special access? At least we as a community have to push Apple letting them know that this is a core feature for alot of XCode developers

A guy from Apple replies in a Twitter conversation about XVim:

screen shot 2016-06-16 at 09 58 14

(https://twitter.com/jeremyhu/status/743316938940514305)

So if all 4000+ people that have starred the XVim repo report radars and talk to Apple, maybe we can turn them around on this :)

haaakon commented Jun 16, 2016

@JugglerShu maybe your plugin can get special access? At least we as a community have to push Apple letting them know that this is a core feature for alot of XCode developers

A guy from Apple replies in a Twitter conversation about XVim:

screen shot 2016-06-16 at 09 58 14

(https://twitter.com/jeremyhu/status/743316938940514305)

So if all 4000+ people that have starred the XVim repo report radars and talk to Apple, maybe we can turn them around on this :)

@yury

This comment has been minimized.

Show comment
Hide comment
@yury

yury Jun 16, 2016

@haaakon it should be separate radars? or I can vote somewhere?

yury commented Jun 16, 2016

@haaakon it should be separate radars? or I can vote somewhere?

@haaakon

This comment has been minimized.

Show comment
Hide comment
@haaakon

haaakon Jun 16, 2016

@yury i think it's best to create separate radars, the reported bugs aren't public. But you can publish your radar at http://www.openradar.me/ as well to make it public (not made by Apple)

Maybe @JugglerShu can share the details on what we should report as missing needed to add XVim to Xcode 8?

haaakon commented Jun 16, 2016

@yury i think it's best to create separate radars, the reported bugs aren't public. But you can publish your radar at http://www.openradar.me/ as well to make it public (not made by Apple)

Maybe @JugglerShu can share the details on what we should report as missing needed to add XVim to Xcode 8?

@jdschroeder

This comment has been minimized.

Show comment
Hide comment
@jdschroeder

jdschroeder Jun 16, 2016

@yury You basically vote by creating a radar. It'll likely be marked as a duplicate, and as I understand it, highly duplicated issues do tend to get the attention of Apple engineers, so the more of us filing radars, the better.

@yury You basically vote by creating a radar. It'll likely be marked as a duplicate, and as I understand it, highly duplicated issues do tend to get the attention of Apple engineers, so the more of us filing radars, the better.

@yury

This comment has been minimized.

Show comment
Hide comment
@yury

yury Jun 16, 2016

@haaakon, @jdschroeder thanks. Posted to radar.

yury commented Jun 16, 2016

@haaakon, @jdschroeder thanks. Posted to radar.

@davidquon

This comment has been minimized.

Show comment
Hide comment
@davidquon

davidquon Jun 16, 2016

Can someone make a template for what the radar should be asking for (or post links to Open Radars)?

Can someone make a template for what the radar should be asking for (or post links to Open Radars)?

@squarefrog

This comment has been minimized.

Show comment
Hide comment
@squarefrog

squarefrog Jun 16, 2016

Contributor

Given that it's unlikely apple will create vim key bindings as a first class plugin, I wonder if it's more worthwhile stating what functionality is missing from extensions?

From a cursory glance it seems that there is no text input listener or delegate method available which would be the first request. It seems text substitution is possible,

I suppose a shouldChangeText: which returns bool type call would allow the basic movement. This could pass the text through if in insert mode etc.

What else specifically?

Contributor

squarefrog commented Jun 16, 2016

Given that it's unlikely apple will create vim key bindings as a first class plugin, I wonder if it's more worthwhile stating what functionality is missing from extensions?

From a cursory glance it seems that there is no text input listener or delegate method available which would be the first request. It seems text substitution is possible,

I suppose a shouldChangeText: which returns bool type call would allow the basic movement. This could pass the text through if in insert mode etc.

What else specifically?

@haaakon

This comment has been minimized.

Show comment
Hide comment
@haaakon

haaakon Jun 16, 2016

I agree @squarefrog , @JugglerShu should tell us and we can submit radars for it :)

haaakon commented Jun 16, 2016

I agree @squarefrog , @JugglerShu should tell us and we can submit radars for it :)

@JugglerShu

This comment has been minimized.

Show comment
Hide comment
@JugglerShu

JugglerShu Jun 16, 2016

Contributor

Now the master branch should work with Xcode 8 beta.

What it actually does is removing code signature from Xcode-beta.app .
So if you don't like to unsign the Xcode, just don't use it.

With new Makefile, when invoke make, it will ask you if it is OK to remove Xcode signature.
press y to it to proceed and after that is as same as before.

The original Xcode file is backed up as
- /Path/to/Your Xcode.app/Contents/MacOS/Xcode_orig

so you can revert to the original by copying it as

  • /Path/to/Your Xcode.app/Contents/MacOS/Xcode

If something is totally corrupted, just re-download the original Xcode from Apple (Makefile is not really well tested yet.)

Contributor

JugglerShu commented Jun 16, 2016

Now the master branch should work with Xcode 8 beta.

What it actually does is removing code signature from Xcode-beta.app .
So if you don't like to unsign the Xcode, just don't use it.

With new Makefile, when invoke make, it will ask you if it is OK to remove Xcode signature.
press y to it to proceed and after that is as same as before.

The original Xcode file is backed up as
- /Path/to/Your Xcode.app/Contents/MacOS/Xcode_orig

so you can revert to the original by copying it as

  • /Path/to/Your Xcode.app/Contents/MacOS/Xcode

If something is totally corrupted, just re-download the original Xcode from Apple (Makefile is not really well tested yet.)

@jklausa

This comment has been minimized.

Show comment
Hide comment
@jklausa

jklausa Jun 17, 2016

I mean, yeah, that is a workaround but I can't be the only one that's more than slightly worried that this involves stripping the signature of the IDE.

jklausa commented Jun 17, 2016

I mean, yeah, that is a workaround but I can't be the only one that's more than slightly worried that this involves stripping the signature of the IDE.

@haaakon

This comment has been minimized.

Show comment
Hide comment
@haaakon

haaakon Jun 17, 2016

Cool that you got it working @JugglerShu , this will probably be unsafe to use, and i guess you won't be able to submit apps and such with XCode that way? Seems to me like i won't use this solution because of the security risks, but i don't know enough about it to know for sure yet.

As asked before, could you give som feedback on what is needed for XCode 8 to work with XVim on a Apple Supported way? This way we can submit radars for the feature to be implemented as soon as possible.

haaakon commented Jun 17, 2016

Cool that you got it working @JugglerShu , this will probably be unsafe to use, and i guess you won't be able to submit apps and such with XCode that way? Seems to me like i won't use this solution because of the security risks, but i don't know enough about it to know for sure yet.

As asked before, could you give som feedback on what is needed for XCode 8 to work with XVim on a Apple Supported way? This way we can submit radars for the feature to be implemented as soon as possible.

@jklausa

This comment has been minimized.

Show comment
Hide comment
@jklausa

jklausa Jun 17, 2016

and i guess you won't be able to submit apps and such with XCode that way?

well that one is fairly easily worked-around, you could have Xcode-XVim, that's codestripped and with Xvim enabled that you use for development, and untouched, signed Xcode.app that's used to make final builds of your app.

not ideal by any means, of course.

jklausa commented Jun 17, 2016

and i guess you won't be able to submit apps and such with XCode that way?

well that one is fairly easily worked-around, you could have Xcode-XVim, that's codestripped and with Xvim enabled that you use for development, and untouched, signed Xcode.app that's used to make final builds of your app.

not ideal by any means, of course.

@JugglerShu

This comment has been minimized.

Show comment
Hide comment
@JugglerShu

JugglerShu Jun 17, 2016

Contributor

@haaakon
So you mean you may not submit your app developed by the Xcode without its signature? As far as I understand it (Well, I don't know well about Apple's signature system but just from the general signature logic), stripping signature from Xcode doesn't affect the generated app as far as it is working as usual. I don't think they are using any information from the signature of Xcode to sign your app.
Is this not correct?

The main part of XVim can be implemented by hooking key input. So if every key input can be intercepted and processed by our code, main part should be implemented. (Of course we need an access to the text.)

Also some feature requires access to Xcode operations (like split window, open counterpart).

Things which looks difficult is command line and visual mode part. Command line is embedded in the Xcode view. I don't think they are going to prepare command line just for XVim... I don't know how extension works but if it is possible to display window (even in another process), it might be workaround.
For visual mode, we need an API to select specific part(including block) and update it as key input.

Having said that, I think it should take a long time to support all the features current XVim has. Maybe starting from intercepting keys and some basic features (editing text) would be realistic.

Actually I don't want to go to that way because it is so time consuming. When I want to implement something I have to look for API and if not exist I have to ask Apple to implement it and wait for several weeks or months and repeat this again and again.
So as far as XVim can be loaded into Xcode process (somehow), I would use that method to support XVim until enough APIs coming up.

Contributor

JugglerShu commented Jun 17, 2016

@haaakon
So you mean you may not submit your app developed by the Xcode without its signature? As far as I understand it (Well, I don't know well about Apple's signature system but just from the general signature logic), stripping signature from Xcode doesn't affect the generated app as far as it is working as usual. I don't think they are using any information from the signature of Xcode to sign your app.
Is this not correct?

The main part of XVim can be implemented by hooking key input. So if every key input can be intercepted and processed by our code, main part should be implemented. (Of course we need an access to the text.)

Also some feature requires access to Xcode operations (like split window, open counterpart).

Things which looks difficult is command line and visual mode part. Command line is embedded in the Xcode view. I don't think they are going to prepare command line just for XVim... I don't know how extension works but if it is possible to display window (even in another process), it might be workaround.
For visual mode, we need an API to select specific part(including block) and update it as key input.

Having said that, I think it should take a long time to support all the features current XVim has. Maybe starting from intercepting keys and some basic features (editing text) would be realistic.

Actually I don't want to go to that way because it is so time consuming. When I want to implement something I have to look for API and if not exist I have to ask Apple to implement it and wait for several weeks or months and repeat this again and again.
So as far as XVim can be loaded into Xcode process (somehow), I would use that method to support XVim until enough APIs coming up.

@JugglerShu

This comment has been minimized.

Show comment
Hide comment
@JugglerShu

JugglerShu Jun 17, 2016

Contributor

@jklausa
Yea, I can understand that people don't like to remove signature from apps.
But I'm not so worried about it personally because it is originally signed and if once it is checked, as far as the binary hash is the same, it is "probably" OK.
Some risks are like,

  • You cannot detect the binary modification after removing the signature.
  • You cannot detect dynamic( in process) binary patching.
  • And maybe other possibility like unknown libraries are loaded into the process (but this is what XVim requires so...)

Well, actually I'm thinking one more step now. That is

  • After remove the signature, sing the Xcode with the users identity.
  • Then build and sign XVim with users identity.

This may permits XVim loaded into Xcode and also system should detect the binary change (as far as my understanding of the Apple's signature system is right).

Contributor

JugglerShu commented Jun 17, 2016

@jklausa
Yea, I can understand that people don't like to remove signature from apps.
But I'm not so worried about it personally because it is originally signed and if once it is checked, as far as the binary hash is the same, it is "probably" OK.
Some risks are like,

  • You cannot detect the binary modification after removing the signature.
  • You cannot detect dynamic( in process) binary patching.
  • And maybe other possibility like unknown libraries are loaded into the process (but this is what XVim requires so...)

Well, actually I'm thinking one more step now. That is

  • After remove the signature, sing the Xcode with the users identity.
  • Then build and sign XVim with users identity.

This may permits XVim loaded into Xcode and also system should detect the binary change (as far as my understanding of the Apple's signature system is right).

@FWFabio

This comment has been minimized.

Show comment
Hide comment
@FWFabio

FWFabio Jun 21, 2016

@JugglerShu @jklausa The Xcode signature should have nothing to do with App submission. It's just a mechanism to validate Xcode binary's integrity. Resigning the app and the plugin with your own signature might do the trick (that's how frameworks work in iOS) but I haven't managed to sign Xcode yet because of some issues with code signing.

FWFabio commented Jun 21, 2016

@JugglerShu @jklausa The Xcode signature should have nothing to do with App submission. It's just a mechanism to validate Xcode binary's integrity. Resigning the app and the plugin with your own signature might do the trick (that's how frameworks work in iOS) but I haven't managed to sign Xcode yet because of some issues with code signing.

@JugglerShu

This comment has been minimized.

Show comment
Hide comment
@JugglerShu

JugglerShu Jun 21, 2016

Contributor

@FWFabio
Yes, that should be true.
Unfortunately, apple official code signing tool doesn't support unsigning an app. So I used 3rd party tool to unsign but it seems the app cannot be signed once the signature is removed by the tool.

Overall, my current opinion is to make a request to Apple to open old plugin system for a signed plugins (if users accepts that signature) at least until Apple prepares enough API to support current useful plugins.
Since plugins are often build by the users(including XVim), users can accept all the plugins singed by themselves and Xcode should load it. With this, there is no risk and no tricky operation is required.

Contributor

JugglerShu commented Jun 21, 2016

@FWFabio
Yes, that should be true.
Unfortunately, apple official code signing tool doesn't support unsigning an app. So I used 3rd party tool to unsign but it seems the app cannot be signed once the signature is removed by the tool.

Overall, my current opinion is to make a request to Apple to open old plugin system for a signed plugins (if users accepts that signature) at least until Apple prepares enough API to support current useful plugins.
Since plugins are often build by the users(including XVim), users can accept all the plugins singed by themselves and Xcode should load it. With this, there is no risk and no tricky operation is required.

@duhanebel

This comment has been minimized.

Show comment
Hide comment
@duhanebel

duhanebel Jun 21, 2016

@JugglerShu ah! True. Removing the signature breaks the system but if you just replace the signature it works fine!
I've signed both Xcode and the plugin with my Developer ID and it loads just fine.

Re asking Apple to keep the old plugin architecture: I'll dupe the radar if you file it.

@JugglerShu ah! True. Removing the signature breaks the system but if you just replace the signature it works fine!
I've signed both Xcode and the plugin with my Developer ID and it loads just fine.

Re asking Apple to keep the old plugin architecture: I'll dupe the radar if you file it.

@haaakon

This comment has been minimized.

Show comment
Hide comment
@haaakon

haaakon Jun 21, 2016

Sounds like a good plan @JugglerShu

haaakon commented Jun 21, 2016

Sounds like a good plan @JugglerShu

@FWFabio

This comment has been minimized.

Show comment
Hide comment
@FWFabio

FWFabio Jun 22, 2016

I've opened a radar re extension interface: https://openradar.appspot.com/radar?id=5537580623855616 or rdar://26940161

FWFabio commented Jun 22, 2016

I've opened a radar re extension interface: https://openradar.appspot.com/radar?id=5537580623855616 or rdar://26940161

@jklausa

This comment has been minimized.

Show comment
Hide comment
@jklausa

jklausa Jun 23, 2016

(My radar was closed as a dupe of 26781374)

jklausa commented Jun 23, 2016

(My radar was closed as a dupe of 26781374)

@duhanebel

This comment has been minimized.

Show comment
Hide comment
@duhanebel

duhanebel Jun 23, 2016

Same here!

Same here!

@tkuichooseyou

This comment has been minimized.

Show comment
Hide comment
@tkuichooseyou

tkuichooseyou Jun 23, 2016

Mine was closed as a dupe of 3716281

Mine was closed as a dupe of 3716281

@joshingly

This comment has been minimized.

Show comment
Hide comment
@joshingly

joshingly Jun 23, 2016

My radar got marked as a dupe of 3716281 as well.

My radar got marked as a dupe of 3716281 as well.

@JugglerShu

This comment has been minimized.

Show comment
Hide comment
@JugglerShu

JugglerShu Jun 23, 2016

Contributor

@duhanebel
It seems that it only requires us to re-sign the Xcode and not signing to XVim. I just re-sign Xcode 8 beta and it loads XVim (which is not signed at all). Can you confirm that? I will change Makefile just to re-sign the app (It may require manual operation since I don't know which identity users want to use, though)

Contributor

JugglerShu commented Jun 23, 2016

@duhanebel
It seems that it only requires us to re-sign the Xcode and not signing to XVim. I just re-sign Xcode 8 beta and it loads XVim (which is not signed at all). Can you confirm that? I will change Makefile just to re-sign the app (It may require manual operation since I don't know which identity users want to use, though)

@ManWithBear

This comment has been minimized.

Show comment
Hide comment
@ManWithBear

ManWithBear Jul 19, 2016

@duhanebel can you provide more information about resign?
I try it myself, but failed:

codesign -s <IdentityID> -v Xcode8.app
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: file not in an order that can be processed (link edit information does not fill the __LINKEDIT segment): /Applications/Xcode8.app/Contents/MacOS/Xcode
Xcode8.app: the codesign_allocate helper tool cannot be found or used

ManWithBear commented Jul 19, 2016

@duhanebel can you provide more information about resign?
I try it myself, but failed:

codesign -s <IdentityID> -v Xcode8.app
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: file not in an order that can be processed (link edit information does not fill the __LINKEDIT segment): /Applications/Xcode8.app/Contents/MacOS/Xcode
Xcode8.app: the codesign_allocate helper tool cannot be found or used
@duhanebel

This comment has been minimized.

Show comment
Hide comment
@duhanebel

duhanebel Jul 19, 2016

@ManWithBear that's because you're trying to sign a version that has already been stripped. Try with a fresh copy of Xcode 8

@ManWithBear that's because you're trying to sign a version that has already been stripped. Try with a fresh copy of Xcode 8

@ManWithBear

This comment has been minimized.

Show comment
Hide comment
@ManWithBear

ManWithBear Jul 19, 2016

@duhanebel helped. Thanks. Maybe put it somewhere in README?

@duhanebel helped. Thanks. Maybe put it somewhere in README?

@tmsh

This comment has been minimized.

Show comment
Hide comment
@tmsh

tmsh Aug 3, 2016

JFYI force re-signing again worked for me (Xcode 8b4):

codesign -f -s <iOS or macOS signing identity> -v Xcode8-beta.app

So nice to have it working again! Thanks for all your guys' work with XVim.

tmsh commented Aug 3, 2016

JFYI force re-signing again worked for me (Xcode 8b4):

codesign -f -s <iOS or macOS signing identity> -v Xcode8-beta.app

So nice to have it working again! Thanks for all your guys' work with XVim.

@pitoneux

This comment has been minimized.

Show comment
Hide comment
@pitoneux

pitoneux Aug 9, 2016

if anybody wonder how to get your "signing identity" type the command:

security find-identity -p codesigning

and use what is inside double quote to sign with the command 'codesign'...

I would recommend to add a re-signing in the makefile...

pitoneux commented Aug 9, 2016

if anybody wonder how to get your "signing identity" type the command:

security find-identity -p codesigning

and use what is inside double quote to sign with the command 'codesign'...

I would recommend to add a re-signing in the makefile...

@wangjiejacques

This comment has been minimized.

Show comment
Hide comment
@wangjiejacques

wangjiejacques Sep 15, 2016

@pitoneux can I update Xcode from app store after re-signing Xcode?

@pitoneux can I update Xcode from app store after re-signing Xcode?

@GalCohen

This comment has been minimized.

Show comment
Hide comment
@GalCohen

GalCohen Sep 23, 2016

@JugglerShu What are the disadvantages (if any) of re-signing xcode? Maybe that should be added to the xcode8 readme.

@JugglerShu What are the disadvantages (if any) of re-signing xcode? Maybe that should be added to the xcode8 readme.

@haaakon

This comment has been minimized.

Show comment
Hide comment
@haaakon

haaakon Nov 29, 2016

Good point @GalCohen Anyone have a list?

haaakon commented Nov 29, 2016

Good point @GalCohen Anyone have a list?

@squarefrog

This comment has been minimized.

Show comment
Hide comment
@squarefrog

squarefrog Nov 29, 2016

Contributor

The main disadvantage is you can't submit to the app store.

What I've done is download Xcode from the store, duplicate it, rename it Xcode XVIM.app. That way I can still use the signed version to submit, and i still get to use XVim.

Contributor

squarefrog commented Nov 29, 2016

The main disadvantage is you can't submit to the app store.

What I've done is download Xcode from the store, duplicate it, rename it Xcode XVIM.app. That way I can still use the signed version to submit, and i still get to use XVim.

@JugglerShu

This comment has been minimized.

Show comment
Hide comment
@JugglerShu

JugglerShu Nov 30, 2016

Contributor

@GalCohen Sorry I think I didn't respond this properly. One misunderstanding of code re-signing is that you cannot submit app to app store with the code re-signed Xcode. I believe you can submit your app with code re-signed Xcode. (Actually I haven't done this but theoretically code sign of Xcode doesn't have anything to do with code sign of an app.)

Well, I can't tell big disadvantage of code re-signing of Xcode.
One disadvantage is about security. But if you know how signatures work you would understand why this is not so much problem. After you verify code sign(by apple) of Xcode and then re-sign it by your self, everything should be fine. Because the binary is signed by yourself and if you "believe yourself" the Xcode can be believed to be safe.

If you cannot understand what I'm saying here, you might be at risk of using Xcode which includes malware inside it. (Xcode with malware actually appeared maybe 1 year ago.)
However, since all of you should be great programmers who are using Vim, I would recommend you understand how code signature works (It is really basic thing of a information security).

Having said that, I could overlooked something about code re-signing. So if someone notice some important disadvantages let me know.

Contributor

JugglerShu commented Nov 30, 2016

@GalCohen Sorry I think I didn't respond this properly. One misunderstanding of code re-signing is that you cannot submit app to app store with the code re-signed Xcode. I believe you can submit your app with code re-signed Xcode. (Actually I haven't done this but theoretically code sign of Xcode doesn't have anything to do with code sign of an app.)

Well, I can't tell big disadvantage of code re-signing of Xcode.
One disadvantage is about security. But if you know how signatures work you would understand why this is not so much problem. After you verify code sign(by apple) of Xcode and then re-sign it by your self, everything should be fine. Because the binary is signed by yourself and if you "believe yourself" the Xcode can be believed to be safe.

If you cannot understand what I'm saying here, you might be at risk of using Xcode which includes malware inside it. (Xcode with malware actually appeared maybe 1 year ago.)
However, since all of you should be great programmers who are using Vim, I would recommend you understand how code signature works (It is really basic thing of a information security).

Having said that, I could overlooked something about code re-signing. So if someone notice some important disadvantages let me know.

@sobri909

This comment has been minimized.

Show comment
Hide comment
@sobri909

sobri909 Nov 30, 2016

I've been submitting regularly to the App Store from my resigned Xcode. That's definitely not a limitation.

I've been submitting regularly to the App Store from my resigned Xcode. That's definitely not a limitation.

@haaakon

This comment has been minimized.

Show comment
Hide comment
@haaakon

haaakon Dec 4, 2016

@JugglerShu @GalCohen i use a version thats not resigned "just to be safe" when submitting apps to app store. Submitting with re-signed version of XCode is about as safe as submitting with an older version of XCode. So there should be absolutely no risk if you write your code with a re-signed version of XCode, then doing the actual submit to app store with a signed version of XCode that does not support plugins :)

haaakon commented Dec 4, 2016

@JugglerShu @GalCohen i use a version thats not resigned "just to be safe" when submitting apps to app store. Submitting with re-signed version of XCode is about as safe as submitting with an older version of XCode. So there should be absolutely no risk if you write your code with a re-signed version of XCode, then doing the actual submit to app store with a signed version of XCode that does not support plugins :)

@banxi1988

This comment has been minimized.

Show comment
Hide comment
@banxi1988

banxi1988 Dec 20, 2016

Hi, I find a disadvantage that I can't run Xcode 8 Extensions with the resigned Xcode.

Hi, I find a disadvantage that I can't run Xcode 8 Extensions with the resigned Xcode.

@Gminfly

This comment has been minimized.

Show comment
Hide comment
@Gminfly

Gminfly Jan 30, 2017

After reading through this discussion, my understanding is that the impossibility of a conversion or rewrite of XVim in the form of an Extension is a suspicion, not fact. Correct?

Would it not be prudent to try then?

This is not a demand, I would of course fork and try this myself.
I just want to understand.

Gminfly commented Jan 30, 2017

After reading through this discussion, my understanding is that the impossibility of a conversion or rewrite of XVim in the form of an Extension is a suspicion, not fact. Correct?

Would it not be prudent to try then?

This is not a demand, I would of course fork and try this myself.
I just want to understand.

@JugglerShu

This comment has been minimized.

Show comment
Hide comment
@JugglerShu

JugglerShu Jan 31, 2017

Contributor

@Gminfly
I haven't try it though, I don't think the extension doesn't allow us to intercept key input. That's the key point why I think I can't use the extension to implement XVim.

Contributor

JugglerShu commented Jan 31, 2017

@Gminfly
I haven't try it though, I don't think the extension doesn't allow us to intercept key input. That's the key point why I think I can't use the extension to implement XVim.

@i-schuetz

This comment has been minimized.

Show comment
Hide comment
@i-schuetz

i-schuetz Dec 5, 2017

Any updates on this? Has anyone went through https://github.com/theswiftdev/awesome-xcode-extensions and checked if there's anything usable/inspiring for XVim there?

i-schuetz commented Dec 5, 2017

Any updates on this? Has anyone went through https://github.com/theswiftdev/awesome-xcode-extensions and checked if there's anything usable/inspiring for XVim there?

@lando2319

This comment has been minimized.

Show comment
Hide comment
@lando2319

lando2319 Dec 5, 2017

X Vim 2 is currently working for xcode 9. It works great.

https://github.com/XVimProject/XVim2

X Vim 2 is currently working for xcode 9. It works great.

https://github.com/XVimProject/XVim2

@i-schuetz

This comment has been minimized.

Show comment
Hide comment
@i-schuetz

i-schuetz Dec 7, 2017

@lando2319 yeah, I actually used XVim2 (it would have made sense to add this comment there / open an issue - I forgot it's a separate repository). But anyway, it would be of course better if it can be implemented with an official api, right now it requires to unsign Xcode.

@lando2319 yeah, I actually used XVim2 (it would have made sense to add this comment there / open an issue - I forgot it's a separate repository). But anyway, it would be of course better if it can be implemented with an official api, right now it requires to unsign Xcode.

@i-schuetz i-schuetz referenced this issue in XVimProject/XVim2 Dec 7, 2017

Open

Convert XVim2 to an extension? #93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment