[ROOT][All Amazon Fire Tablets] FOR REAL: Allow apps to write to external storage - Fire HD 8 and HD 10 Q&A, Help & Troubleshooting

I have been saving this for a while because it can be a headache when you forget about it. Also this seems to stop at least one headache now that most of have TWRP.
Basically Amazon removed a permission from the platform.xml that allows apps to write to and be moved to external storage (sdcard) PROPERLY.
There is a couple of cons to this (isn't there always lol). When you uninstall an app, the data will persist in the external storage which means you have to delete it manually. This can be a headache if you forget about this and need to reflash stock. So make sure to format your card before doing that.
The second con is you have to make sure all of the toggles for Amazon's external storage settings are turned off. So if you have Amazon apps still installed, they're going to get lost. Just delete them, their data folders and sideload them from adb from somewhere like APK Mirror (some are in the play store).
Instructions:
1. With a root explorer, navigate to /system/etc/permissions and open platform.xml in the native text editor, or copy the file to your sdcard then to PC and open it in Notepad++.
2. Look for the following permission: WRITE_EXTERNAL_STORAGE and add the following line to the with the others, above sdcard_r:
Code:
<group gid="media_rw" />
3. Look for the permission WRITE_MEDIA_STORAGE and add the following line under media_rw:
Code:
<group gid="sdcard_rw" />
4. Save the file and reboot to recovery and wipe the cache. Reboot the device. If you have flash fire working, wipe the dalvik and cache through the app.
5. Now you have the ability to use nearly all of your available storage, without anything screaming at you every few minutes. Thank me by hitting the thumbs up button a million times and get rid of that bottle of aspirin.

Related

[Q] "pm disable" - Where's it store the list?

I know of three ways to disable/freeze unwanted apps:
Using the command pm disable PACKAGE_OR_COMPONENT
Titanium Backup Pro
Disable the app through the built-in Application Manager (does not work for all apps)
Here's some details I could find about pm disable: http://www.kpbird.com/2013/05/android-shell-command-pm-package-manager.html
But my question to the community: When an app is disabled/frozen by any of these methods, what keeps track of these? Where is this data stored?
If nobody can answer my question above, then I have a different question: Are there any apps/commands that would allow you to view/log filesystem changes on-the-fly? (goal with this: start this "watcher" app, then disable an app using pm, and figure out what changed).
Thanks!
I found it! After quite some time grepping around, I found that the list of enabled/disabled apps is located here:
/data/system/users/0/package-restrictions.xml
Now, all I need to do is find a way to update this file in bash, without relying on any external programs. I plan to make a flashable zip to run a simple script that searches for each of the following three lines:
Code:
<pkg name="com.wssyncmldm" enabled="1" />
<pkg name="com.LocalFota" enabled="1" />
<pkg name="com.sec.android.fwupgrade" enabled="1" />
And updates each to a "2".
If any of the three lines are not found, the script should add them near the end of the file, on new lines immediately before this one:
Code:
<preferred-activities />
One more thing: it's possible that a person might have multiple user accounts on their phone (seems rare...), there could be other package-restrictions.xml files in other directories (maybe a /data/system/users/1/ or example). It would be ideal if the script could search for other user accounts and make the same modifications.
Any scripting-heroes willing to make this up for me??
BTW: the point/purpose of this is to disable the OTA updates from a flashable zip, in a custom recovery, without requiring a rooted system.
Aou said:
I found it! After quite some time grepping around, I found that the list of enabled/disabled apps is located here:
/data/system/users/0/package-restrictions.xml
Now, all I need to do is find a way to update this file in bash, without relying on any external programs. I plan to make a flashable zip to run a simple script that searches for each of the following three lines:
Code:
<pkg name="com.wssyncmldm" enabled="1" />
<pkg name="com.LocalFota" enabled="1" />
<pkg name="com.sec.android.fwupgrade" enabled="1" />
And updates each to a "2".
If any of the three lines are not found, the script should add them near the end of the file, on new lines immediately before this one:
Code:
<preferred-activities />
One more thing: it's possible that a person might have multiple user accounts on their phone (seems rare...), there could be other package-restrictions.xml files in other directories (maybe a /data/system/users/1/ or example). It would be ideal if the script could search for other user accounts and make the same modifications.
Any scripting-heroes willing to make this up for me??
BTW: the point/purpose of this is to disable the OTA updates from a flashable zip, in a custom recovery, without requiring a rooted system.
Click to expand...
Click to collapse
I could probably make a flashable zip that replaces package-restrictions.xml with a modified version that disables OTA
do you have that file?
the bash script looking for and replacing lines is not possible AFAIK via recovery.
jetlitheone said:
I could probably make a flashable zip that replaces package-restrictions.xml with a modified version that disables OTA
do you have that file?
the bash script looking for and replacing lines is not possible AFAIK via recovery.
Click to expand...
Click to collapse
Well, I've done this sort of thing in MS-DOS batch, using For loops (reading the file, line-by-line and processing it). I'll have to look into the bash equivalent.
Also, simply replacing the file is far too dangerous. If any entries in that file mismatch what's installed on the system, the device will not boot properly (TouchWiz launcher will not load, for one). Every time you enable/disable an app, the entire file shifts around and changes. It's a nightmare. But dealing with it line-by-line would be feasible...
Aou said:
Well, I've done this sort of thing in MS-DOS batch, using For loops (reading the file, line-by-line and processing it). I'll have to look into the bash equivalent.
Also, simply replacing the file is far too dangerous. If any entries in that file mismatch what's installed on the system, the device will not boot properly (TouchWiz launcher will not load, for one). Every time you enable/disable an app, the entire file shifts around and changes. It's a nightmare. But dealing with it line-by-line would be feasible...
Click to expand...
Click to collapse
Yeah I know what you mean I don't know it might be possible. Only thing I know of is applications that run bash scripts on boot up. But not of running one via a flashable zip in recovery
Sent from my SGH-I337 using Tapatalk 4 Beta
Based on some of the flashable zips out there, I think it's possible to use busybox to execute a bash script. I came up with a little bit of crappy psuedocode for what needs to happen:
Code:
set foundFlag = 0
if (file exists: /system/app/<app>.apk) do:
for (each line of package-restrictions.xml) do:
if ( line = <pkg name="com.wssyncmldm" enabled="1" /> ) do:
echo <pkg name="com.wssyncmldm" enabled="2" /> into newfile
set foundFlag = 1
else do:
echo line into newfile
end if
end for
if (foundFlag != 1) do:
for (each line of package-restrictions.xml) do:
if ( line = <preferred-activities /> ) do:
echo <pkg name="com.wssyncmldm" enabled="2" /> into newfile
echo <preferred-activities /> into newfile
else do:
echo line into newfile
end if
end for
end if
move newfile -> package-restrictions.xml
end if
The above would need to be repeated 3 times for the 3 apk's that need to be disabled.
.

Having trouble writing to external SD card/moving apps to external SD card.

I just had to delete all my app/system data backups on Titanium Backup Pro because I literally had no storage space left internally and could not find a way to move my backups to the external SD card. I have root and Titanium Backup Pro, but I can't choose my SD card as a destination to save TBP information to because it says "This folder is not writable". I tried FolderMount but haven't had any success with that either. Furthermore, I'm on T-Mobile and we haven't gotten the "App2SD" function yet, but even if that firmware comes I can't get it because my phone is rooted. OTA root keeper didn't allow me to temporarily unroot and install any Samsung updates either.
Anyone have any suggestions? I won't be getting a custom ROM either, since I don't want to lose any functionality with apps or anything.
Suchomimus said:
I just had to delete all my app/system data backups on Titanium Backup Pro because I literally had no storage space left internally and could not find a way to move my backups to the external SD card. I have root and Titanium Backup Pro, but I can't choose my SD card as a destination to save TBP information to because it says "This folder is not writable". I tried FolderMount but haven't had any success with that either. Furthermore, I'm on T-Mobile and we haven't gotten the "App2SD" function yet, but even if that firmware comes I can't get it because my phone is rooted. OTA root keeper didn't allow me to temporarily unroot and install any Samsung updates either.
Anyone have any suggestions? I won't be getting a custom ROM either, since I don't want to lose any functionality with apps or anything.
Click to expand...
Click to collapse
recently i have the same issue as well on my i9505 so i tried the solution at the following location and it works:
http://www.thriveforums.org/forum/t...rite-access-android-3-2-if-you-re-rooted.html
Titanium Backup with insuffiecient storage space - 1 problem, 3 solutions
To summarize, I have come across three solutions to this problem.
1.
Change the backup-location to /storage...
Open Titanium and go to Settings/Preferences/Backup folder location
Change to: /storage/emulated/legacy/TitaniumBackup
2.
If you had Titanium Backup installed on a previous ROM, doing a non-wipe install could stop the process of Titanium Backup. You might receive a pop-up notification that Titanium Backup has stopped working. Reinstalling the app might lead to an insufficient storage space error — when an app is uninstalled or modified, it leaves a .odex residue file which causes the error. So all you have to do is delete the .odex file of Titanium Backup.
Here’s how:
Using any file explorer like Root Explorer or ES File Explorer, go to /data/app , find and delete ”com.kermidas.TitaniumBackup-1.odex“. Now you can install Titanium Backup again!
If there is no such file in your folder, that´s OK. But please don´t delete any .apk file!
3.
I've found a simple solution for gaining write access to the external sdcard (/mnt/sdcard2) on Android 3.2. The sdcard is mounted r/w, but the owning group is media_rw which is linked to the WRITE_MEDIA_STORAGE permission. Unfortunately, this permission was not required for access to the external sdcard prior to 3.2 so most file management utilities do not request it when they run...meaning they only have read access to the card.
The simple solution, if you're rooted, is as follows:
1. Using a root-enabled file manager, navigate to /system/etc/permissions and make sure you have mounted the file system r/w.
2. Edit platform.xml and find the WRITE_EXTERNAL_STORAGE permission.
3. Add an additional group definition for this permission...<group gid="media_rw" />
4. Save the changes to the file.
5. Restart your tablet.
Original:
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_rw" />
</permission>
New:
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_rw" />
<group gid="media_rw" />
</permission>
Done.
After this change, any apps that request the WRITE_EXTERNAL_STORAGE permission (which includes almost anything that accesses either of the sdcards) will gain group membership in both sdcard_rw AND media_rw, giving them r/w access to both sdcard filesystems.
This may also fix other apps that have issues writing to the card.
---------------------------------------------------------------------------------
If you find this post useful, pls feel free to click on "Thanks".
Have a nice day

[Q] Permissions broken

Hi!
I have S4 I9505 with KitKat 4.4.2
I tried to fix writing to external storage for all apps as described here:
http://forum.xda-developers.com/showthread.php?t=2687734
I modified the file, restarted phone.. and now I have no internet, no wireless, no bluetooh, I cannot see my storage (neither internal or sd card), mz pc wont recognize the storages... I cannot make any backup, because I cannot write to any storage..
And, no, I haven"t done any backup of that file...
I tried to reedit but no succes...
Maybe someone can upload the original file?
Or do you have any suggestions?
eltigre4jc said:
Hi!
I have S4 I9505 with KitKat 4.4.2
I tried to fix writing to external storage for all apps as described here:
http://forum.xda-developers.com/showthread.php?t=2687734
I modified the file, restarted phone.. and now I have no internet, no wireless, no bluetooh, I cannot see my storage (neither internal or sd card), mz pc wont recognize the storages... I cannot make any backup, because I cannot write to any storage..
And, no, I haven"t done any backup of that file...
I tried to reedit but no succes...
Maybe someone can upload the original file?
Or do you have any suggestions?
Click to expand...
Click to collapse
you need to set permission to rw-/r--/-r--
make sure you only edit
<permission
name="android.permission.WRITE_EXTERNAL_STORAGE"
>
<group gid="sdcard_r" />
<group gid="sdcard_rw" />
<group gid="media_rw" />
add only <group gid="media_rw" /> as above and save
if you only done this edit to your platform.xml then proceed to set permission as below
1. open root explorer
2. goto system>etc>permisson and mount folder as R/W
3. long press on platform.xml click permission
4. check
owner read and write
group read
others read
and click ok and reboot your phone

[Q] KK4.4.4 External SDcard Fix. WTH?

In order to give permission to access my SDcard I followed the below instructions.
Using a root-enabled file manager navigate to, "/system/etc/permissions"
Edit "platform.xml" and find the "WRITE_EXTERNAL_STORAGE permission."
Add an additional group definition for this permission: <group gid=”media_rw” />
Save the changes to the file.
Restart the phone.
It worked. The problem I'm having now is my Bluetooth will not load. It starts dark green then goes gray.
To try and fix this I simply re-edited the platform.xml and deleted,
<group gid=”media_rw” /> and did a cold restart. Bluetooth still will not working. Any ideas as to
why this happened and how to fix without re-installing.

Will rooting allow writing to external SD card?

If I root my S4 - only root, no custom ROM -, will it allow me to write to the external SD card? Or is a custom ROM required for that?
Yes.
The steps:
1. Make sure that you have root access
2. Perform a NANDROID backup to be completely safe
3. Use a root-enabled file manager and navigate to /system/etc/permissions
4. Edit platform.xml and find “WRITE_EXTERNAL_STORAGE“
5. Add an additional group definition for this permission: <group gid=”media_rw” />
6. Save the changes and restart your device
You are now able to write on your external SD card again
Is step 5 put on a separate line? Until I root the phone, I can't see what you are saying to do. Maybe you can cut/paste the specific bit of code?
4. Edit platform.xml and find “WRITE_EXTERNAL_STORAGE“
5. Add an additional group definition for this permission: <group gid=”media_rw” />
Click to expand...
Click to collapse
You need to modify the file /platform.xml
Find the code "WRITE_EXTERNAL_STORAGE".
Then add an additional "Group Definition" for this permission ("write_external_storage"):
-->> <group gid="media_rew" />
.

Categories

Resources