[Q] Fix Permissions on Froyo - Fascinate Android Development

I noticed after updating to froyo that Rom Managers "Fix Permissions" was way too fast and was processing only a couple of items. Didn't seem right.
So I ran its fix_permissions from adb shell and noticed that it was not finding a "packages.xml" in /data/system.
Did a search and found it in /dbdata/system. Copied it over and ran it again and viola - got the typical processing 100+ items list.
Here is the script I used as a fix:
su
cp /dbdata/system/packages.xml /data/system/packages.xml
/data/data/com.koushikdutta.rommanager/files/fix_permissions
Since I am a relative noob - I wanted to do confirm that others are seeing this and also verify if my method makes sense and is valid.
TIA.

I noticed the same behavior.
But honestly, fixing permissions is unncessary unless you are getting "Force Close" problems when running applications w/o fixing permissions.

But a good find none the less....
Sent from my SCH-I500 using XDA App

Good find, this would be a good fix for ROM devs.

Related

[solved] Handcent install fails

I keep getting the "not sufficient space" error when i try to install Handcent SMS from the market. I do have 30MB free tho ... any ideas why?
What rom you on?
Have you tried to install other apps since you got this error message?
ROM: Villain 5.2
installing / uninstalling other apps causes no problems
nevermind. removed everything via adb shell.
the last update attempt seems to have caused some troubles.
thanks for the quick reply anyway!!
just FYI: as I noticed in logcat trace output:
It seems that the underlying problem for this widely noticed problem simply were wrong filesystem permissions on the "lib" directory within the data directory of applications.
This prevented the installer from deleting/updating the *.so file(s). And it seems that the installer is so dumb to show a "not enough space" error every time it cannot write to the filesystem (even if it cannot write because of missing permissions).
The problem affected only applications which include native shared libraries (*.so files) which are placed in this "lib" directory (like "Handcent SMS", "Better Terminal Emulator Pro", "aTilt 3D Labyrinth", ..)
interesting ... i'm gonna check that the next i have similar issues
Seems my problem started after install of Terminal Emulator. Now Handcent fails to install and I have no idea how to fix it, removing via adb shell is not in my vocabulary. Can someone clue me in on this as I am use to Hancent and like the way it operates.
Thanks!
Thought I'd post in this thread save starting a new one. I am having the same problems. I can install other apps but not handcent, the error is same as above not enough space.
Can someone please post instruction on how to fix this via adb ? (for a layman)
I have looked at the other posts concerning this and looked in the /data dir' and searched via astro for any related "handcent" entries but cannot find any and I still have the problem. Please help.
Many Thanks
androcheck said:
just FYI: as I noticed in logcat trace output:
It seems that the underlying problem for this widely noticed problem simply were wrong filesystem permissions on the "lib" directory within the data directory of applications.
This prevented the installer from deleting/updating the *.so file(s). And it seems that the installer is so dumb to show a "not enough space" error every time it cannot write to the filesystem (even if it cannot write because of missing permissions).
The problem affected only applications which include native shared libraries (*.so files) which are placed in this "lib" directory (like "Handcent SMS", "Better Terminal Emulator Pro", "aTilt 3D Labyrinth", ..)
Click to expand...
Click to collapse
Can you/someone give advice on how to perform this fix because I'm having this problem and this seems to be the only fix. It's not working but I don't think I'm doing it right.

[Q] Installing Swype

Hey all,
I would just like to say I am new to this whole thing, and HAVE searched the forums, and found this link to be most helpful:
http://forum.xda-developers.com/showpost.php?p=12029729&postcount=12
I am merely trying to install the new swype beta, I am currently trying to uninstall my current version of swype, now I have done the majority of the steps the only thing I am having trouble doing is giving the phone read/write access
as when I try: mkdir /mnt/sdcard/swype_backup I get an error because it's a read-only file system.
I am using ADB; the first line of the post I linked to says to enable R/W access if you're using Root Explorer... but I am not, so how can I accomplish this through adb?
Am I missing something glaringly obvious?
Thanks for your time and patience
Edit: I believe adb is working to the extent it should... after I type in adb shell I do infact get a '#' before each line.
It's all fixed, re-did gladroot and now everything worked perfectly, not sure exactly why it wasn't before
thanks anyways!

