[Q] Xposed hooking variadic function - Xposed General

Hi
How can I hook variadic function with Xposed?
I'm trying to hook invoke method: invoke(Object receiver, Object... args)
with: findMethodBestMatch(java.lang.reflect.Method.class, "invoke", Object.class);
but getting method not found exception.
Any ideas?

Should work if you use Object[].class as the second argument's ("args") class.

GermainZ said:
Should work if you use Object[].class as the second argument's ("args") class.
Click to expand...
Click to collapse
Thank you very much!!!!
Its working now

Related

[Q] Can I use XPOSED in the thread??

Can I use XPOSED in the thread??
Because the HOOK is not the system libraries...Package is a third party...
So...XPOSED to work.. Third party package haven't loaded..
So... To be a new thread.. The class library circulation continued to search a third party
Who can provide an example?
Thanks...
Can you give some more details about your problem, preferably with some code? What exactly are you trying to hook and where (again, it's best if you provide code)? What exactly are you trying?
GermainZ said:
Can you give some more details about your problem, preferably with some code? What exactly are you trying to hook and where (again, it's best if you provide code)? What exactly are you trying?
Click to expand...
Click to collapse
ATTACH FILES use JD-JUI Open it....
look this...
com.tools.filemanager.a.handleMessage
package com.tools.filemanager;
class a
Method: public final void handleMessage(Message paramMessage)
I want hook this method...
GermainZ...you know me??
help me please.....
Thanks..........
Just hook it like any other method. If you can't do that, post the code you tried and the error you're receiving. You might want to search first.
No idea why you keep referring to threads, though.
GermainZ said:
Just hook it like any other method. If you can't do that, post the code you tried and the error you're receiving. You might want to search first.
No idea why you keep referring to threads, though.
Click to expand...
Click to collapse
because I CALLED [[public void handleLoadPackage]]...
but method handleLoadPackage.. in method To out method..All resourse is Release...
So...All res released...But don't execute ClassLoader com.tools.filemanager.a
So..I mean use new thread...Loop execute method handleLoadPackage...
until Hooked com.tools.filemanager.a.handleMessage
[email protected] said:
because I CALLED [[public void handleLoadPackage]]...
but method handleLoadPackage.. in method To out method..All resourse is Release...
So...All res released...But don't execute ClassLoader com.tools.filemanager.a
So..I mean use new thread...Loop execute method handleLoadPackage...
until Hooked com.tools.filemanager.a.handleMessage
Click to expand...
Click to collapse
Sorry, can't help you without the code you're actually trying, and you're being too vague.

Xposed cant find method

Code:
XposedHelpers.findAndHookMethod(packageManagerService, null,
"deletePackageAsUser", String.class,
"android.content.pm.IPackageDeleteObserver", Integer.class, Integer.class /*delelePackageArgs*/, deletePackageHook);
Xposed cant find this method.
That method probably doesn't exist for the Android version you're using.
Exists.
https://github.com/android/platform.../android/server/pm/PackageManagerService.java
GermainZ said:
That method probably doesn't exist for the Android version you're using.
Click to expand...
Click to collapse
So which Android version are you using? Also, are you using a custom ROM?
GermainZ said:
So which Android version are you using? Also, are you using a custom ROM?
Click to expand...
Click to collapse
No, stock 4.4.4 on Nexus 7.
Well, there's no deletePackageAsUser method in the class you linked.
GermainZ said:
Well, there's no deletePackageAsUser method in the class you linked.
Click to expand...
Click to collapse
https://github.com/android/platform.../server/pm/PackageManagerService.java#L10001?
Problem solved. I used Integer.class, but i should use int.class.
pyler said:
https://github.com/android/platform.../server/pm/PackageManagerService.java#L10001?
Click to expand...
Click to collapse
Ah, sorry. I was on mobile data and the page must've been cut off because searching showed no matches.
pyler said:
Problem solved. I used Integer.class, but i should use int.class.
Click to expand...
Click to collapse
Good to know you got it fixed. :highfive:

Debugging PacakgeInstaller

Hi,
I'm trying to learn how the PackageInstaller works.
I want to create an Xpossed model that can control package installations, so I would like to understand how the installation machanisim works (how can i stop installation, how can i restart installation, how can i trigger installation and so...)
Thanks,
Gidi
Have you checked the Android source code?
GermainZ said:
Have you checked the Android source code?
Click to expand...
Click to collapse
Hi,
Of course. I'm using it. But what i meant is how to can i debug it (step by step) on runtime ?
Thanks.
shnapsi said:
Hi,
Of course. I'm using it. But what i meant is how to can i debug it (step by step) on runtime ?
Thanks.
Click to expand...
Click to collapse
This might help: https://github.com/MohammadAG/Xposed-Method-Finder
It basically hooks all methods of the specified classes and logs when they're called.

Can this app be made?

thanks all sorted
Hi
I did this quickly if you want to try : https://github.com/midsylen/SMSResponse
Midsylen said:
Hi
I did this quickly if you want to try
thankyou midsylen, how do i load it do i place the folder on my phone and run the .bat file???
Click to expand...
Click to collapse
marky351 said:
Midsylen said:
Hi
I did this quickly if you want to try
Click to expand...
Click to collapse
thankyou midsylen, how do i load it do i place the folder on my phone and run the .bat file???
Click to expand...
Click to collapse
You would need to compile it in Android Studio and then sideload the compiled APK file! I can try and do this for you in the next day or so once I finish my last exam. Let me know if you still have questions.
Midsylen said:
Hi
I did this quickly if you want to try
shimp208 said:
You would need to compile it in Android Studio and then sideload the compiled APK file! I can try and do this for you in the next day or so once I finish my last exam. Let me know if you still have questions.
Click to expand...
Click to collapse
thanks that would be great, i'll try myself first also but if u have any spare time it would be much much appreciated
Click to expand...
Click to collapse
Oh i thought you had some dev skills so I just made the required classes but the app isn't really usable if you build it, you can't choose the phone number from the app for example. When I'll have some time i'll try to do a more usable app where you can put the number of the contact.
i dont use android studio but cant he just edit the line where it says private static final String PHONE_NUMBER = "+1234567890"; to what ever the phone number is he needs to use
nucleisoft said:
i dont use android studio but cant he just edit the line where it says private static final String PHONE_NUMBER = "+1234567890"; to what ever the phone number is he needs to use
Click to expand...
Click to collapse
Could though it's not much work to add in a input field for putting in the number.
composed it and modified it a little to get it working thankyou for all your help guys

Is it possible to execute something as another app?

Sorry I wanted to post this in the dev forum here, but I can't. Basically I want to execute some piece of code but as another app. For example sending a notification from another app than my Xposed Module. It should instantly do that and not hook into a method and wait for it to be executed. Is that possible and if yes can anyone tell me how to do it?
RunnableXDA said:
Sorry I wanted to post this in the dev forum here, but I can't. Basically I want to execute some piece of code but as another app. For example sending a notification from another app than my Xposed Module. It should instantly do that and not hook into a method and wait for it to be executed. Is that possible and if yes can anyone tell me how to do it?
Click to expand...
Click to collapse
Nevolution by Oasis Feng does that even without Xposed, it only needs Root, so it's possible. But how? No idea :angel:
Sent from my cedric using XDA Labs

Categories

Resources