Post Reply Subscribe to Thread Email Thread

Work with files in hook

1st September 2014, 05:44 PM   |  #1  
OP Senior Member
Thanks Meter: 833
794 posts
Join Date:Joined: Jan 2013
Hi, I have hook
findAndHookMethod(packageManagerService, null,
					"installPackageWithVerificationAndEncryption", Uri.class,
					"", int.class,
					String.class, "",
I want to create files while I am in hook.
installPackageHook = new XC_MethodHook() {
			protected void beforeHookedMethod(MethodHookParam param)
					throws Throwable {
                                        File backupApkFile = new File(APP_DIR + File.separator + "App.apk");
I get EACCESS permission denied. Framework has all permissions, no?
Last edited by pyler; 1st September 2014 at 05:48 PM.
1st September 2014, 11:21 PM   |  #2  
GermainZ's Avatar
Forum Moderator / Recognized Developer / XDA Portal Team
Thanks Meter: 8,012
6,130 posts
Join Date:Joined: Aug 2012
Originally Posted by pyler

I get EACCESS permission denied. Framework has all permissions, no?

Your code runs in the hooked process, so you only have that process' permissions.

You can try hooking the PermissionGranter class to give the hooked package additional permissions, or e.g. send a broadcast to/directly start your own activity/service to write the file (from your own app's process, without Xposed).
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes