[Guide] [App] [6.x.x & 7.x.x] Allow SDCard write access & switch SDCard Path

Search This thread

kishorerprem

Senior Member
Mar 3, 2012
62
102
Chittagong


Note:-
After modifying your framework files by following the below tutorial all system & user apps will have the permission to write external SD Card without asking to user. Please keep backup of your ROM before doing anything. I will not be responsible for any damage or boot loop.

Method 1 : Automatic patch

Auto Patcher app :
I have developed an android application to do all the patching work automatically. To download please click here- https://xdaforums.com/showpost.php?p=73854657&postcount=84


Method 2 : Manual patch


Requirements :-


a) framework.jar & services.jar of your ROM.
b) Apktool to decompile & recompile jar files.
c) Notepad++ to edite smali files.
d) 7zip to add modded .dex files into original .jar files.


Step 1:- Giving write permission to External SD card.
a) Decompile services.jar with APKTool. Go to com/android/server/pm/ directory.
b) Open PackageManagerService.smali with Notepad++ & find the below method.

Code:
.method private grantPermissionsLPw(Landroid/content/pm/PackageParser$Package;ZLjava/lang/String;)V
c) Go to end of this method & add below Red color marked lines of code accordingly in their corresponding place.

Code:
.method private grantPermissionsLPw(Landroid/content/pm/PackageParser$Package;ZLjava/lang/String;)V
    ...........
    ....
    
    const-wide/32 v24, 0x40000

    invoke-static/range {v24 .. v25}, Landroid/os/Trace;->traceEnd(J)V

   [COLOR=Red]move-object/from16 v2, p0

    move-object/from16 v3, p1

    invoke-direct {v2, v3}, Lcom/android/server/pm/PackageManagerService;->allowSDWrite(Landroid/content/pm/PackageParser$Package;)V[/COLOR]

    return-void

    :pswitch_data_4cc
    ....
    ...
.end method

[COLOR=Red].method private allowSDWrite(Landroid/content/pm/PackageParser$Package;)V
    .registers 8

    move-object/from16 v0, p1

    iget-object v0, v0, Landroid/content/pm/PackageParser$Package;->mExtras:Ljava/lang/Object;

    move-object/from16 v1, v0

    check-cast v1, Lcom/android/server/pm/PackageSetting;

    if-nez v1, :cond_b

    return-void

    :cond_b
    invoke-virtual {v1}, Lcom/android/server/pm/PackageSetting;->getPermissionsState()Lcom/android/server/pm/PermissionsState;

    move-result-object v1

    move-object/from16 v2, v1

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/server/pm/PackageManagerService;->mSettings:Lcom/android/server/pm/Settings;

    move-object/from16 v1, v0

    move-object/from16 v0, v1

    iget-object v0, v0, Lcom/android/server/pm/Settings;->mPermissions:Landroid/util/ArrayMap;

    move-object/from16 v1, v0

    move-object/from16 v0, v1

    const-string/jumbo v1, "android.permission.WRITE_MEDIA_STORAGE"

    invoke-virtual {v2, v1}, Lcom/android/server/pm/PermissionsState;->hasInstallPermission(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_29

    return-void

    :cond_29
    invoke-virtual {v0, v1}, Landroid/util/ArrayMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/android/server/pm/BasePermission;

    if-nez v4, :cond_32

    return-void

    :cond_32
    invoke-virtual {v2, v4}, Lcom/android/server/pm/PermissionsState;->grantInstallPermission(Lcom/android/server/pm/BasePermission;)I

    move-result v5

    return-void
.end method[/COLOR]

.method private grantRequestedRuntimePermissions(Landroid/content/pm/PackageParser$Package;[I[Ljava/lang/String;)V
    .......
    ....
    ....
    ..
.end method
d) Recompile services.jar. Open original services.jar & modded services.jar with 7zip in side-by-side window. Drag N Drop classes.dex file from modded services.jar to original services.jar window. Now keep the services.jar in a safe place.

Step 2:- Switch SD Path.
a) Decompile framework.jar with Apktool. Go to android/os/ directory.
b) Open Environment$UserEnvironment.smali with Notepad++ & find the below method.

