Work with files in hook

917 posts
Thanks Meter: 955
 
By pyler, Senior Member on 1st September 2014, 05:44 PM
Post Reply Subscribe to Thread Email Thread
Hi, I have hook
Code:
findAndHookMethod(packageManagerService, null,
					"installPackageWithVerificationAndEncryption", Uri.class,
					"android.content.pm.IPackageInstallObserver", int.class,
					String.class, "android.content.pm.VerificationParams",
					"android.content.pm.ContainerEncryptionParams",
					installPackageHook);
I want to create files while I am in hook.
Code:
installPackageHook = new XC_MethodHook() {
			@Override
			protected void beforeHookedMethod(MethodHookParam param)
					throws Throwable {
                                        File backupApkFile = new File(APP_DIR + File.separator + "App.apk");
					backupApkFile.createNewFile();
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,274
 
More
Quote:
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