Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
RealPariah
Old
(Last edited by RealPariah; 19th April 2012 at 06:37 PM.) Reason: Updated for a fix that works in ROM manager and remains between restarts and edited manual guide to fix ????? issue
#1  
Senior Member - OP
Thanks Meter 269
Posts: 824
Join Date: Aug 2010

 
DONATE TO ME
Default [FIX] Permissions Work Around for ICS

Script to flash via CWM to fix fix perms has been done by minotauri (sorry if miss spelled will fix when on a computer) he deserves credit for the edify:
To Run Fix Perms While in Recovery Flash this file each and every time you need it run [for now]:
http://goo.gl/hrL7E

The Next Script is one you can flash via CWM and it will replace the file ROM Manager uses so this will remain between restarts and you can use it via ROM Manager or Script Manager anytime you want!:
Thank Minotauri again for another beautiful Edify!
http://goo.gl/qPpC3

Flash via CWM and it well work for that flash just flash anytime you need to run it via recovery until I see about permanently copying it over existing script or still can run manually with this guide if you choose [scroll down below the additional update on how to fix the script to run using ROM Manager while in OS!].

I posted this in a couple ROM threads and was asked to throw it out here as folks from different ROMs are all affected. I can only speak for TMobile Galaxy S2 as that is what I own, drive and work on...

I will be cleaning up the post a bit when I get time just want it posted so others can use the information add it really seems to help clean up small issues (even some report fixing multiple FCs after running fix perms this way!)

NEWEST UPDATE 2012.04.19

OK FIX FOR RUNNING FIX PERMS INSIDE OS VIA ROM MANAGER

If you adjust first line in script to #!/system/xbin/sh viola ROM Manager does not freeze [finally]