Why won't V6 lowmemory settings stick with CM7DX2?

I'm wanting to see what the V6 Scripts will do for CM7 but I cannot for the life of me get them to stick upon reboot.
I have them setup via Script Manger to run as root. I've gone in, did option 6 (0,4,10,12,14,15) and option 20.
Upon reboot, the settings in /sys/module/lowmemorykiller/parameters/adj are set back to the default CM7 settings
I've tried setting the properties in both local.prop and build.prop, but nothing seems to stick.
I've tried integrating the settings of the init.rc into the ROM and not doing that.
None of these options seems to make the low memory killer settings I set in V6 stick and it ALWAYS reverts back to the stock CM7 settings.
I know I can just rerun the script after it's done booting, but I never had to do this with other ROMs as it would integrate fine in /etc/init.d and run.
I see in the /etc/init.d a S99SuperCharger script with the correct permissions set. I can run it via sh and it sets the properties correctly.
It just seems that CM7 is overwriting the low memory settings somewhere and I don't know where. I don't see it occurring in any of the supplied scripts from CM7 in the /etc/init.d and I don't see it in the build.prop file.
Any ideas? I know I could just tell Script Manager to run the script on boot, but that's usually not recommended except as a last resort.
I guess the real reason I would like to get this working the way it normally does (via the init.d scripts) is just to understand what CM7 is really doing.
Thanks!
Perhaps CM7 has some sort of memory management of it's own that sets things back to the defaults on boot????????
I know, not much of an answer but it's the best I can come up with.
robocuff said:
Perhaps CM7 has some sort of memory management of it's own that sets things back to the defaults on boot????????
I know, not much of an answer but it's the best I can come up with.
Click to expand...
Click to collapse
That's what I figured is happening. I just have to determine where it's happening at.
I see that the V6 scripts are running, but something is setting it AFTER the init.d process is done.
I also checked the /data/SuperChargerRan log file and this is what I saw:
02-16-2012 09:20:53: Applied Settings from /system/etc/init.d/S99SuperCharger!
02-16-2012 09:20:54: DIDN'T Apply Settings from /data/99SuperCharger.sh!
Not sure why the second one isn't working.
Looking at the /sys/module/lowmemorykiller/parameters/adj file, it's back to the original settings that CM7 has: 0,1,2,4,7,15
iBolski said:
I'm wanting to see what the V6 Scripts will do for CM7 but I cannot for the life of me get them to stick upon reboot.
I have them setup via Script Manger to run as root. I've gone in, did option 6 (0,4,10,12,14,15) and option 20.
Upon reboot, the settings in /sys/module/lowmemorykiller/parameters/adj are set back to the default CM7 settings
I've tried setting the properties in both local.prop and build.prop, but nothing seems to stick.
I've tried integrating the settings of the init.rc into the ROM and not doing that.
None of these options seems to make the low memory killer settings I set in V6 stick and it ALWAYS reverts back to the stock CM7 settings.
I know I can just rerun the script after it's done booting, but I never had to do this with other ROMs as it would integrate fine in /etc/init.d and run.
I see in the /etc/init.d a S99SuperCharger script with the correct permissions set. I can run it via sh and it sets the properties correctly.
It just seems that CM7 is overwriting the low memory settings somewhere and I don't know where. I don't see it occurring in any of the supplied scripts from CM7 in the /etc/init.d and I don't see it in the build.prop file.
Any ideas? I know I could just tell Script Manager to run the script on boot, but that's usually not recommended except as a last resort.
I guess the real reason I would like to get this working the way it normally does (via the init.d scripts) is just to understand what CM7 is really doing.
Thanks!
Click to expand...
Click to collapse
Hehehehe... Me thinks you should search the forums a little bit. When I was testing cm7 for DZK, I tried EVERYTHING I used on previous ROMs, to include V6_SuperCharger. V6_SuperCharger DOES NOT WORK with CM7! The BIGGEST reason is the mapping for the memory slots are different with CM7, so fudging with them tends to cause massive issues and slowdowns. The reason it does not stick is most likely (speculation here) due to CM7 settings things back to it's optimized default settings.
Keep in mind that CM7 is an "optimized" AOSP based ROM... That means NO BLOATWARE! I am running with roughly 315 apps, most of which I use on a WEEKLY basis. Some, only monthly.
There are a few issues that I have noticed, root/su issues, sometimes system crashes on boot, sometime bluetooth crashes on boot, sometimes the dialer crashes... But with non-root apps, this thing SCREAMS!
Also, CM7 incorporates it's own memory management system that works better than the Moto Blur based ROMs. Just my two cents.
Ciao!
Moonshadow, thanks for the explanation. I did do a search and for some reason, your post didn't come up. Now that I search, I find it. I'll attribute it to an ID-10T or PEBKAC error.
iBolski said:
I'll attribute it to an ID-10T or PEBKAC error.
Click to expand...
Click to collapse
Are you REALLY sure about that??? It could be that Google just hiccuped during that nanosecond that your search on XDA was running... And didn't affect anyone elses searches...
You can be like Apple and blame/sue everyone else... (Just joking!)
Ciao!
Besides cm 7 does not need any script runs good as it is.

