5,604,730 Members 31,878 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
britoso
Old
#1  
britoso's Avatar
Senior Member - OP
Thanks Meter 277
Posts: 2,705
Join Date: Jan 2010
Location: Orlando

 
DONATE TO ME
Question Any way to reset permissions for all apps? (root)

I've been playing around on my phone, esp with framework-res.apk .
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.
Software Developer (Java/J2EE)
Phone: Nexus 5 32GB -> Beanstalk CM11
Phone: Galaxy Nexus-> OmniMetal CM11
Phone: Nexus One (killed while replacing the digitizer)-> CM10.1 AOKP Unofficial Nightlies
Tablet
: Nook Color -> CM10.1 Nightlies
Tablet
: HP Touchpad -> CM10.1 -SCHIZOID
Stick: CX-919 RK3188/2GB (4.2.2 Finless 1.6b. FHD no-OC. Antutu 16753 Quadrant 4723)

Links:
»My Apps (ancient now) [CPUStatusLED] [MoreRecent]
»My Threads
»My Posts
»Transparent widgets
 
FaJu
Old
(Last edited by FaJu; 18th April 2010 at 03:30 AM.)
#2  
Member
Thanks Meter 0
Posts: 88
Join Date: Oct 2009
Location: 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.
 
britoso
Old
#3  
britoso's Avatar
Senior Member - OP
Thanks Meter 277
Posts: 2,705
Join Date: Jan 2010
Location: Orlando

 
DONATE TO ME
Quote:
Originally Posted by FaJu View Post
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.
Software Developer (Java/J2EE)
Phone: Nexus 5 32GB -> Beanstalk CM11
Phone: Galaxy Nexus-> OmniMetal CM11
Phone: Nexus One (killed while replacing the digitizer)-> CM10.1 AOKP Unofficial Nightlies
Tablet
: Nook Color -> CM10.1 Nightlies
Tablet
: HP Touchpad -> CM10.1 -SCHIZOID
Stick: CX-919 RK3188/2GB (4.2.2 Finless 1.6b. FHD no-OC. Antutu 16753 Quadrant 4723)

Links:
»My Apps (ancient now) [CPUStatusLED] [MoreRecent]
»My Threads
»My Posts
»Transparent widgets
 
FaJu
Old
#4  
Member
Thanks Meter 0
Posts: 88
Join Date: Oct 2009
Location: Calgary
Oh that's weird. Sorry I got nothing.
 
Jarmezrocks
Old
#5  
Jarmezrocks's Avatar
Senior Member
Thanks Meter 380
Posts: 836
Join Date: Mar 2011
Location: Gold Coast

 
DONATE TO ME
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");

help find a cure for Narcolepsy
donations to this cause do not come directly to me, they are
anonymous but please tell me so I can give you thanks
 
Jarmezrocks
Old
#6  
Jarmezrocks's Avatar
Senior Member
Thanks Meter 380
Posts: 836
Join Date: Mar 2011
Location: Gold Coast

 
DONATE TO ME
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

help find a cure for Narcolepsy
donations to this cause do not come directly to me, they are
anonymous but please tell me so I can give you thanks
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...