Remove All Ads from XDA

Work with files in hook

1,160 posts
Thanks Meter: 1,862
By pyler, Senior Member on 1st September 2014, 05:44 PM
Post Reply Subscribe to Thread Email Thread
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
Retired Forum Moderator / Recognized Developer / XDA Portal Team
Thanks Meter: 8,697
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

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes