Post Reply

Work with files in hook

1st September 2014, 05:44 PM   |  #1  
OP Senior Member
Thanks Meter: 450
 
362 posts
Join Date:Joined: Jan 2013
More
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
Thanks Meter: 6,546
 
5,562 posts
Join Date:Joined: Aug 2012
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


Top Threads in Xposed General by ThreadRank