johnno1962 / InjectionApp

Issue Tracking Repo for Injection as an App
MIT License
111 stars 7 forks source link

.m file duplicate error #38

Closed maksimpiriyev closed 6 years ago

maksimpiriyev commented 6 years ago

for the .m file changes it tries to compile but does not update and prints in the console as "Loading .dylib - Ignore any duplicate class warning..." also, it does not detect if the .cpp file is updated in case people use .c/.cpp projects with swift together

maksimpiriyev commented 6 years ago

note also that function i am trying is void doit(); in .h file

and in .m file

void doit(){
    printf("ahaa");
}
johnno1962 commented 6 years ago

You can ignore the “Duplicate class warning” but I’m afraid you can’t inject C++!

maksimpiriyev commented 6 years ago

but it is in objective-c file inside .m file and the code is not updated

maksimpiriyev commented 6 years ago

the class variable methods inside objective-c get updated but strangely not the ordinary global methods/functions

johnno1962 commented 6 years ago

You can only inject Objective-C or Swift methods, not global functions. They need to be dynamically dispatched.

maksimpiriyev commented 6 years ago

what do you mean "dynamically dispatched"?

johnno1962 commented 6 years ago

You can google that and get the answer but from injection’s point of view you can only inject methods of Objective-C or Swift classes is what you need to know.

maksimpiriyev commented 6 years ago

what about c++ virtual methods ?

maksimpiriyev commented 6 years ago

if i use them inside .mm file

johnno1962 commented 6 years ago

no

maksimpiriyev commented 6 years ago

I appreciate your feedback this tool is great