I did this with Ghost Commander [don't forget settings> check auto root] and long press fix_permissions and choose edit tapping it will have GC try to execute it.

I also moved down to set variables piece and placed 1s instead of 0s next to mount system, mount data, and remove (as in REMOVE stale data ) [should be all caps in /data/data/com.koushidutta.rommanger/files/fix_permissions

I am still working on finding a way of making those changes permanent in /sbin under recovery boots

Fix Permissions Work Around ICS

Run Fix Permissions via ADB Shell with Phone in Recovery

I have taken the time to document what should be a complete guide to running fix permissions while the phone is in the Recovery menu using adb.
I am posting the quick steps right after this, but if you scroll below that this is an extended step-by-step guide.
Code:
Running Fix Permissions

On Phone: go in to Mounts and Storage Menu from Main Menu and choose to mount /data and /system
On Computer: type adb shell
This should give you a ~# prompt
Now type "sh /sbin/fix_permissions -l -r" [without quotes]
and now you should see a bunch of text scroll by and then it will say fix permissions completed blah when done.
that's it type exit and hit enter about 3x [one will change ~# to ~$ then it will drop back to C:\blah and then one more time will close that window as well
Supplies [Phone, USB Cable and Android SDK (http://developer.android.com/sdk/index.html)
Follow the link to install Android SDK [they have directions on site]

first time installing adb? [Skip otherwise]

To Add ADB to your computers path [to run it from any directory]
Windows:
Open Command Prompt [Click Start, Click Run, Type in cmd and hit Enter [XP]]
Open Command Prompt [Click Start, type cmd in whitebox and hit Enter [Vista and 7]]
type set PATH=%PATH%;C:\android-sdk\platform-tools [or wherever you put android sdk just add platform-tools to the end [it is a hidden folder]
Linux [OSX should be same]:
PATH=$PATH:/home/user/android-sdk/platform-tools [or adjust for where you saved it]
export PATH


Now That You Have ADB and path set, time for good stuff

Opening a Command Processor

Open a Command Prompt [Windows] or Terminal [Linux or OSX]
Windows: Click Start, Click Run, Type cmd and hit enter [XP]
Click Start, type in to Whitebox cmd and hit Enter [Vista and 7]

Linux: Hold alt and hit F2 on keyboard [should see a run box now]
Type in xfce4-terminal and hit Enter [or substitute your terminal command this is xubuntus]

Once a Black and White Screen Opens...

Gaining Elevated [Admin or Root Privileges]
Ok, some further testing shows me you should have root or admin access to command processor before running ADB.

In Windows
Type The Following in to the command prompt window already open...
runas /user:%computername%\administrator cmd
hit enter when done
[yes just like that including %computername% windows will fill it in with proper info copy/paste if needed right clicking in command window should paste text for you [if not right click on the icon in left hand corner of title bar choose properties and place checks in the quick edit and insert mode boxes under Options tab]
now it will ask for a password if you have not set one you need to go to control panel users and set a password on admin account before this will work
Once you enter the password and hit enter a second command window will open and will have Administrator in the title
Now You can continue on

In Linux
With Terminal window open type:
gksudo xfce4-terminal& [sub your terminal command if not using xubuntu]

once you hit enter it may take a second but you will get a password prompt enter in your password and a new terminal will open and it will have Root@ in the title

Now you can continue on...

Checking USB Connection

type in adb devices and hit enter
[if you get a command not found you will have to use cd to move to directory with adb [ie cd c:\android-sdk\platform-tools]

If it comes back with ?????? as serial number it is not connecting correctly follow the next steps otherwise skip the next bit if you didnt get all ?

I get ?????, what gives?
This seems due to not running command prompt or terminal as administrator or root user [Windows / Linux Respectively]
You will need to do the following in order
Disconnect USB from phone
On Phone: In Advanced menu choose restart recovery
On Computer: type in adb kill-server and hit enter
Reconnect USB cable
Be Sure To Follow Section above labeled: Gaining Elevated [Admin or Root Privileges] and then continue on
On Computer: type adb devices and you should see a mix of letters and numbers
and that means we are good to go on

Running Fix Permissions

On Phone: go in to Mounts and Storage Menu from Main Menu and choose to mount /data and /system
On Computer: type adb shell
This should give you a ~# prompt
Now type "sh /sbin/fix_permissions -l -r" [without quotes]
and now you should see a bunch of text scroll by and then it will say fix permissions completed blah when done.
that's it type exit and hit enter about 3x [one will change ~# to ~$ then it will drop back to C:\blah and then one more time will close that window as well

Device: TMobile Samsung Galaxy S2 [SGH-T989]
ROM: Yaldak's Vanilla ICS RC2
Radio: Blaze ICS
Performance Mod: Supercharger v6 update 8
Client: Xparent Green TapaTalk [latest]
The Following 13 Users Say Thank You to RealPariah For This Useful Post: [ Click to Expand ]
 
RealPariah
Old
(Last edited by RealPariah; 18th April 2012 at 05:14 PM.)
#2  
Senior Member - OP
Thanks Meter 269
Posts: 824
Join Date: Aug 2010

 
DONATE TO ME
Known Issues:
-------

Issue: My computer does not connect when I use adb shell [or I get ????? when I use adb devices]
Resolution:
I have found that i have to connect my phone 2x to computer to get it to work correctly most of the time, do the following
  1. Disconnect USB from phone
  2. In advanced menu on phone choose Restart Recovery
  3. on computer: adb kill-server
  4. Reconnect USB cable
  5. on computer: adb devices
and you should now see a mix of numbers and letters and not ????? and now adb shell should connect

Issue when I try sh fix_permissions it says it can not find the file
Resolution: This is normally caused when you have not mounted /system [via phone]
or you did not use sh /sbin/fix_permissions [or be sure to do cd /sbin before sh fix_permissions

Issue: I get UID Read-only variable error and fix permissions does not run
Resolution: This is normally caused by either not mounting /system [via phone]
or not using sh fix_permissions.

Issue: Some of my apps are listed as /data/blah and it says it can not find the file
Resolution: This is normally caused by not mounting /data [via phone]

Issue: CWM will not mount /system or /data saying it can not find or read them
Resolution: I have found CWM does not like to load mounts once they are encrypted. If you have encrypted your device /system and /data are affected, try unencrypting your phone and trying again.
(this is a good thing it shows third parties tools trying to get around booting OS to read data will not be able to get at the information in your phone)


Device: TMobile Samsung Galaxy S2 [SGH-T989]
ROM: Yaldak's Vanilla ICS RC2
Radio: Blaze ICS
Performance Mod: Supercharger v6 update 8
Client: Xparent Green TapaTalk [latest]
 
jangst123
Old
(Last edited by jangst123; 19th April 2012 at 12:57 AM.)
#3  
jangst123's Avatar
Senior Member
Thanks Meter 745
Posts: 1,095
Join Date: Dec 2010
Location: Bucks County, PA
SEE This post for the current script
http://forum.xda-developers.com/show...4&postcount=22


Sent from my SAMSUNG-SGH-T989 using xda premium
Posting Etiquette - Don't Anger a Developer


LOGCAT like a Pro!

Lend a hand, learn to LOGCAT!!

[REF] What will Not work on ROOTed Phones / Work Around

Galaxy S IV Rockin Stock for Now
Galaxy S III [ROM] AOKP or Infamous
Samsung Galaxy SII AOKP and DARKSIDE
Samsung Galaxy Tab 10.1 on Android Open Kang Project
 
RealPariah
Old
#4  
Senior Member - OP
Thanks Meter 269
Posts: 824
Join Date: Aug 2010

 
DONATE TO ME
Well judging by the title that you have there referred to running the script via recovery adb to begin with.

A lot of users don't realize if fix perms says complete in 2 secs it had a problem so I didn't know of that thread, but hope this will be a catch all for fix perms and not just for those who already tried via recovery and adb shell and got that specific error.

Thanks for looking out though

Device: TMobile Samsung Galaxy S2 [SGH-T989]
ROM: Yaldak's Vanilla ICS RC2
Radio: Blaze ICS
Performance Mod: Supercharger v6 update 8
Client: Xparent Green TapaTalk [latest]
 
minotauri
Old
#5  
Senior Member
Thanks Meter 120
Posts: 500
Join Date: Jun 2008
Location: Seattle, WA

 
DONATE TO ME
Quote:
Originally Posted by jangst123 View Post
This is already and has been in the Q & A section.... Not development, but I wish the developers would look at it and figure out why we have issue on ICS


http://forum.xda-developers.com/show....php?t=1595806[Q] Problem with Fix Permissions (line 64: UID readonly variable) [WORK AROUND FOUND]


Sent from my SAMSUNG-SGH-T989 using xda premium
I think posting this in Dev section is perfect sense. Also, thanks for the fix. This has stumped me for a while trying to figure out what to do.
PHONE: Google LG Nexus 4, iPhone
TABLET: iPad (3rd Gen)

Twitter: http://www.twitter.com/antnguyen
 
OGWisdom
Old
#6  
OGWisdom's Avatar
Senior Member
Thanks Meter 875
Posts: 574
Join Date: Aug 2009
Location: Milwaukee-414

 
DONATE TO ME
When trying this, I get the message:

cat: can't open '/data/system/packages.xml': No such file or directory.

It says that twice and concludes with fix permissions ended at yada yada. I followed every command and instruction to the letter, what could be the issue?


...OGWisdom-The 1 & Only...

Follow Me:
TWITTER
Google+
 
l-levit
Old
#7  
Member
Thanks Meter 8
Posts: 53
Join Date: Mar 2011
Location: PA
Hey I got idea,, lets make another thread in the general section and Themes,,
Sorry don't think this belongs here, IMO
MOD,, please delete 1 of the threads,, or merge them or something,, no point in having 2
Not that I'm not happy a work around has been found!
Hopefully now the developers will figure out the source of the problem
 
Dougshell
Old
#8  
Senior Member
Thanks Meter 736
Posts: 951
Join Date: Feb 2012
would it be possible to bake this into a rom, or to create a CWMR zip file to make the needed changes?
The Following User Says Thank You to Dougshell For This Useful Post: [ Click to Expand ]
 
ShermCraig
Old
#9  
ShermCraig's Avatar
Senior Member
Thanks Meter 62
Posts: 409
Join Date: Oct 2009
Location: New York City
Quote:
Originally Posted by Dougshell View Post
would it be possible to bake this into a rom, or to create a CWMR zip file to make the needed changes?
+1 I'm completely stumped!
 
peppersu812
Old
#10  
peppersu812's Avatar
Senior Member
Thanks Meter 211
Posts: 1,028
Join Date: Mar 2012
Location: Douglasville, GA
I can't get adb to even reconize the damn phone im on ravers remix to ics

 
Post Reply+
Tags
fix permissions, fix permissions ics, ics
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...