Code:
.method public getExternalDirs()[Ljava/io/File;
c) Add Red color marked lines of code accordingly in their corresponding place.

Code:
.method public getExternalDirs()[Ljava/io/File;
    .registers 6

    iget v3, p0, Landroid/os/Environment$UserEnvironment;->mUserId:I

    const/16 v4, 0x100

    invoke-static {v3, v4}, Landroid/os/storage/StorageManager;->getVolumeList(II)[Landroid/os/storage/StorageVolume;

    move-result-object v2

    array-length v3, v2

    new-array v0, v3, [Ljava/io/File;

    const/4 v1, 0x0

    :goto_c
    array-length v3, v2

    if-ge v1, v3, :cond_1a

    aget-object v3, v2, v1

    invoke-virtual {v3}, Landroid/os/storage/StorageVolume;->getPathFile()Ljava/io/File;

    move-result-object v3

    aput-object v3, v0, v1

    add-int/lit8 v1, v1, 0x1

    goto :goto_c

    :cond_1a
  [COLOR=Red]  invoke-virtual {p0, v0}, Landroid/os/Environment$UserEnvironment;->getExternalSD([Ljava/io/File;)[Ljava/io/File;

    move-result-object v0[/COLOR]

    return-object v0
.end method

[COLOR=Red].method public getExternalSD([Ljava/io/File;)[Ljava/io/File;
    .registers 16

    move-object v0, p0

    move-object v1, p1

    new-instance v8, Ljava/util/ArrayList;

    move-object v13, v8

    move-object v8, v13

    move-object v9, v13

    invoke-direct {v9}, Ljava/util/ArrayList;-><init>()V

    move-object v3, v8

    :try_start_b
    new-instance v8, Ljava/io/BufferedReader;

    move-object v13, v8

    move-object v8, v13

    move-object v9, v13

    new-instance v10, Ljava/io/FileReader;

    move-object v13, v10

    move-object v10, v13

    move-object v11, v13

    const-string v12, "data/SDPath"

    invoke-direct {v11, v12}, Ljava/io/FileReader;-><init>(Ljava/lang/String;)V

    invoke-direct {v9, v10}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V

    move-object v4, v8

    :goto_1e
    move-object v8, v4

    invoke-virtual {v8}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
    :try_end_22
    .catch Ljava/lang/Exception; {:try_start_b .. :try_end_22} :catch_76

    move-result-object v8

    move-object v13, v8

    move-object v8, v13

    move-object v9, v13

    move-object v5, v9

    if-nez v8, :cond_58

    move-object v8, v3

    invoke-interface {v8}, Ljava/util/List;->isEmpty()Z

    move-result v8

    if-nez v8, :cond_81

    move-object v8, v3

    const-string v9, "ext_SD=1"

    invoke-interface {v8, v9}, Ljava/util/List;->contains(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_7e

    move-object v8, v1

    if-eqz v8, :cond_7b

    move-object v8, v1

    array-length v8, v8

    const/4 v9, 0x1

    if-le v8, v9, :cond_7b

    move-object v8, v1

    move-object v4, v8

    move-object v8, v4

    const/4 v9, 0x0

    aget-object v8, v8, v9

    move-object v5, v8

    move-object v8, v4

    const/4 v9, 0x0

    move-object v10, v4

    const/4 v11, 0x1

    aget-object v10, v10, v11

    aput-object v10, v8, v9

    move-object v8, v4

    const/4 v9, 0x1

    move-object v10, v5

    aput-object v10, v8, v9

    move-object v8, v4

    move-object v0, v8

    :goto_57
    return-object v0

    :cond_58
    move-object v8, v5

    :try_start_59
    invoke-virtual {v8}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v8

    move-object v6, v8

    move-object v8, v6

    invoke-virtual {v8}, Ljava/lang/String;->isEmpty()Z

    move-result v8

    if-nez v8, :cond_6e

    move-object v8, v6

    const-string v9, "#"

    invoke-virtual {v8, v9}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v8

    if-eqz v8, :cond_6f

    :cond_6e
    goto :goto_1e

    :cond_6f
    move-object v8, v3

    move-object v9, v6

    invoke-interface {v8, v9}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_74
    .catch Ljava/lang/Exception; {:try_start_59 .. :try_end_74} :catch_76

    move-result v8

    goto :goto_1e

    :catch_76
    move-exception v8

    move-object v4, v8

    move-object v8, v1

    move-object v0, v8

    goto :goto_57

    :cond_7b
    move-object v8, v1

    move-object v0, v8

    goto :goto_57

    :cond_7e
    move-object v8, v1

    move-object v0, v8

    goto :goto_57

    :cond_81
    move-object v8, v1

    move-object v0, v8

    goto :goto_57
.end method[/COLOR]

.method public getExternalStorageDirectory()Ljava/io/File;
    ......
    .....
.end method
d) Recompile framework.jar. Open original framework.jar & modded framework.jar with 7zip in side-by-side window. Drag N Drop classes.dex file from modded framework.jar to original framework.jar window. Now keep the framework.jar in a safe place.

Flashing modified files.
Create a flashable zip with moded framework.jar & services.jar. If you are using Redmi Note 4G. Then download attached zip file from attachment, open with 7zip, Add both jar file into "system/framework/". Then flash with custom recovery, wipe dalvik-cache & reboot. It will take up to 5 min.

Creating setting file.
a) Create a new file in "/data" directory. Rename it to "SDPath".
b) Then open the file "SDPath" with text editor. Then add the following line & save.
Code:
ext_SD=1
If you want to switch back the SD Path to default, just change the value from 1 to 0.

Enjoy.....


 

Attachments

  • Flashable.zip
    371.4 KB · Views: 2,357
Last edited:

rony raj

Senior Member
May 1, 2016
1,507
619
N0WH3R3 1N S9A)E
fix if stuck in bootloop guide
make copy of original framework.jar and services. jar
copy it in attachment zip in first post using 7z pc tool
and flash it with recovery
or flash rom don't wipe anything
hope both guide works for you
 

Tecalote

Senior Member
Aug 6, 2015
4,119
3,150
62
Leipzig
Honor Magic4 Pro
@kishorerprem Hello, thanks for your Thread! It's a great thing to enable Full external SD Card write access and optional changing the path... :)
I have one question: Do you think this can work also with other Devices on Android 7 (I have Huawei P9) - or only for Redmi Note?
 
  • Like
Reactions: kishorerprem

kishorerprem

Senior Member
Mar 3, 2012
62
102
Chittagong
@kishorerprem Hello, thanks for your Thread! It's a great thing to enable Full external SD Card write access and optional changing the path... :)
I have one question: Do you think this can work also with other Devices on Android 7 (I have Huawei P9) - or only for Redmi Note?

Yes, I think this guide will work in all Nougat (Android 7) ROM.
 

Tecalote

Senior Member
Aug 6, 2015
4,119
3,150
62
Leipzig
Honor Magic4 Pro
@kishorerprem

Hello :) I've managed to modify framework.jar and services.jar and I can confirm:
It works!
I have a Huawei P9 and the modification works wonderful!

But I just recompiled the opened and modified framework.jar and services.jar - and I used the recompiled ones - I did not make the step with drag and drop from modded to original.....
I just modified the originial, recompiled it and used this!
Thank you very much :)
 
Last edited:

kishorerprem

Senior Member
Mar 3, 2012
62
102
Chittagong
@kishorerprem

Hello :) I've managed to modify framework.jar and services.jar and I can confirm:
It works!
I have a Huawei P9 and the modification works wonderful!

But I just recompiled the opened and modified framework.jar and services.jar - and I used the recompiled ones - I did not make the step with drag and drop from modded to original.....
I just modified the originial, recompiled it and used this!
Thank you very much :)

