[FIX][ExtSD] ExtSD Fix (v2.9b - 2016-06-09)

Search This thread

rufus.wilson

Senior Member
Sep 10, 2015
185
319
Disclaimer: I am not responsible for anything bad that may occur from the use of this zip, but I will take all the credit you can give if it works for you.


dl

ExtSD Fix



In KitKat, Lollipop and Marshmallow, policies on writing permissions for external SD cards have been changed. This flashable recovery file automatically appends the correct permissions to the file as explained in many tutorials on the web (here or here) or as what many apps do (here).


Advantages
The advantage of this flashable zip over the other methods is that:
  • you don't need to install any apps,
  • you can revert by reflashing (not tested for marshmallow),
  • it does not require you to have root (needs to be confirmed),
    [*]you don't need a custom recovery (needs to be confirmed).


Installation
It can insert and remove the permission to write on the external sdcard. To install follow these steps:
  1. Turn off phone,
  2. Boot into recovery,
  3. Backup your system and data partition,
  4. Flash this zip file once,
  5. Reboot phone normally.
To revert the changes, follow the same steps again. This means that flashing it twice will have no effect.

Marshmallow is not supported yet, implementation is in progress.

Note: On Marshmallow, busybox will be installed if not already present. It can also be installed as a standalone app. You should an also add init.d support to your phone if not already available using an app.


How to report a bug
  • Check if someone else reported that it did/didn't work,
  • Backup, clean flash, reinstall all apps and then flash ExtSD Fix,
  • Submit a bug report here with both the original and modified packages.xml and the recovery log file as suggested here.



Changelog
  • v2.9b - 2016-06-09
    • Added double flashing revert for MM.
  • v2.8b - 2016-06-09
    • Added more logging to:
      • during flashing: /data/ExtSD_Fix_RW_inst.log
      • during boot: /data/ExtSD_Fix_RW_initd.log
  • v2.7b - 2016-06-08
    • Renamed script,
    • Changed permissions.
  • v2.6b - 2016-06-07
    • Changed permissions.
  • v2.5b - 2016-06-07
    • Changed permissions,
    • Added support for limited backup files.
  • v2.4b - 2016-06-05
    • Corrected bugs.
  • v2.3b - 2016-06-02
    • Included debug messages.
  • v2.2b - 2016-06-02
    • Corrected bugs. "ERROR:2" should be fixed.
  • V2.1b - 2016-05-19
    • Implemented solution from here and here.
  • V1.9b - 2016-05-04
    • Implemented solution from here. PLEASE TEST AND REPORT.
  • V1.8b - 2016-02-04
    • Corrected bug for Marshmallow.
  • V1.7b - 2016-02-02
    • Added support for Marshmallow.
  • V1.6b - 2016-01-27
    • Added revert on second run.
  • V1.5b - 2016-01-26
    • Corrected bug in check for API version.
  • V1.4b - 2016-01-26
    • Changed format of backed up filename.
    • Added check for API version ( 19<= API <= 22 ).
  • V1.3b - 2016-01-22
    • Backed up file is renamed with time and date.
  • V1.2b - 2016-01-21
    • Moved code into update-binary.
  • V1.1b - 2016-01-19
    • Removed testing commands.
  • V1.0b - 2016-01-18
    • Initial submission


XDA:DevDB Information
ExtSD Fix, Tool/Utility for all devices (see above for details)

Contributors
rufus.wilson

Version Information
Status: Testing
Current Beta Version: v2.9b
Beta Release Date: 2016-06-09

Created 2016-01-18
Last Updated 2016-06-15
 
Last edited:

rufus.wilson

Senior Member
Sep 10, 2015
185
319
Tested devices and systems

When you have tested it could you report your experience with the device model and the android version you used.

I will summarize here the success and failures.


Success
  • OnePlus X - CM 12.1
  • N4 w/TW 6.0.1 MM
  • sony z3c concept rom(mm)
  • Samsung Galaxy Express 2 with CM13
  • Xperia M with CM13
  • Sony Z3 .570 stock
  • asus zenfone 2
  • Asus ZenFone 4 - Stock v7.4.4 (Lollipop) (all opened apps had FC on reboot)
  • asus zenfone 5 XOSP rom
  • Sony Xperia Z3 (Sometimes is overwritten)
  • SM-G910F Rom ALEXNDR COJ3 Deodexed
  • Samsung galaxy s5 g900f stock marshmallow
  • z3c with rom slimm 1.5
  • Galaxy S7 SM-G930FD 6.0.1 Rooted Xposed
  • Xiaomi Redmi 1S RR 5.6.8 which is a CM13(R28)
  • Sony Z3 D6653 running on RXSW Marshmallow Edition [3.0.0] [12/04/16] [6.0.1]
  • LG L90 D415
  • Redmi 1s using OctOS M ROM
  • xt907 JBBL- cm13, 01-05-2016
  • Redmi 2, CM 13.1-20160417-SNAPSHOT
  • z3 570 rxsw
  • LG G3 VS985 variant running CM 13 6.0.1 nightlies. Using 777 Kernel & TWRP 3.0.2
  • z3 dual d6633 running marshmallow 6.0.1 official
  • Oppo find 7a x9006 on 6.0.1 rooted with twrp 3.0