[Q] Fix Permissions

I would like to think I am very familiar with GNU/Linux/UN*X permissions, but I don't have the foggiest idea as to what "fix permissions" does in Android recoveries and apps.
Is anyone willing to give an accurate overview of what's happening? If so, please do. Finally, can anyone point me towards some opensource code that implements such a task? That would be most appreciated.
Thanks in advance.
exiquio said:
I would like to think I am very familiar with GNU/Linux/UN*X permissions, but I don't have the foggiest idea as to what "fix permissions" does in Android recoveries and apps.
Is anyone willing to give an accurate overview of what's happening? If so, please do. Finally, can anyone point me towards some opensource code that implements such a task? That would be most appreciated.
Thanks in advance.
Click to expand...
Click to collapse
In order not to have applications to affect others, Android creates a new user/group to store data for each app and the permission information is keep in packages.xml. fix_permissions is to ensure permission integrity.
ROM Manager bundles fix_permissions shell script (I am sure others too):
/data/data/com.koushikdutta.rommanager/files/fix_permissions
Tingtan already explained the process of fix permissions and suggested ROM Manager as the shell commander but you can also fix permissions in CWM recovery by going to advanced/fix permissions/yes
Sent from my PC36100 using XDA App
hmmm, not realy clear for newbie like me, can you explain what problem will happen if fix permision ( in CMW ) is needed but i don't do it ?
When I flashed a rom, I always fix permissions at the end, then reboot.. That's how I learned to flash. :thumbup:
You can also fix permissions in rom toolbox under the "manage apps. " Its on bottom, just slide bottom bar to left and you will see it.
Codename FC18
taitrandht said:
hmmm, not realy clear for newbie like me, can you explain what problem will happen if fix permision ( in CMW ) is needed but i don't do it ?
Click to expand...
Click to collapse
http://wiki.cyanogenmod.com/wiki/Fix_permissions
Just found that. Sounds like what tingtan was saying.
Thanks I did not know that I could fix my permissions in Rom Tool Box.
Hello.
I suspect that fixing permissions implementation differs between tools. I suspect some of them doing worse to the system by performing this.
I'd appreciate a suggestion of tool doing this best (ie. no bad impact on system performance)
I just ran this from ROM Manager and thought... oh what have I done now...
I didn't really need to do it or anything. At least it didn't appear to have created issues
But, is it more or less secure now?
problem starting all aps after fix permission
just trying fix permission after flash rom and now my andriod cann't execute launcher and android system.
Nav bar and notification bar still show up, so the only thing i can use is setting menu.
Clear data on apps cann't do either due to, in active button (keep computing size all time)
Any idea how to fix this?
darkfader said:
I just ran this from ROM Manager and thought... oh what have I done now...
I didn't really need to do it or anything. At least it didn't appear to have created issues
But, is it more or less secure now?
Click to expand...
Click to collapse
More secure - tingtan answered that a couple of posts up now hit his thanks button
I am using Phil Touch recovery and for some reason I don't have the option "fix permissions" in the advanced section. Any theories for why?
mafra staue
H0LT3R said:
I am using Phil Touch recovery and for some reason I don't have the option "fix permissions" in the advanced section. Any theories for why?
Click to expand...
Click to collapse
its been removed with 5.10.0 version i think
wyklocnik said:
its been removed with 5.10.0 version i think
Click to expand...
Click to collapse
Guess it's a background process.
Stock Recovery Permission Fix?
How do you 'fix permissions' if you have only stock recovery?
I thought I needed to do this with my Titanium backup file.
I read that you must move the file into the system directory (off of SD Card or EXT SD Card) to do this, however this can be a problem and an inconvenience for such a large file, is there another recommended way of doing this if your Rooted but pure stock?
(Ideally this would alleviate the need to move the file, or at least would take care of the manual process if it's not possible to rectify in place.)
Fix permission?
Guys i have a note 3 sm n9005 and i am running cm12.1 ever since it came out. Well the rom is pretty good and stable but its missing some features on my device like the( on screen nav bar, ambient display , themer for cm themes) and im kinda frustrated cuz they are some nice features to be missing. Anyhow i tried liquidsmooth 4.1 and i did get the nav bar and the other settings, but now im back to cm cuz ls 4.1 has some bugs and again im without these features on cm12.1. Will this fix permissions thing solve the problem?? And if any one knows the fix for it please share it with me. Thanks.
I would like to invite you guys to test my new app Parasol which can solve the permission problem in Android M~
http://forum.xda-developers.com/android/apps-games/app-parasol-alpha-t3190615
Hi there,
Parasol is a new app to solve the permission problem in Android M. Here is the link: http://forum.xda-developers.com/android/apps-games/app-parasol-alpha-t3190615
Just try it and give me some expert feedback. Thanks a lot~
shell script to fix permissions
This is my first shell script but it fixed the permissions on an app that started crashing after I upgraded to android M
it takes the /data/data/XXX folder name as its only parameter
This script only repairs the owner:group of the data files
Please send comments - this script can be used by anyone in any way
Code:
#!/bin/sh
if [ "$1" != "" ]; then
#The folders in /data/data each have a different owner. The next line gets the owner and the strips the whitespace
appusername=$(stat -c "%U" /data/data/$1 | xargs)
#The next line constructs the chown command to repair the permissions for all the files in the target folder
fixperm="chown -R $appusername:$appusername /data/data/$1/*"
#Display the command to the user
echo "$fixperm"
#Uncomment the next line if you would like the script to fix the permission
#eval $fixperm
else
echo "Missing target folder parameter"
fi

How to fix the "invalid download uri" problem

Hi
"Invalid download uri" is a bad ass error that is the biggest flaw (IMHO) You can encounter. Solutions are (as far as I can tell):
- cache clear
- factory reset
But for those, who did this and still have the same problem (or don't wanna try the factory reset) there might be some hope. (I was searching for solutions and found none like this, so I hope I don't duplicate someone's ideas)
I was fighting with this for a longer time and I guess I finally managed to fix it. I tried to clear cache, Google Store and Services, I even removed and reinstalled Google Play. But as logcat said, there was still problem with access to the file that was downloaded (something about JaveException:FileAccessInvalid - or something similar).
So, to make the long story short:
- connect phone
- adb shell
- cd /data/data/com.android.providers.downloads
- ls -al
There should be 4 directories:
- one of them (install) is a link (not visible in CM File Manager, but visible in shell)
- app_sslcache, cache, databases
Those three should have similar attributes (drwxrwx--x), in my case, cache had ony drwx--x--x.
So an easy fix: chmod 771 cache (You should be root) and voila, everything works (You don't need reboot or to stop google play or anything) and no more "invalid download uri".
Please, if You have this problem try this fix and if it works for You, let others know (maybe even in the comment section below)...
PS: It's not dangerous, but anyway... You do this at Your own risk.
It WORKED!
What a life saver, I was able to change the permissions through FX Root Explorer.
Thank YOU.
Thanks!!!
Old thread but throwing a thank you out there. Was having this issue after rooting my VZW M8 and this solved the problem. Thanks! I also shared this link over on AndroidForums.com as I found a similar thread with no solution while googling this issue.
So thanks!
Thank you, for the inspiration, by looking at the logs, it was some permission pbl in com.android.vending and after some try, it was com.android.vending itself that was with bad permission.
771 on com.android.vending fix it for me!
Hi, was reading your suggestion how to fix problem"invalid dowload url' problem, followed your guide but no luck.
You wrote:
There should be 4 directories:
- one of them (install) is a link (not visible in CM File Manager, but visible in shell)
- app_sslcache, cache, databases
I have galaxy S5, rooted, using root explorer(everything visible) and within data/data/androidproviders.downloads I have only 3 files.
cache,databeses and lib.
but in another directory data/data/com.android.vending I do have files you mentioned and some more.
All of my files as well directories have same set of permissions, which is
rwxrwx-x
I know you mentioned we should have drwxrwx--x and I don't know how to change it(if my permissions are wrong).
IF you can help pls I would appreciate.
sweetmango said:
Hi, was reading your suggestion how to fix problem"invalid dowload url' problem, followed your guide but no luck.
You wrote:
There should be 4 directories:
- one of them (install) is a link (not visible in CM File Manager, but visible in shell)
- app_sslcache, cache, databases
I have galaxy S5, rooted, using root explorer(everything visible) and within data/data/androidproviders.downloads I have only 3 files.
cache,databeses and lib.
but in another directory data/data/com.android.vending I do have files you mentioned and some more.
All of my files as well directories have same set of permissions, which is
rwxrwx-x
I know you mentioned we should have drwxrwx--x and I don't know how to change it(if my permissions are wrong).
IF you can help pls I would appreciate.
Click to expand...
Click to collapse
Must be the "new" Android version... I don't have enough info to help You. the pesmissions are correct. That "d" in the beginning says it's a directory. After that there are rwx (means: Read, Write, eXecute) three times. These permissions are for Owner, Group and Others. That means the owner (the app that created this directory/file) should have full rights:rwx. He can read, write and execute the file/directory. Group is just a group of owners that can share some data. Like, You can put pictures into a directory and have all apps in group "viewers" access them. And then Others. Others are all other apps that are there. So basically drwxrwxrwx means anyone can do anything with that file/directory. drwx------ means only the owner has full access, all others cannot do anything. That's the permission system in linux/android in a really really fast lesson.
Now what You need to do is to find where S5 puts the things it downloads from App Store. Maybe You are missing that folder I have found. Dunno. Try to google it out and maybe someone can help You better. Or try to find it Yourself.
What I would do is to connect S5 with a cable to a PC, run adb shell logcat and then I would try to install something from the App Store. You will see all that crap that's going on and if there will be an error, You can see it, read it, think about it and solve it
Ot put it here and I will think for You
"invalid dowload url' problem
Thank you very much for super fast response. BTW, besides this post about 'invalid dowload url' problem there is nothing on the net, not one single word. I resolved my issue with reseting my phone and everything is fine now(it was easy since I have back up of everything). Will re search more and let you know if find any answers. Anyway, was looking at permissions in same folder after reseting my phone and everything is same as before but works. Thank you again, for your effort.
ntn_labs said:
Must be the "new" Android version... I don't have enough info to help You. the pesmissions are correct. That "d" in the beginning says it's a directory. After that there are rwx (means: Read, Write, eXecute) three times. These permissions are for Owner, Group and Others. That means the owner (the app that created this directory/file) should have full rights:rwx. He can read, write and execute the file/directory. Group is just a group of owners that can share some data. Like, You can put pictures into a directory and have all apps in group "viewers" access them. And then Others. Others are all other apps that are there. So basically drwxrwxrwx means anyone can do anything with that file/directory. drwx------ means only the owner has full access, all others cannot do anything. That's the permission system in linux/android in a really really fast lesson.
Now what You need to do is to find where S5 puts the things it downloads from App Store. Maybe You are missing that folder I have found. Dunno. Try to google it out and maybe someone can help You better. Or try to find it Yourself.
What I would do is to connect S5 with a cable to a PC, run adb shell logcat and then I would try to install something from the App Store. You will see all that crap that's going on and if there will be an error, You can see it, read it, think about it and solve it
Ot put it here and I will think for You
Click to expand...
Click to collapse
Try without an SD card in your device.
I don't have install in either place (com.android.provides.downloads or com.android.vending) on my PadFone X and keep running into this issue
EDIT: In my case it won't download the whole app.
EDIT: Downgrading Play Store fixed it!
Thanks, it worked
I didn't try changing permissions but just cleared the Download Manager data and it did work
Did this with Root Explorer, just want to mention, permission 771 should be granted not only for cache folder, but to every sub-folder.
Anyway thanx, this is really working solution.
Just a quick note: Noticed this error after installing the Xposed Module "Root Cloak". Since this error only showed up for root apps I figured that was the problem. Was able to update (TiBU and Greenify) by disabling Root Cloak - rebooting - updating - re-enabling Root Cloak.
Not sure what item I added to Root Cloak that is causing this issue, but for now this "solved" the problem for me.
Merman1983 said:
Just a quick note: Noticed this error after installing the Xposed Module "Root Cloak". Since this error only showed up for root apps I figured that was the problem. Was able to update (TiBU and Greenify) by disabling Root Cloak - rebooting - updating - re-enabling Root Cloak.
Not sure what item I added to Root Cloak that is causing this issue, but for now this "solved" the problem for me.
Click to expand...
Click to collapse
Dead or not I have ran into the exact same thing twice. First time was right after root cloak, and this time its been a while. That and a bad memory had me end up here. Root Cloak or not a simple fix permissions in something as old as ROM Manager or just do it in custom recovery fixed it for me. Android 4.3. Galaxy Note 10.1 2014 rooted stock with multi user. I note multi user because it has also caused me some grief due to knox magically appearing in the second user even though completely removed from ROM and also must enable multi user root in supersu. Thanks for making me chase permissions instead of go after the old sd card mount issues.
Fixing permissions worked for me thanks!
Solution to "Invalid download URI."
After some time of troubleshooting this issue, and performing all the previously recommended steps, we believe we found a really easy solution. In fact, I feel really frustrated that I didn't do this to begin with, but hey, live and learn.
This solution will typically work for folks who are getting this on almost every app, with a few exceptions. You may notice that some apps will install while others throw this "Invalid download URI." When an app is downloaded, the installer will then look to see where the app wants to install. Most of the time, these apps request to use the "SD Card" mount point. On most Android devices, even if you do not have a SD card installed, you will still have a SD Card mount point, which simply points to another location within the phones storage. It turns out that in this case, the S4 we were working on, had a SD card installed, but it was defective. So the installer would attempt to perform the installation step, but since the SD card wasn't responding appropriately, we would get this "Invalid download URI" error. After the card was removed, the Play store began functioning normally and apps would install without any issues.
Hopefully this helps everyone who had no success with the cache clearing and permission change solutions.
I wanna bump this to say thanks to the op and xda in general I been fighting with the aopen Opensign tablet10s that uses some hacked apon version of ics trying to get gapps working this thread was the final piece of the puzzle
THANK YOU

Categories

Resources