johnno1962 / injectionforxcode

Runtime Code Injection for Objective-C & Swift
MIT License
6.55k stars 565 forks source link

identity.txt not created, removed on injection #115

Closed nickkjordan closed 8 years ago

nickkjordan commented 8 years ago

identity.txt was not created when injecting the project. I created my own file, and console outputs a successful codesign with the identity, but after injection the file is removed.

I'm injecting onto a device if that makes a difference. I had no issues when injecting with a Simulator on another project.

johnno1962 commented 8 years ago

Must be related to this code in injectSource.pl:

my ($localBundle, $identity) = loadFile( $infoFile ); $localBundle =~ s@^.*/Build/@$buildRoot/@ if $buildRoot; (my $localBinary = $localBundle) =~ s@([^./]+).app@$1.app/$1@;

unlink $infoFile if $buildRoot && !-d $localBundle;

can you try commenting out the “unlink” line?

nickkjordan commented 8 years ago

That works. Is there some sort of setup that might have caused this?

johnno1962 commented 8 years ago

Its a fragile peice of code really depending on Xcode preferences and organisation of the project. If you’re up and running I may look at removing the unlink line. Then again I must have put it in there for a reason!