Comments (34)
Hi, have a look at running /tmp/eval.sh to see what the problem is or could you email it to me injection at johnholdsworth dot com. It seems to have found the compile command OK. Would be good to work out the problem if it used to work in InjectionApp. Are you using the new build system?
from injectioniii.
I have check the .sh
file. It looks like all is right. I'm sorry I can't email the file to you because of security.
And I don't know what the new build system
mean?
from injectioniii.
Can you try running the file after editing off the extra cruft at end of the string? This is what the app does. “new build system” is part of Xcode 9. If you’re not ware of it you’re probably not using it.
from injectioniii.
I have tried to running the file in terminal after deleting the part of -o .....
. And It works fine, only warning and no error.
I use the standard build system.
from injectioniii.
I have email you the sh file.
from injectioniii.
I’ve prepared a test version of the app which produces a file /tmp/command.sh which is the command actually executed after minimal processing. There must be a difference in escaping if you say the edited eval<N>.sh command works. Can you look into the differences please?
from injectioniii.
I'm sorry that I give you the wrong information. In fact, the eval.sh
file works in the terminal without changing anything. And the ".command.sh" works in terminal too. I have compared two files and they are almost same except the time
command.
I checked the code how to run shell in bundle. Maybe there is something different between execve
and terminal?
I used to run shell with the below setting
NSTask *task = [NSTask new];
[task setLaunchPath:@"/bin/sh"];
[task setArguments:@[self.scriptPath]];
[task setCurrentDirectoryPath:[self lastFolderPath]];
task.environment = @{@"LC_ALL":@"en_US.UTF-8",@"LANGUAGE":@"en_US.UTF-8",@"LANG":@"en_US.UTF-8",@"PATH":@"/usr/bin:/bin:/usr/sbin:/sbin"};
It seems that lacks the environment. I tried to add these to execve
but I got errors.
from injectioniii.
I’m beginning to get an idea what the problem might be here. Due to the new version of injection’s root being “SwiftEval” all build commands are run using execve in the simulator 😱. Everything seems to run except in the simulator filenames are case sensitive i.e. HeAdEr.h when it is #included will not be the same as Header.h on the file system. Can you check this is not the case here? The headers where precompiled on OSX but the incremental compile will be trying to open the header inside the simulator’s OS. Eventually I’ll have to change this no doubt to run builds on OSX but this could be the problem at the moment.
from injectioniii.
Sorry,I had no idea what you mean. Did you mean some file named Header.h
, but it's inclued as HeAdEr.h
? If it is your meaning, I think this not the problem with caused the error. I have checked the project . The error said that it cannot find the file named "SomeHeader.h", and I cannot find anything like "someheader,someHeader,Someheader" in my project.
from injectioniii.
It’s precompiling in a header you don’t reference in your project at all? It’s not in a pod or something?
from injectioniii.
Yes, I have referenced the file somewhere. What I means is the file name and import are case equal.
from injectioniii.
Seems like I’ll have to move the compile onto OSX somehow which I was trying to avoid but it's where it should be.
from injectioniii.
Why you didn't want to move the compile onto OSX?
from injectioniii.
I have create a demo project which contain the execve
code. It can build for iOS or macOS. In my test, the eval.sh
works in macOS and doesn't work in iOS.
from injectioniii.
Ok, I’ve uploaded a version that compiles on OSX if you want to give it a try. It gives slightly less feedback but I can work on that if it solves your problem.
from injectioniii.
Still no work...
The file named "eval.log" is empty. But I get the output in console:
ld: warning: ignoring file /tmp/eval2.o, file was built for i386 which is not the architecture being linked (x86_64): /tmp/eval2.o
sometimes likes below:
dlopen() error: dlopen(/tmp/eval1.dylib, 2): Symbol not found: _OBJC_CLASS_$_XXToastView
from injectioniii.
At least it’s compiling now. Are you building/running 32 bit? That’s not supported in the new version.
from injectioniii.
Right, I’ve uploaded a version that supports 32 bit apps! Can you test it out?
from injectioniii.
It looks very strange after updating the project. The fileWatcher's callback would not be invoked, so even though I changed the files would not cause rebuilding.
from injectioniii.
Are you watching the right project? The project is taken from the active project when the app starts.
from injectioniii.
I found the real reson is the injection was stuck on the code bundlePath = [self readString]
in InjectionServer.mm
.
I noticed that the function runInBackground
had removed some code. Is it right?
from injectioniii.
Perhaps you have very long paths. I’ve moved the connection setup to the background thread. Are you building yourself or using the binary (updated) The changes are intentional. Most work is now on OSX
from injectioniii.
It can rebuild now. But still said symbol not found.
I found the symbol which cannot be found are in other framework or is created by runtime.
from injectioniii.
Is the symbol in a framework that is in the app bundle? It should be linking with them. Are you using Google Analytics or any other binary frameworks? The differences with InjectionApp are minimal now.
from injectioniii.
Yes,the framework is in the app bundle. In fact, it's a subProject and it's target is a dynamic framework. I found the setting of Symbols Hidden by Default
is YES. Is it the problem?
from injectioniii.
Could easily be. Injecting something that refers to hidden symbols inside another dynamically loaded library can be problematic. Files that don't should be OK. Did this work with the old injection?
from injectioniii.
I have checked . It didn't work either with the old injection. So which settings can I change? I found that only change Symbols Hidden by Default
would not work.
from injectioniii.
By the way, the error below still exist, the injected code was in a subProject.
ld: warning: ignoring file /tmp/eval2.o, file was built for i386 which is not the architecture being linked (x86_64): /tmp/eval2.o
It seems to build on a wrong architecture.
from injectioniii.
Strange "Symbols Hidden by Default” didn’t affect the framework. I’ve pushed a new version that re-instates the filtering by target architecture when looking for the compile which should fix the last problem you mentioned. Bit by bit this is becoming the old Injection!
from injectioniii.
I have resolve the symbol problem by remolve the setting of Exported Symbols File
. It seesms that the dylib file would not link the specific file when it was loading.
And the last problem had resolved. Now I can inject my project.
Thank you very much!
from injectioniii.
Great, thanks for sticking with the various iterations. Closing this now.
from injectioniii.
@johnno1962 I have a question that if there are a binary framework in my project, it means I cannot inject files related this framework? Have any way to resolve it?
from injectioniii.
What is the error?
from injectioniii.
such like this: dlopen() error: dlopen(/tmp/eval7.dylib, 2): Symbol not found: _OBJC_CLASS_$_CFT_F234309
In my project,the architecture like (MainProject (big dynamic Framework (somthing static library)))
when I try to inject the files which related the static libray,and these files are in framework, I will get the error.
from injectioniii.
Related Issues (20)
- Fatal error: NSArray element failed to match the Swift Array Element type HOT 1
- EXC_BAD_ACCESS after add var in swift class HOT 2
- Injection doesn't work with Xcode 15.2 HOT 10
- Multiple frameworks/targets issue HOT 3
- error: no such module 'FirebaseFirestoreInternalWrapper' HOT 4
- Error loading, when using mac target HOT 3
- Crash on reload every time HOT 6
- Loading .dylib has failed HOT 15
- EOF received from server.. HOT 2
- Setting up for macOS app dev HOT 21
- Is there a way to make injected macOS app not become active when it's reloaded? HOT 2
- Re-compilation failed HOT 5
- InjectionClient/Could not connect: Connection refused 🔥 HOT 18
- Hello, I reported the error when I used the real machine to debug, looking forward to your answer, thank you HOT 6
- Meaning of colors HOT 2
- It doesn't work on Xcode 15.3 iOS 17.4 HOT 14
- It doesn't work on xcode 15.3 (15E204a) HOT 7
- Loading .dylib has failed HOT 1
- TCA ObservableState crash HOT 3
- Unknown argument: -interposable HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from injectioniii.