Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,809,137 Members 49,630 Now Online
XDA Developers Android and Mobile Development Forum

Work with files in hook

Tip us?
(Last edited by pyler; 1st September 2014 at 05:48 PM.)
Senior Member - OP
Thanks Meter 441
Posts: 358
Join Date: Jan 2013
Default Work with files in hook

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?
GermainZ's Avatar
Forum Moderator / Recognized Developer
Thanks Meter 6,397
Posts: 5,476
Join Date: Aug 2012
Originally Posted by pyler View Post
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).
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes