FORUMS
Remove All Ads from XDA

Bug report on fix_permissions.sh

8 posts
Thanks Meter: 1
 
By FlorentBL, Junior Member on 26th April 2011, 10:55 PM
Post Reply Email Thread
Hi all,

According to this thread (http://forum.xda-developers.com/show...522935&page=14) the fix_permissions.sh file can be found here:

Quote:
Originally Posted by ezterry

I usually just grab it from CyanogenMod's git hub when I need a stand alone copy (or to copy it into my ezGingerbread repo)

https://github.com/CyanogenMod/andro...ix_permissions

This post just to report that a line such as
Code:
FP_NUMS=$( $CAT /data/system/packages.xml | $EGREP "^<package.*serId" | $GREP -v framework-res.apk | $GREP -v com.htc.resources.apk | $WC -l )
is now false. Some ROMs get their packages.xml in /dbdata/system.

Something like this should be put in the code:
Code:
for dir in /dbdata/system /data/system; do
  [[ -d "${dir}" ]] && break
done
PACKAGES="${dir}/packages.xml"
Sorry for reporting here, but it seems that newbies cannot post in developers forums nor make a decent signature to inform on who they are
 
 
27th April 2011, 05:40 PM |#2  
teknowledgist's Avatar
Junior Member
Flag Albany
Thanks Meter: 4
 
More
Exclamation fix_permissions script fix for some ROMs
This saved my day/week/month!! Thanks man!

I got tired of having to re-configure all my apps after a re-flash (TBU backs up, but refuses to restore anything for me!!), so i've been wrestling with a bunch of settings recovered from a TBU archive. Dropping them into the proper locations caused all the relevant apps to FC. (I guess that's because the apps don't have rights to their settings.)

The only possible solution I've been able to find is to use fix_permissions, but the latest version (2.04) kept giving me an error and I'm too much of a noob to guess another location for packages.xml.

I changed your code a bit because the mod I'm using (Serendipity) has both a /dbdata/system and a /data/system directory, so it would have always used the first directory in the list. The change worked great though.

For other semi-capable hackers who might need this (and since I'm not in a position to post it back to github), I took the v2.04 of fix_permissions (here: github.com/CyanogenMod/android_vendor_cyanogen/raw/gingerbread/prebuilt/common/bin/fix_permissions) and added
Code:
for packdir in /dbdata/system /data/system; do
  [[ -f "${packdir}/packages.xml" ]] && break
done
PACKAGES="${packdir}/packages.xml"
in the Initialise vars section, and then changed the 4 instances of data/system/packages.xml to $PACKAGES

The updated version is attached below. Hope this helps someone too.
Attached Files
File Type: txt fix_permissions2.05.txt - [Click for QR Code] (14.6 KB, 407 views)
27th April 2011, 06:21 PM |#3  
OP Junior Member
Thanks Meter: 1
 
More
Glad to see that the post helps at least one person

Rereading it, I feel ashame by my mistake trying to mend the script

Anyway, your fix works of course.

By the way, the cause of all this seems bug traced in android code as bug 9976 (sorry I still cannot post the link, you'll have to find it by yourself in code.google.com)
26th February 2013, 10:19 PM |#4  
Junior Member
Thanks Meter: 0
 
More
I know I'm digging up an old thread, but I am having trouble locking down where fix_permissions.sh 2.04 came from. The link above doesn't work etc. I've pulled it from twrp recovery (though according to their page/source its rewritten in c++), not really sure how to compile just that as I only need the script.

Anyway, just as an FYI for anyone pulling the script from here, ther script there is a slight bug on line 251 that probably won't affect most people as long as cut works from the command line, but

Code:
   FP_OLDPER=$( $ECHO $FP_OLDPER | cut -c2-10 )
should be

Code:
   FP_OLDPER=$( $ECHO $FP_OLDPER | $CUT -c2-10 )
Only noticed this since I had to push over my own busybox and changed the commands to be ./busybox to use the busybox pushed with the script to the phone and noticed the cut command was failing.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes