yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] rikupw:
hrm...

actually, i was thinking more along the lines of quick permissions fixing, attatched is an actual ZIPPED file which includes WITHIN itself the fix_permssions change, I can't get it to work :-/ don't fret over my hack/slash, but I'm just trying to make things more simple for the user who only saves a few files after wiping...

perhaps instead of the .apk path variable we can use the /data/data/blah.goo.dir check for single packaging

PS: THE ATTATCHED SCRIPT DOES NOT WORK... :-/ I'm not sure how to get it to work... I think I'm close though.

-riku

again, don't fret if its not easily done, if it is easily done, again pardon my lack of understanding.

EDIT:

more clarification on to why i'm (attempting to) modifying the script.

I know that from console I am able to cat/grep the packages.xml to a single line, e.g.:

cat /data/system/packages.xml | grep 'system="true"'

would render only system packages

using that, is it possible to make the script instead of "skipping" for each system individually, skip them entirely to save time?

the same thing would be just as easy to apply with single package mode! :) I know I can modify the script individually to grep only non-system, but I would very much like the option. :-/ and I'm not entirely certain on how to write code, just cut and splice it :-/ obviously >.>
[G1 Android Development] farmatito:
This will be more difficult for the user because it is simpler to find out the name of the apk rather than the path in /data/data/ that could be very different, fancy and long.

I don't understand the need for speeding up this script as it not used often

but only in emergency situations e.g. after a new flash or after having messed up the rom.

I'll take a look at your version ASAP after i finish working on the next option

(-c) to clean up packages.xml file from leftovers ;-)
[G1 Android Development] rikupw:
thanks farmitito! :) I'm thinking that if we have to parse through system/data files anyway even if the -u/-f option is used, we might as well just not use those options, though with the -f option I'd like to simply check only that directory, skip entirely the "check if skip needed" thing. :)

at any rate, that -c option would be nice! i have a few apps in packages.xml i'd like removed 0.0 haha

HECK, I know if you use the same cat/grep combo and add $GREP "PackageInstaller" it'd only parse through the packages.xml that have "PackageInstaller" in their names! (name="*PackageInstaller*" so to speak)

so it shouldnt' be too difficult anyway :D

busybox cat /data/system/packages.xml | busybox grep "^<package" | busybox grep "PackageInstaller" | busybox grep serId | busybox grep -v framework-res.apk

outputs only this:

<package name="com.android.packageinstaller" codePath="/system/app/PackageInstaller.apk" system="true" ts="1254597762000" version="4" userId="10009">

if you added the cat/grep for -f/-u before you started the actual checking, you'd remove the long drawn out wait for the script to finish.

in fact, if you replace line 160 in 1.31 fix_permissions script with the example above, and ran simply "fix_permissions" from terminal, you'd see it work easy. I just have no idea how to parse the options correctly

PS: regarding the speed up, I see what you're saying, and I suppose I could always just make seperate scripts for myself to use. however, I think it coudl be useful to a frequent wipe/flasher like me,

I personally enjoy playing sudoku, and I use OpenSudoku alot! :) and have backup scripts specifically designed FOR opensudoku. so that when I flash, I can install opensudoku, open it up, close it, copy the data back, and then run fix_permissions to set everything back to what it should be. never had any issues before :) (still don't, just trying to be featureful)
[G1 Android Development] farmatito:
In fact we just parse packages.xml and skip the packages if they don't have

the correct name or if they don't are in the correct dir.

I see, but i think that to use this you have to refactor the remaining code

heavily and maybe you'll end with 2 different routines doing the same thing,

making it harder to maintain....maybe I'm just to lazy ;-)
[G1 Android Development] rikupw:
VOILA!

BINGO! got it to work like I wanted ;) :D

simply made the variable $ONLY_ONE="" and made an if then statement for NOSYSTEM="1" to make $ONLY_ONE='system="false"'

the attatched zip contains the 1.31 file, I commented out what I did not put, and added comments to what I did put as #change start/end

:) hope this makes sense ;)

-riku

\

PS: its default 1.31 with a little modification

you can use -f or -u to grep the results BEFORE the scripting actually begins, so no need to say "skipping"

its much quicker, not sure if its faster or not though, tell me what you think!

I also added a sidenote within it for you, as i was too busy makring my changes to add it here! cheers!
[G1 Android Development] k4str0:
*EXPERIMENTAL* ;););)

****WARNING: this version does not check existing permissions it just sets them, which is much much much faster; I've only tested this on a G1 so need more testers to validate functionality****

# v2.00	- Completely rewrote the script for SPEED BOOST (100 apps = 1 minute)

# /data/data depth recursion is tweaked;

# fixed single mode;

# functions created for modularity;

# logging disabled by default for even more speed;

# runtime computation added to end (Runtime: mins secs);

# progress (current # of total) added to screen;

# fixed CLI argument parsing, now you can have more than one option!;

# debug cli option;

# logging cli option;

# verbosity cli option;;

# [by Kastro, (XDA: k4str0), twitter;mattcarver]

Usage:

-f fix only package APK_NAME/PATH

-r remove stale data directories

of uninstalled packages

-l enable logging for this run (slower)

-v enable verbosity for this run (slower)

-u check only non-system directories

-V print version

-h this help

Examples:

fix_permissions -l -v -f tether

---runs fix permissions with increased verbosity and logging to a line that matches "tether" (case-insensitive) in packages.xml. Errors if more than 1 package is matched. Options can be flipped (e.g fp -f tether -v -l)

fix_permissions

---runs fix permissions on all apps, very fast!

fix_permissions -V

---prints the version and exits

fix_permissions -v

---runs fix permissions without logging and with verbosity to screen (more noise)

****WARNING: this version does not check existing permissions it just sets them, which is much much much faster; I've only tested this on a G1 so need more testers to validate functionality****

I've posted this version to the CM issue tracker as well: http://code.google.com/p/cyanogenmod/issues/detail?id=14
[G1 Android Development] rketzeback:
im dumeass how do u get back the allow on the terminal after u dont allow?

im trying 2 get back my market and my calendar and the gmail they just close right away.

some body tell me how to get it back?

im running cm 4.2.2

rketzeback@yahoo.com
[G1 Android Development] farmatito:
Looks good to me, just cleaned up a little the indentation and a minor typo.

Will test it this evening when I'm back from work.

The only concern is about the use of functions, I avoided

them as I was not sure if the default android shell supports

them, if not we should change #!/system/bin/sh to something

like #!/system/xbin/bb/sh. Did you test it with the default shell?
[G1 Android Development] k4str0:
Yes, I tested it with the default shell. I just put the script in /system/sd for now to not overwrite the default fix_permissions.

-----

Let me clarify what I said above for anyone out there (except farmatito since he looked at the script ;)), it does actually check permissions on the files (not folders) nested in /data/data before changing them. All other files and directories are just forced to what we already know to be the correct perms/ownership. I am still looking for a better way to do things but unfortunately busybox's find command doesn't support -a -and -or expression combinations.
[G1 Android Development] farmatito:
I did a little testing of the 2.00 version of the script and have a few critics that i hope will help to further improve it:

1) turning off logging and verbosity by default is a big mistake as it will leave you with no way to help users when things go wrong

2) the need for speed in this script is a false problem as it is not run often

3) your implementation always writes new permissions for all files so causing

needless wear of flash and sdcard, maybe better stay on the safe side and do writes only when they are needed

4) -r remove stale data directories, at least in the previous implementation, was intentended to ONLY remove stale directories and not

to fix/change permissions at the same time, this is not obvious to the user

that can be aware of it only if logging and verbosity are turned on, so you should revert to the previous behaviour or change the help text.

I also have spotted some differences by running 1.13 after 2.00:

Changing user ownership for: /data/data/org.zenthought.android.su/cache/.transportgsU517/info from '0' to '1000'

Changing group ownership for: /data/data/org.zenthought.android.su/cache/.transportgsU517/info from '0' to '1000'

Changing user ownership for: /data/data/org.zenthought.android.su/cache/.transportgsU517/result from '0' to '1000'

Changing group ownership for: /data/data/org.zenthought.android.su/cache/.transportgsU517/result from '0' to '1000'

Changing user ownership for: /data/data/org.zenthought.android.su/cache/.transportKNn502/info from '0' to '1000'

Changing group ownership for: /data/data/org.zenthought.android.su/cache/.transportKNn502/info from '0' to '1000'

Changing user ownership for: /data/data/org.zenthought.android.su/cache/.transportKNn502/result from '0' to '1000'

Changing group ownership for: /data/data/org.zenthought.android.su/cache/.transportKNn502/result from '0' to '1000'

Changing user ownership for: /data/data/org.zenthought.android.su/cache/.transportvsU615/info from '0' to '1000'

Changing group ownership for: /data/data/org.zenthought.android.su/cache/.transportvsU615/info from '0' to '1000'

Changing user ownership for: /data/data/org.zenthought.android.su/cache/.transportvsU615/result from '0' to '1000'

Changing group ownership for: /data/data/org.zenthought.android.su/cache/.transportvsU615/result from '0' to '1000'

and

Changing permissions for: /data/data/com.android.providers.subscribedfeeds/shared_prefs/subscribedFeeds.xml from rw-rw-r-- to rw-rw---- (660)

so behaviour is not fully consistent, better? worse?

Hope this helps. :)

PS.: -f and -u seem to work well so far
[G1 Android Development] k4str0:
First off, I don't want to sound defensive here so if it does, please take it with a grain of salt. I do appreciate your feedback and perhaps we can incorporate all of the ideas here for exactly what this thread was intended to create, an improved fix_permissions script.

Agreed. The default behavior can be easily reversed to make logging default and the -l switch can disable logging.

Personally, I have had to run fix_permissions many times and always hated waiting 10 minutes for it to complete. I don't have expectations for it to complete instantly, but it would be nice to have it run faster with some indication of when it plans to finish. My biggest problem with the older fix_permissions script was that its recursion into webcacheView on browser took *forever* to complete. Using find with a "! -perm <REVPERM>" allowed the bundling of finding improper permissions at the same time the recursion took place, rather than pulling line by line with a find and using another "ls -l" with lots of "cut" to get the desired output.

As you stated in #2, the script isn't run very often so the sd wear shouldn't be a problem. I would say a better reason to avoid changing the permissions without checking is for logfile purposes. Without checking first, basically all data/data directories and apks would be changed and there would be no way to know what they were before the change took place. Maybe we can have a switch to "force" for advanced users who just want the end result regardless of what might happen :) I'll look into this.

Agreed.

My only assumption is that the cache directories were empty when you ran 2.0.0. My directory is empty.

# cd /data/data/com.android.providers.subscribedfeeds/shared_prefs
# ls -l
-rw-rw-r--	1	1000	1000	120	Oct 29 18:02	subscribedFeeds.xml
# cd /system/sd
# ./fix_permissions -v -f subscribedfeeds
..clipped..
Setting permissions to '660' for '/data/data/com.android.providers.subscribedfeeds/shared_prefs/subscribedFeeds.xml'
..clipped..
# cd /data/data/com.android.providers.subscribedfeeds/shared_prefs
# ls -l
-rw-rw----	1	1000	1000	120	Oct 29 18:02	subscribedFeeds.xml

The codeblock above is for 2.0.0. I even rebooted afterwards and it still stayed at 660. This particular file must change back to 664 at some point.

I originally thought that some shared_prefs and databases should be 664 or 666 since they can be set to MODE_WORLD_WRITABLE and MODE_WORLD_READABLE. I just could not find any references to where that information is stored. Perhaps I will write a quick test APK and set those flags to see what happens.

--------------------

farmatito, I really appreciate your ideas and feedback and I'll make some changes accordingly. Maybe we can get the best of both worlds, more speed and options without sacrificing anything? :)
[G1 Android Development] farmatito:
I'm sure we can :D
[G1 Android Development] k4str0:
And we have! Attached! fix_permission 2.01. I made the changes you suggested and tweaked some of the $TEST commands in start and end functions. Logging is on by default and verbosity is on by default. The switches will invert whatever the default setting is, so if someone permanently wants logging or verbosity off, they can disable it in the script by setting LOGGING and VERBOSE to "0". If the default is changed in the script, logging and verbose can be re-enabled ad-hoc from the CLI using the switches.

All permissions are now checked before changing and it is logged what the existing permissions were just like fp_1.30+. Speed is a little slower though but still at least 5 times faster than the old fix_permissions.

I still would like to test creating an APK with MODE_WORLD_WRITABLE and MODE_WORLD_READABLE databases and shared_prefs to see what the files look like after I install it. Won't be able to do this type of testing for another week or two.

*** WARNING! This is an experimental version of fix_permissions. This is not the official version at this time. Use at your own risk! ***

# v2.01	- Completely rewrote the script for SPEED, thanks for the input farmatito

# /data/data depth recursion is tweaked;

# fixed single mode;

# functions created for modularity;

# logging can be disabled via CLI for more speed;

# runtime computation added to end (Runtime: mins secs);

# progress (current # of total) added to screen;

# fixed CLI argument parsing, now you can have more than one option!;

# debug cli option;

# verbosity can be disabled via CLI option for less noise;;

# [by Kastro, (XDA: k4str0), twitter;mattcarver]

*** WARNING! This is an experimental version of fix_permissions. This is not the official version at this time. Use at your own risk! ***
[G1 Android Development] farmatito:
# v2.02 - ignore com.htc.resources.apk if it exists and minor code cleanups,

# fix help text, implement simulated run (-s) [farmatito]

*** WARNING! This is an experimental version of fix_permissions.

Enjoy!
[G1 Android Development] k4str0:
*** WARNING! This is an experimental version of fix_permissions. This is not the official version at this time. Use at your own risk! ***

# v2.03 - fixed chown group ownership output [Kastro]

*** WARNING! This is an experimental version of fix_permissions. This is not the official version at this time. Use at your own risk! ***

Seems to be running fine and pretty fast :)
[G1 Android Development] kyleds:
help

hey guys,

I'm getting the fix_permissions problem with current cm.

................................

f/ # fix_permissions

/system/bin/fix_permissions 2.03 started at 01-13-2010 03:40:33

143 does not exist (1 of 143). Reinstall...

/system/bin/fix_permissions 2.03 ended at 01-013-2010 03:40:34 (Runtime:0m1s)

...............................

how do i fix this? is there something simple i can type in terminal to fix?

Thanks!
[G1 Android Development] stellarman:
Updates for CM5?

Are there any changes needed so that this 2.01 will work with the new Cyanogen CM 5.0.7? It looks like this still looks for /system/sd instead of /sd-ext to find the apps and data?
[G1 Android Development] rikupw:
This is actually obsolete in cyanogenmod eclair now as cyanogen I believe made permissions fixing part of the framework, I'm not even sure if the script is included in cm5 at all. But yes, it would need to be updated for a check of /sd-ext.
[G1 Android Development] kzin:
Mentioned in Wiki...

Using HTC Dream, CyanogenMOD 5.0.7-DS

fix_permissions is included and located @ /system/bin/fix_permissions

wiki.cyanogenmod.com/index.php/Upgrading_From_CM_4.2_or_other_rooted_ROMS_to_5.0.x(Dream/Sapphire) suggests that fix_permissions should be run if you do not do a wipe.

(Sorry cant yet post actual links...)
[G1 Android Development] Firerat:
the fix_permissions script in CM5 is still a little 'broken', being hard coded to /system/sd

you can fix this with a sed

su
busybox mount -o rw,remount /system
sed s~/system/sd~\$SD_EXT_DIRECTORY~ /system/bin/fix_permissions -i

I have started to pre-patch this in the AnySPL ports I have done.

but you can also use my 'all in one' script
[G1 Android Development] stellarman:
Thanks Firerat. I actually already used your "all in one" script to fix this on my machine.

Do you know if this script, from this thread, is the version of 'fix-permissions' that Cyanogen is now using? I know for a while this script had features and fixes that were beyond what Cyanogen originally came out with. But he may have adopted those additions, or adopted the entire script by now. Do you know?
[G1 Android Development] Firerat:
Currently v2.03 in cm5.0.7 to cm5.0.8test1
[G1 Android Development] stellarman:
Excellent! Thank you.
[G1 Android Development] VD171:
This topic, really help me to solve my problems.

Thank you very much
[Touch Pro, Fuze General] saleemarshad:
Hello,

I have a VODAFONE BRANDED, HTC TOUCH PRO phone and it has started playing up suddenly.

It would charge when connected to a pc, car charger using a usb cable or using any mini usb charger. all of a sudden it has stopped charging with any other charger except its own htc wall plug charger.

I have tried a hard reset and still no joy.

the charge via usb is unchecked and it charges when connected to a PC.

However it doesnt charge with the following methods which used to work earlier

1. Motorola charger - mini usb

2. Using a usb cable and a wall output with usb

3. car charger with a usb output.

I have a htc audio out connecter. when i connect the connector, and then charge via usb it works in the car and from the wall.

is it something to do with the pins on the cables and on the device??

I used to get a menu asking the sort of connection that i needed (activesysnc, data etc) when connecting to the car charger earlier, it does not come anymore.

Its frustrating cos i travel a lot and find chrarging with usb cables the most convenint in the car, office or else where.

Could it be damaged pins on the device??

Any ideas/suggestions will be highly appreciated.

Many thanks

Sal
[Touch Pro, Fuze General] Bruce Inman:
Its prolly pins because the mini USB is not a perfect fit for the HTC audio jack. I would use your HTC adaptor and run the USB through that.
[Touch Pro, Fuze General] kpriess:
Something might be blocking a less than 1000mah income charge..
[Touch Pro, Fuze General] Haspels:
On low battery (as in dead-battery) you definately need a wall-plug charger. Under normal conditions the USB car charger or laptop would be fine.

Since you hinted the use of the audio jack I most likely is a bad connection on the USB pins. Did you take a look at them using a magnifying glass?
[Touch Pro, Fuze General] bufung:
Ur problem solved? I am facing kind of similar problem... Now my Touch HD can only charge using USB cable through computer.. it will not charge using any other external AC adapter.. very strange huh?
[Touch Pro, Fuze General] kingmully:
100 % fix

I managed to solder the black negative wire to the usb housing of a male usb mini and now it charges without any problem. The housing is used as a substitute for pin 5 that is negative because it has a metal shield as standard.

to make it easier for some noobs, just get a usb female to a usb mini cable and cut it off and solder the negtive black wire to the shield cable around all the wires. AS standard all usb cable have this shield metal that conects to the usb housing.

This is a FIX if you have managed to break the pin5 when inserting the stylus in the usb rather than the RESET button.
[Touch Pro, Fuze General] arwen:
I had a weird charging issue with my AT&T Fuze as well...

The phone would charge fine (wall or PC USB) until I got some kind of notification on the phone (missed call, e-mail, etc). Then it would stop charging. Often when it was on the charger and on, the battery would run down until the phone shut off. Then it would start charging again. I would put my phone on the charger at night (and on) only to come down in the morning to find my phone turned off and charging because the battery had run down!

Shortly after this started happening I also started to get "storage memory low" messages. Coincidentally, since I freed up a bit of the storage memory (cleared IE and Opera history) I have not had the charging problem...
[Touch Pro, Fuze General] hrothnir:
mini-usb problems with charging

This is the 2nd Fuze that has problems with the mini-usb connection and charging.

Slight forward pressure is needed to get a good connection. This happens with two different cables, two different car chargers, and three different HTC usb adapter dongles.

My phone is usually plugged into my computer or my car charger, unless I'm carrying it. I keep the screen lit when on external power as I use it extensively as a PDA. It's real obvious when I lose the power connection, as the screen blanks shortly thereafter.
[Touch Pro, Fuze General] Lukster:
Do i need to send my fuze back? since I havent read a solution. I dont think its software but i turned on charging through usb and now its the only way to charge. No chargers work? Grrrr. Batterys and chargers are good. This happened to my last fuze.
[Touch Pro, Fuze General] VashTheStampede:
not to be a prick or anytihng, but have you checked the battery settings, there is a checkbox so it doesnt charge when plugged in - i've knocked this on a few times myself
[Touch Pro, Fuze General] mputtr:
the OP already noted that that option was not checked. Please read a little before that.

My car charger sometimes need me to move the wires around abit before it starts charging. It seems to be more like a pin issue.
[Touch Pro, Fuze General] jamatru:
Mini USB Charging Problems

I had the same problem.

I just solve it by using other mini usb cable.

Now it charges.
[Touch Pro, Fuze General] RayStewart1:
HTC Touch Pro Charging via USB Problem Solved

I can't believe it was that easy! You are correct; There is a check-box that will disable charging via USB if the unit is powered on. "Systems/Battery" :) I have been putting up with this for months, but never took the time to try and solve it. Sheesh!
[Touch HD Themes and Apps] Ethania:
Hi.

Is there a languagepack for SBSH calendar.

Im a swedish user and would like to have a swedish version.

Installed it whit engelish and found a folder named:

"Translations" but there are nothing in there.

Also, there is a folder named: "IconStore"

Is there any wvga iconpacks to place there?