Failure
  • LG D855 32 Gb with CM13 2016-05-10 and TWRP 3.0.0.0 recovery
  • Sony z3 MM
  • g900f blisspop 6.01
  • Samsung N7105T, unofficial wilson3q cm 13
 
Last edited:

phoberus

Senior Member
Oct 21, 2013
964
260
I have a proble with titanium backup: no space, but i have more than enough

Is this also working?
Galaxy s5, cm13 (MM)
 

rufus.wilson

Senior Member
Sep 10, 2015
185
319
I have a proble with titanium backup: no space, but i have more than enough

Is this also working?
Galaxy s5, cm13 (MM)

It should be working. You can always go back by copying back the file in a rooted shell command with the system partition mounted:
Code:
cd /system/etc/permissions
cp platform.xml-201*.bak platform.xml
chmod 0644 platform.xml
 
Last edited:

phoberus

Senior Member
Oct 21, 2013
964
260
It should be working. You can always go back by copying back the file in a rooted shell command with the system partition mounted:
Code:
cd /system/etc/permissions
cp platform.xml-201*.bak platform.xml
Hey @rufus.wilson
Flashed v1.3b, but it didn't work. And then I I restored the file with this two commands. After that, almost all the apps crash (FC) when I want to start it and when I can open an app, it hasn't any internet connection.
Can I fix this or must I wipe /system and /data?

(cache and dalvik cache already wiped)
I have noew zero permission, I can't even take a screenshot :/

Galaxy s5 (G900F) => CM13 (MM)
 
Last edited:

rufus.wilson

Senior Member
Sep 10, 2015
185
319
Hey @rufus.wilson
Flashed v1.3b, but it didn't work. And then I I restored the file with this two commands. After that, almost all the apps crash (FC) when I want to start it and when I can open an app, it hasn't any internet connection.
Can I fix this or must I wipe /system and /data?

(cache and dalvik cache already wiped)
I have noew zero permission, I can't even take a screenshot :/

Galaxy s5 (G900F) => CM13 (MM)

I edited my answer as I forgot to add a command to change the permissions of the file.
Code:
chmod 0644 /system/etc/permissions/platform.xml
 