The drag and drop step will add original META-INF folder into jar, nothing more. This is not a mandatory step. You can skip this anyway for system Apk/Jar. Because system Apk/Jar doesn't require signing.
 

vhick

Senior Member
Feb 13, 2012
628
123
Antipolo City
I don't have a problem decompile and recompile services.jar but I always get an error while recompiling framework.jar. Although decompiling framework.jar have no problem

Please help me
framework_jar_error.jpg
 

rocker00

Senior Member
Jun 23, 2012
513
511
@kishorerprem thank you soooooo much bro, that's really work of art !! i was missing xinternalsd xposed module but i can call myself lucky because i found this ! working flawlessly on my sony xperia z2 using resurrection remix 7.1.2, you should open a new thread here https://xdaforums.com/android/software because this awesome stuff is hidden here ! I'm really appreciate this awesome stuff :eek:.
 
Last edited:

kishorerprem

Senior Member
Mar 3, 2012
62
102
Chittagong
@kishorerprem thank you soooooo much bro, that's really work of art !! i was missing xinternalsd xposed module but i can call myself lucky because i found this ! working flawlessly on my sony xperia z2 using resurrection remix 7.1.2, you should open a new thread here https://xdaforums.com/android/software because this awesome stuff is hidden here ! I'm really appreciate this awesome stuff :eek:.

