Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Work with files in hook

OP pyler

1st September 2014, 06:44 PM   |  #1  
OP Senior Member
Thanks Meter: 606
 
509 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 06:48 PM.
2nd September 2014, 12:21 AM   |  #2  
GermainZ's Avatar
Forum Moderator / Recognized Developer / XDA Portal Team
Thanks Meter: 7,330
 
5,910 posts
Join Date:Joined: Aug 2012
Donate to Me
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