Top Liked Posts

  • There are no posts matching your filters.
  • 171
    Disclaimer: I am not responsible for anything bad that may occur from the use of this zip, but I will take all the credit you can give if it works for you.


    dl

    ExtSD Fix



    In KitKat, Lollipop and Marshmallow, policies on writing permissions for external SD cards have been changed. This flashable recovery file automatically appends the correct permissions to the file as explained in many tutorials on the web (here or here) or as what many apps do (here).


    Advantages
    The advantage of this flashable zip over the other methods is that:
    • you don't need to install any apps,
    • you can revert by reflashing (not tested for marshmallow),
    • it does not require you to have root (needs to be confirmed),
      [*]you don't need a custom recovery (needs to be confirmed).


    Installation
    It can insert and remove the permission to write on the external sdcard. To install follow these steps:
    1. Turn off phone,
    2. Boot into recovery,
    3. Backup your system and data partition,
    4. Flash this zip file once,
    5. Reboot phone normally.
    To revert the changes, follow the same steps again. This means that flashing it twice will have no effect.

    Marshmallow is not supported yet, implementation is in progress.

    Note: On Marshmallow, busybox will be installed if not already present. It can also be installed as a standalone app. You should an also add init.d support to your phone if not already available using an app.


    How to report a bug
    • Check if someone else reported that it did/didn't work,
    • Backup, clean flash, reinstall all apps and then flash ExtSD Fix,
    • Submit a bug report here with both the original and modified packages.xml and the recovery log file as suggested here.



    Changelog
    • v2.9b - 2016-06-09
      • Added double flashing revert for MM.
    • v2.8b - 2016-06-09
      • Added more logging to:
        • during flashing: /data/ExtSD_Fix_RW_inst.log
        • during boot: /data/ExtSD_Fix_RW_initd.log
    • v2.7b - 2016-06-08
      • Renamed script,
      • Changed permissions.
    • v2.6b - 2016-06-07
      • Changed permissions.
    • v2.5b - 2016-06-07
      • Changed permissions,
      • Added support for limited backup files.
    • v2.4b - 2016-06-05
      • Corrected bugs.
    • v2.3b - 2016-06-02
      • Included debug messages.
    • v2.2b - 2016-06-02
      • Corrected bugs. "ERROR:2" should be fixed.
    • V2.1b - 2016-05-19
      • Implemented solution from here and here.
    • V1.9b - 2016-05-04
      • Implemented solution from here. PLEASE TEST AND REPORT.
    • V1.8b - 2016-02-04
      • Corrected bug for Marshmallow.
    • V1.7b - 2016-02-02
      • Added support for Marshmallow.
    • V1.6b - 2016-01-27
      • Added revert on second run.
    • V1.5b - 2016-01-26
      • Corrected bug in check for API version.
    • V1.4b - 2016-01-26
      • Changed format of backed up filename.
      • Added check for API version ( 19<= API <= 22 ).
    • V1.3b - 2016-01-22
      • Backed up file is renamed with time and date.
    • V1.2b - 2016-01-21
      • Moved code into update-binary.
    • V1.1b - 2016-01-19
      • Removed testing commands.
    • V1.0b - 2016-01-18
      • Initial submission


    XDA:DevDB Information
    ExtSD Fix, Tool/Utility for all devices (see above for details)

    Contributors
    rufus.wilson

    Version Information
    Status: Testing
    Current Beta Version: v2.9b
    Beta Release Date: 2016-06-09

    Created 2016-01-18
    Last Updated 2016-06-15
    26
    Tested devices and systems

    When you have tested it could you report your experience with the device model and the android version you used.

    I will summarize here the success and failures.


    Success
    • OnePlus X - CM 12.1
    • N4 w/TW 6.0.1 MM
    • sony z3c concept rom(mm)
    • Samsung Galaxy Express 2 with CM13
    • Xperia M with CM13
    • Sony Z3 .570 stock
    • asus zenfone 2
    • Asus ZenFone 4 - Stock v7.4.4 (Lollipop) (all opened apps had FC on reboot)
    • asus zenfone 5 XOSP rom
    • Sony Xperia Z3 (Sometimes is overwritten)
    • SM-G910F Rom ALEXNDR COJ3 Deodexed
    • Samsung galaxy s5 g900f stock marshmallow
    • z3c with rom slimm 1.5
    • Galaxy S7 SM-G930FD 6.0.1 Rooted Xposed
    • Xiaomi Redmi 1S RR 5.6.8 which is a CM13(R28)
    • Sony Z3 D6653 running on RXSW Marshmallow Edition [3.0.0] [12/04/16] [6.0.1]
    • LG L90 D415
    • Redmi 1s using OctOS M ROM
    • xt907 JBBL- cm13, 01-05-2016
    • Redmi 2, CM 13.1-20160417-SNAPSHOT
    • z3 570 rxsw
    • LG G3 VS985 variant running CM 13 6.0.1 nightlies. Using 777 Kernel & TWRP 3.0.2
    • z3 dual d6633 running marshmallow 6.0.1 official
    • Oppo find 7a x9006 on 6.0.1 rooted with twrp 3.0


    Failure
    • LG D855 32 Gb with CM13 2016-05-10 and TWRP 3.0.0.0 recovery
    • Sony z3 MM
    • g900f blisspop 6.01
    • Samsung N7105T, unofficial wilson3q cm 13
    13
    @rufus.wilson

    I think I made it (No need to install the script everytime you install a new app) by adding that file to the init.d folder.

    I extracted the code in the attached file from your code with too little changes.
    Here is how it works:

    Please backup your packages.xml first in case something went wrong.

    1- Install busybox and make sure it's installed to /system/xbin.
    2- add the attached file to the init.d folder using any file explorer
    3- add the correct permissions to the file (-rwxr-xr-x)

    don't forget to remove the .txt extension before adding it to the init.d folder.

    So, with each reboot, a new backup file of the packages.xml is being created, then the current one will have the correct permissions for every app.

    All credit goes to you in this, but please change your mod to be an init.d script file instead of a recovery file that need to be installed everytime a new app is being installed.

    Thanks so much.
    And this was only tested on Note 2 GT-N7100
    P.S: For everyone wants to try this. please note that Im not a developer and I didnt do that to replace the fix of @rufus.wilson. Im doing this only to help him testing his fix. So use it at your own risk.
    11
    If some one is interested, I've modified a zip that flash busybox and add to it the init.d script. So you can flash it after each ROM update.
    @rufus.wilson if you're not agree that I post it there, tell me and I'll remove it.
    11
    Hi Everybody,

    First of all, thank you all for your help to test and debug this thing. Travelling for work at the moment, I can't be as active as I would like. Thanks for your patience.

    I have released a new version v2.4b which should be working as a couple of bugs were found thanks to you. The incremental steps that should be checked in order:
    1. Non interrupted flash process
    2. Presence of 99_ExtSD_fix_v23.sh file in init.d folder (supported locations are /system/etc/init.d and /etc/init.d)
    3. 99_ExtSD_fix_v23.sh file ownership and permissions same as others scripts
    4. If busybox was not available before:
      1. Presence of /system/xbin/busybox
      2. /system/xbin/busybox ownership and permissions same as other tools
    5. Presence of /data/ExtSD_Fix_RW_initd.log
    6. Errors in /data/ExtSD_Fix_RW_initd.log

    Thanks again for your help,
    RW