Welcome brother.. :)
 

VolterMort

Member
Apr 28, 2016
7
1
@kishorerprem, If I'm using Xiaomi Redmi Note 4G with latest developer ROM (Miui 8 7.6.8) I only need to download and flash the files you share it? Or do I have to do all the steps from the beginning?
Thanks!
 

kishorerprem

Senior Member
Mar 3, 2012
62
102
Chittagong
@kishorerprem, If I'm using Xiaomi Redmi Note 4G with latest developer ROM (Miui 8 7.6.8) I only need to download and flash the files you share it? Or do I have to do all the steps from the beginning?
Thanks!

Hi @VolterMort , AFAIK Miui 8 is based on Kitkat. But, this tutorial is only for Nougat users. You have to do it all by yourself. Then add the modified files into flashable zip I shared.
 
  • Like
Reactions: Fstop

Top Liked Posts

  • There are no posts matching your filters.
  • 22


    Note:-
    After modifying your framework files by following the below tutorial all system & user apps will have the permission to write external SD Card without asking to user. Please keep backup of your ROM before doing anything. I will not be responsible for any damage or boot loop.

    Method 1 : Automatic patch

    Auto Patcher app :
    I have developed an android application to do all the patching work automatically. To download please click here- https://xdaforums.com/showpost.php?p=73854657&postcount=84


    Method 2 : Manual patch


    Requirements :-


    a) framework.jar & services.jar of your ROM.
    b) Apktool to decompile & recompile jar files.
    c) Notepad++ to edite smali files.
    d) 7zip to add modded .dex files into original .jar files.


    Step 1:- Giving write permission to External SD card.
    a) Decompile services.jar with APKTool. Go to com/android/server/pm/ directory.
    b) Open PackageManagerService.smali with Notepad++ & find the below method.

    Code:
    .method private grantPermissionsLPw(Landroid/content/pm/PackageParser$Package;ZLjava/lang/String;)V
    c) Go to end of this method & add below Red color marked lines of code accordingly in their corresponding place.

    Code:
    .method private grantPermissionsLPw(Landroid/content/pm/PackageParser$Package;ZLjava/lang/String;)V
        ...........
        ....
        
        const-wide/32 v24, 0x40000
    
        invoke-static/range {v24 .. v25}, Landroid/os/Trace;->traceEnd(J)V
    
       [COLOR=Red]move-object/from16 v2, p0
    
        move-object/from16 v3, p1
    
        invoke-direct {v2, v3}, Lcom/android/server/pm/PackageManagerService;->allowSDWrite(Landroid/content/pm/PackageParser$Package;)V[/COLOR]
    
        return-void
    
        :pswitch_data_4cc
        ....
        ...
    .end method
    
    [COLOR=Red].method private allowSDWrite(Landroid/content/pm/PackageParser$Package;)V
        .registers 8
    
        move-object/from16 v0, p1
    
        iget-object v0, v0, Landroid/content/pm/PackageParser$Package;->mExtras:Ljava/lang/Object;
    
        move-object/from16 v1, v0
    
        check-cast v1, Lcom/android/server/pm/PackageSetting;
    
        if-nez v1, :cond_b
    
        return-void
    
        :cond_b
        invoke-virtual {v1}, Lcom/android/server/pm/PackageSetting;->getPermissionsState()Lcom/android/server/pm/PermissionsState;
    
        move-result-object v1
    
        move-object/from16 v2, v1
    
        move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/server/pm/PackageManagerService;->mSettings:Lcom/android/server/pm/Settings;
    
        move-object/from16 v1, v0
    
        move-object/from16 v0, v1
    
        iget-object v0, v0, Lcom/android/server/pm/Settings;->mPermissions:Landroid/util/ArrayMap;
    
        move-object/from16 v1, v0
    
        move-object/from16 v0, v1
    
        const-string/jumbo v1, "android.permission.WRITE_MEDIA_STORAGE"
    
        invoke-virtual {v2, v1}, Lcom/android/server/pm/PermissionsState;->hasInstallPermission(Ljava/lang/String;)Z
    
        move-result v3
    
        if-eqz v3, :cond_29
    
        return-void
    
        :cond_29
        invoke-virtual {v0, v1}, Landroid/util/ArrayMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
    
        move-result-object v4
    
        check-cast v4, Lcom/android/server/pm/BasePermission;
    
        if-nez v4, :cond_32
    
        return-void
    
        :cond_32
        invoke-virtual {v2, v4}, Lcom/android/server/pm/PermissionsState;->grantInstallPermission(Lcom/android/server/pm/BasePermission;)I
    
        move-result v5
    
        return-void
    .end method[/COLOR]
    
    .method private grantRequestedRuntimePermissions(Landroid/content/pm/PackageParser$Package;[I[Ljava/lang/String;)V
        .......
        ....
        ....
        ..
    .end method
    d) Recompile services.jar. Open original services.jar & modded services.jar with 7zip in side-by-side window. Drag N Drop classes.dex file from modded services.jar to original services.jar window. Now keep the services.jar in a safe place.

    Step 2:- Switch SD Path.
    a) Decompile framework.jar with Apktool. Go to android/os/ directory.
    b) Open Environment$UserEnvironment.smali with Notepad++ & find the below method.

    Code:
    .method public getExternalDirs()[Ljava/io/File;
    c) Add Red color marked lines of code accordingly in their corresponding place.

    Code:
    .method public getExternalDirs()[Ljava/io/File;
        .registers 6
    
        iget v3, p0, Landroid/os/Environment$UserEnvironment;->mUserId:I
    
        const/16 v4, 0x100
    
        invoke-static {v3, v4}, Landroid/os/storage/StorageManager;->getVolumeList(II)[Landroid/os/storage/StorageVolume;
    
        move-result-object v2
    
        array-length v3, v2
    
        new-array v0, v3, [Ljava/io/File;
    
        const/4 v1, 0x0
    
        :goto_c
        array-length v3, v2
    
        if-ge v1, v3, :cond_1a
    
        aget-object v3, v2, v1
    
        invoke-virtual {v3}, Landroid/os/storage/StorageVolume;->getPathFile()Ljava/io/File;
    
        move-result-object v3
    
        aput-object v3, v0, v1
    
        add-int/lit8 v1, v1, 0x1
    
        goto :goto_c
    
        :cond_1a
      [COLOR=Red]  invoke-virtual {p0, v0}, Landroid/os/Environment$UserEnvironment;->getExternalSD([Ljava/io/File;)[Ljava/io/File;
    
        move-result-object v0[/COLOR]
    
        return-object v0
    .end method
    
    [COLOR=Red].method public getExternalSD([Ljava/io/File;)[Ljava/io/File;
        .registers 16
    
        move-object v0, p0
    
        move-object v1, p1
    
        new-instance v8, Ljava/util/ArrayList;
    
        move-object v13, v8
    
        move-object v8, v13
    
        move-object v9, v13
    
        invoke-direct {v9}, Ljava/util/ArrayList;-><init>()V
    
        move-object v3, v8
    
        :try_start_b
        new-instance v8, Ljava/io/BufferedReader;
    
        move-object v13, v8
    
        move-object v8, v13
    
        move-object v9, v13
    
        new-instance v10, Ljava/io/FileReader;
    
        move-object v13, v10
    
        move-object v10, v13
    
        move-object v11, v13
    
        const-string v12, "data/SDPath"
    
        invoke-direct {v11, v12}, Ljava/io/FileReader;-><init>(Ljava/lang/String;)V
    
        invoke-direct {v9, v10}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
    
        move-object v4, v8
    
        :goto_1e
        move-object v8, v4
    
        invoke-virtual {v8}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
        :try_end_22
        .catch Ljava/lang/Exception; {:try_start_b .. :try_end_22} :catch_76
    
        move-result-object v8
    
        move-object v13, v8
    
        move-object v8, v13
    
        move-object v9, v13
    
        move-object v5, v9
    
        if-nez v8, :cond_58
    
        move-object v8, v3
    
        invoke-interface {v8}, Ljava/util/List;->isEmpty()Z
    
        move-result v8
    
        if-nez v8, :cond_81
    
        move-object v8, v3
    
        const-string v9, "ext_SD=1"
    
        invoke-interface {v8, v9}, Ljava/util/List;->contains(Ljava/lang/Object;)Z
    
        move-result v8
    
        if-eqz v8, :cond_7e
    
        move-object v8, v1
    
        if-eqz v8, :cond_7b
    
        move-object v8, v1
    
        array-length v8, v8
    
        const/4 v9, 0x1
    
        if-le v8, v9, :cond_7b
    
        move-object v8, v1
    
        move-object v4, v8
    
        move-object v8, v4
    
        const/4 v9, 0x0
    
        aget-object v8, v8, v9
    
        move-object v5, v8
    
        move-object v8, v4
    
        const/4 v9, 0x0
    
        move-object v10, v4
    
        const/4 v11, 0x1
    
        aget-object v10, v10, v11
    
        aput-object v10, v8, v9
    
        move-object v8, v4
    
        const/4 v9, 0x1
    
        move-object v10, v5
    
        aput-object v10, v8, v9
    
        move-object v8, v4
    
        move-object v0, v8
    
        :goto_57
        return-object v0
    
        :cond_58
        move-object v8, v5
    
        :try_start_59
        invoke-virtual {v8}, Ljava/lang/String;->trim()Ljava/lang/String;
    
        move-result-object v8
    
        move-object v6, v8
    
        move-object v8, v6
    
        invoke-virtual {v8}, Ljava/lang/String;->isEmpty()Z
    
        move-result v8
    
        if-nez v8, :cond_6e
    
        move-object v8, v6
    
        const-string v9, "#"
    
        invoke-virtual {v8, v9}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
    
        move-result v8
    
        if-eqz v8, :cond_6f
    
        :cond_6e
        goto :goto_1e
    
        :cond_6f
        move-object v8, v3
    
        move-object v9, v6
    
        invoke-interface {v8, v9}, Ljava/util/List;->add(Ljava/lang/Object;)Z
        :try_end_74
        .catch Ljava/lang/Exception; {:try_start_59 .. :try_end_74} :catch_76
    
        move-result v8
    
        goto :goto_1e
    
        :catch_76
        move-exception v8
    
        move-object v4, v8
    
        move-object v8, v1
    
        move-object v0, v8
    
        goto :goto_57
    
        :cond_7b
        move-object v8, v1
    
        move-object v0, v8
    
        goto :goto_57
    
        :cond_7e
        move-object v8, v1
    
        move-object v0, v8
    
        goto :goto_57
    
        :cond_81
        move-object v8, v1
    
        move-object v0, v8
    
        goto :goto_57
    .end method[/COLOR]
    
    .method public getExternalStorageDirectory()Ljava/io/File;
        ......
        .....
    .end method
    d) Recompile framework.jar. Open original framework.jar & modded framework.jar with 7zip in side-by-side window. Drag N Drop classes.dex file from modded framework.jar to original framework.jar window. Now keep the framework.jar in a safe place.

    Flashing modified files.
    Create a flashable zip with moded framework.jar & services.jar. If you are using Redmi Note 4G. Then download attached zip file from attachment, open with 7zip, Add both jar file into "system/framework/". Then flash with custom recovery, wipe dalvik-cache & reboot. It will take up to 5 min.

    Creating setting file.
    a) Create a new file in "/data" directory. Rename it to "SDPath".
    b) Then open the file "SDPath" with text editor. Then add the following line & save.
    Code:
    ext_SD=1
    If you want to switch back the SD Path to default, just change the value from 1 to 0.

    Enjoy.....


    16
    Hi guys,
    I have developed an android application to patch framework.jar & services.jar automatically. The application have attached in attachment.

    Instructions :-
    a) Download & install the AutoPatcher.apk from attachment.
    b) Copy /system/framwork/services.jar and /system/framework/framework.jar to External Storage.
    c) Open the application & select services.jar or framwork.jar to patch by clicking on "Select File" button.
    d) Select a patching option from patching options list.
    e) Click the "Patch" button to patch the jar file.
    f) Create flashable zip with patched file/files & flash the zip from recovery.

    Thanks..

    EDIT: Attachment updated (Installation issue fixed).
    EDIT: Attachment updated (Bug fixed).
    a) Fixed issue with Jar selection.​
    b) Fixed issues with patching framework.jar.​
    c) Fixed issue: Can't boot after flashing the patched files.​

    EDIT: Attachment updated (Removed unnecessary files from apk package)
    EDIT: Attachment updated (Improved patched Jar compression process)
    EDIT: Attachment updated (Code cleanup & small bug fixes)
    6
    I just tried this on Resurrection Remix 5.8.4 where the original services.jar was 6.93 MiB and the patched services.jar is 3.09 MiB.

    Why is the patched file size less than half of the original file size?

    Sent from my SM-N910F using XDA Labs

    From what I saw the original files although they are zipped does not contain any compression, while the patched has compression around 50%. I wonder if this can affect performance in some way
    Patched jar compression process has been improved in new build. Now, AutoPatcher will try to detect compression method of original jar, then patched jar will be repacked in same way. Download the latest build from here https://xdaforums.com/attachment.php?attachmentid=4283664&d=1506406860
    5
    Tested second version. Can't select any jar, app doesn't ask for any permission. LOS 14.1, Sony Z3compact.
    Problem fixed. Try the new build...Thanks
    https://xdaforums.com/attachment.php?attachmentid=4280003&d=1506094438
    5
    T
    TheNatureOne
    I updated my fork repository of tingle with the new Android 6.x patch mentioned by kishorerprem:
    https://github.com/Catfriend1/tingle

    [Update] It worked on the Android 6.x device as good as it did on the Android 7.x device. *thumbs up*