Any way to reset permissions for all apps? (root)

Search This thread

britoso

Senior Member
Jan 13, 2010
2,794
302
Orlando
I've been playing around on my phone, esp with framework-res.apk :eek:.
Now many of my apps have their permissions screwed up (There was a UID mismatch on two seperate occasions)
The apps that show up in the log (below) sometimes FC becasue they dont have the right permissions granted.

Sample logcat on startup:
Code:
D/PackageManager(  141): Scanning app dir /data/app-private
D/PackageManager(  141): Scanning app dir /sd-ext/app-private
I/PackageManager(  141): Time to scan packages: 12.442 seconds
W/PackageManager(  141): Not granting permission com.android.launcher.permission.INSTALL_SHORTCUT to package com.google.code.appsorganizer because it was previously installed without
W/PackageManager(  141): Not granting permission android.permission.INTERNET to package lysesoft.andftp because it was previously installed without
W/PackageManager(  141): Not granting permission android.permission.BATTERY_STATS to package com.dynotes.miniinfo because it was previously installed without
W/PackageManager(  141): Not granting permission android.permission.INTERNET to package com.greenecomputing.linpack because it was previously installed without

I'm thinking an "adb install -r <file.apk>" for each of these apps will fix it...but before that I want to know if theres another/quicker way (reset to default permissions as in each app's apk).

thanks.
 

FaJu

Senior Member
Oct 11, 2009
88
0
Calgary
In AmonRa's recovery there is an option under the "Other" submenu called "Fix apk uid mismatches." It sounds like that is what you need.

Edit: Yeah I just checked, that is what you need. Once run, that script will give you a "fix_permission.log" file in the root of your sdcard.
 
Last edited:

britoso

Senior Member
Jan 13, 2010
2,794
302
Orlando
In AmonRa's recovery there is an option under the "Other" submenu called "Fix apk uid mismatches." It sounds like that is what you need.

Edit: Yeah I just checked, that is what you need. Once run, that script will give you a "fix_permission.log" file in the root of your sdcard.
That was what I used to fix the UID mismatches. The permissions problem still remains.
 

Jarmezrocks

Senior Member
Mar 25, 2011
960
495
Gold Coast
tinyurl.com
Try re-setting the permissions for each individual app in the actual install script.

Are they installed in system/app? I am assuming so?

If you know the permissions code number that you want to set for the app you can set it accordingly. If you want to try something just for testing to see if your app will work but not as a permanent proceedure try this:

Code:
set_perm(0777, 0777, 0777, "/system/app/your_app_name_here.apk");

This sets specific permissions to that app in particular as totally open, meaning anything can do anything to that app. Once you boot and test the app and see that it works then bring the permissions back on that app to be suitable.

You can also if you are not keen on installing to system partition do this
Code:
symlink("/data/app/your_app_name_here.apk", "/system/app/your_app_name_here.apk");
 

Jarmezrocks

Senior Member
Mar 25, 2011
960
495
Gold Coast
tinyurl.com
I'll upload you guys a boot init.d script that will reset permissions on your apps to correct 644 on every boot for after testing.

Can you please tell me what chipset details are? Like on galaxy S MTD system is something like /dev/block/mtdblock2 /system

What is system and data partitions on nexus one?

Once I know these details and if your ROM has init.d support then I the boot script will ensure that this is done on boot every time ;)