[GUIDE][Cm12][Cm12.1][8.3.16]How to easily Port Xperia Z5 Small Apps to CyanogenMod

Search This thread

gamzekal

Senior Member
Aug 6, 2012
2,297
3,523
Fizan
RXS Moonbreakers presents proudly
HOW TO PORT XPERIA Z5 SMALL APPS TO CM12 and CM12.1

XDA PORTAL
154yuc2.png
xd8qdl.png
2aif30m.png



Hi
I made this guide that will help you to mod your ROM for support fully Small Apps from Xperia Z3 5.0.2 [Cm12] and Xperia Z5 5.1.1[Cm12.1] (Include taskswitcher plugin mod)..

I know that it is to port very Hard and some users doenst port it easily therefore we will use original Z3 Systemui or Z5 Systemui(Hardest progress) for it. But dont worry!!! .

Small Apps Z3 5.0.2 and Z5 5.1.1 is latest version of Sony, it bring us features like:

-Small Apps support.
-Favorite list (Called taskswitcher plugin view) of small apps and "floatings" widgets on 'Recents Apps' (Taskswitcher).
-Widget floating window supported. (Like if converted homescreen widgets to small apps).
-Multiple windows by default from Z3 and Z5,
-Latest features of small apps ported from Xperia Z3 with Android 5.0.2 and 5.1.1 version.
-And much more to find.

Before flashing this Mod please make a BACKUP

Requiements
-own framework.jar
-own framework-res.apk
-own android.policy.jar
-own services.jar
-Z3 Systemui(cm12) or Z5 Systemui(cm12.1)


Lets Start

For Cm12

1.Framework-res.apk

Decompile framework-res.apk
And open AndroidManifest.xml(framework-res.apk/AndroidManifest.xml)
Find this line "<uses-permission android:name="android.permission.CONFIRM_FULL_BACKUP"/>"
and Paste those lines above this line
Look at screnshoot(if you didnt see anything go to Attachment)
2056udl.png


Like this marked in red lines:
<permission android:label= @String/permlab_serialPort" android:name="android.permission.SERIAL_PORT" android:protectionLevel="system|signature" android:description= @String/permdesc_serialPort" />
<permission android:label= @String/permlab_accessContentProvidersExternally" android:name="android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY" android:protectionLevel="signature" android:description= @String/permdesc_accessContentProvidersExternally" />
<permission android:label= @String/permlab_updateLock" android:name="android.permission.UPDATE_LOCK" android:protectionLevel="signatureOrSystem" android:description= @String/permdesc_updateLock" />
<permission android:name="com.sony.smallapp.permission.CONTROL_SMALLAPP" android:protectionLevel="system|signature" />
<permission android:label= @String/permlab_smallapp" android:name="com.sony.smallapp.permission.SMALLAPP" android:protectionLevel="dangerous" android:description= @String/permdesc_smallapp" />
<permission android:label= @String/permlab_taskSwitcherPluginView" android:name="com.sonymobile.permission.TASK_SWITCHER_PLUGIN_VIEW" android:protectionLevel="signatureOrSystem" android:description= @String/permdesc_taskSwitcherPluginView" />
<permission android:name="com.sonymobile.permission.ACCESS_BEACON_MANAGER" android:protectionLevel="system|signature" />

<uses-permission android:name="android.permission.CONFIRM_FULL_BACKUP" />
<application android:label= @String/android_system_label" android:icon="@drawable/ic_launcher_android" android:allowClearUserData="false" android:hasCode="false" android:persistent="true" android:process="system" android:backupAgent="com.android.server.SystemBackupAgent" android:killAfterRestore="false" android:supportsRtl="true">
<activity android:theme="@style/Theme.Holo.Dialog.Alert" android:name="com.android.internal.app.ChooserActivity" android:multiprocess="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true">
<intent-filter>
<action android:name="android.intent.action.CHOOSER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:theme="@style/Theme.Holo.Dialog" android:label= @String/heavy_weight_switcher_title" android:name="com.android.internal.app.HeavyWeightSwitcherActivity" android:process=":ui" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" />




Then, go to res/values/strings.xml and add these lines at the end:
Code:
 <string name="permlab_smallapp">Show small apps</string>
    <string name="permdesc_smallapp">Allow the application to display small apps on top of other applications.</string>
    <string name="permlab_taskSwitcherPluginView">Provide plugin-view to the task-switcher</string>
    <string name="permdesc_taskSwitcherPluginView">Allows the application to provide a plugin-view to the task-switcher.</string>
Save your modifications and recompile it.

2.android.policy.jar
Decompile android.policy.jar
And open smali\com\android\internal\policy\impl\PhoneWindowManager.smali

Find for this words " android.permission.SYSTEM_ALERT_WINDOW":


Like this marked in red:
[I mean after goto:goto_1 add small app lines (in red marked) in your android policy.Line number musst be different from your other line numbers.EX:1793 belongs only to small app ]

Code:
 .line 1881
    :sswitch_2
    const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"

    .line 1882
    const/16 v3, 0x18

    aput v3, p2, v2

    goto :goto_1

  [B][COLOR="Red"]  .line 1793
    :sswitch_3
    const-string v0, "com.sony.smallapp.permission.SMALLAPP"

  [B][COLOR="Red"]  .line 1794[/COLOR][/B]
    goto :goto_1[/COLOR][/B]

    [B][COLOR="Red"].line 1862
    nop[/COLOR][/B]

    :sswitch_data_0
    .sparse-switch
        0x7d2 -> :sswitch_2
        0x7d3 -> :sswitch_2
        0x7d5 -> :sswitch_1
        0x7d6 -> :sswitch_2
        0x7d7 -> :sswitch_2
        0x7da -> :sswitch_2
        0x7db -> :sswitch_0
        0x7dd -> :sswitch_0
        0x7e7 -> :sswitch_0
        0x7ee -> :sswitch_0
        0x7ef -> :sswitch_0
       [B][COLOR="Red"] 0xbb5 -> :sswitch_3[/COLOR][/B]
       [B][COLOR="Red"] 0xbb6 -> :sswitch_3[/COLOR][/B]
    .end sparse-switch
.end method

Save your modifications and recompile it.

3.framework.jar
Decompile framework.jar
Open folder smali2/com/
Download this zip and extract it in there
Recompile it

4.Systemui
Please go to this page and download Systemui flashable.zip or Skip this step and go to 5.step
[You can add Smallapp resources and your frameowork files in this zip and flash it or i have prepared a flashable zip in next step]

5.Flash Section
Download this other Smallapp resources(flashable zip) and add your framework files in framework folder(android.policy.jar,framework-res.apk,framework.jar)
and Flash it.

For Cm12.1


1.Framework-res.apk

Decompile Framework-res.apk

open \framework-res\AndroidManifest.xml

Find this line "<uses-permission android:name="android.permission.CONFIRM_FULL_BACKUP"/>"
and Paste those lines above this line
Look at screnshoot(if you didnt see anything go to Attachment)
2056udl.png



open \framework-res\res\values\strings.xml

and add these lines at the end before

</resources>

Code:
<string name="permlab_smallapp">Show small apps</string> 
    <string name="permdesc_smallapp">Allow the application to display small apps on top of other applications.</string> 
    <string name="permlab_taskSwitcherPluginView">Provide plugin-view to the task-switcher</string> 
    <string name="permdesc_taskSwitcherPluginView">Allows the application to provide a plugin-view to the task-switcher.</string>

Save your modifications and recompile it.

2.android.policy.jar

Decompile android.policy.jar

open \android.policy\com\android\internal\policy\impl\PhoneWindowManager.smali

find this "android.permission.SYSTEM_ALERT_WINDOW"

my PhoneWindowManager.smali

Code:
const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"

    const/16 v3, 0x18

    aput v3, p2, v2

    goto :goto_2a
	
    :sswitch_data_42
    .sparse-switch
        0x7d2 -> :sswitch_3b
        0x7d3 -> :sswitch_3b
        0x7d5 -> :sswitch_36
        0x7d6 -> :sswitch_3b
        0x7d7 -> :sswitch_3b
        0x7da -> :sswitch_3b
        0x7db -> :sswitch_2a
        0x7dd -> :sswitch_2a
        0x7e7 -> :sswitch_2a
        0x7ee -> :sswitch_2a
        0x7ef -> :sswitch_2a
        0x7f0 -> :sswitch_2a
    .end sparse-switch
.end method

Compare and Copy Red lines in your Smali

Code:
const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"

    const/16 v3, 0x18

    aput v3, p2, v2

    goto :goto_2a

[COLOR="red"]	:sswitch_2d
    const-string v0, "com.sony.smallapp.permission.SMALLAPP"
	
	goto :goto_2a[/COLOR]
  
 [COLOR="Red"]  .line 3300
    goto :goto_1

    .line 3301
    nop	[/COLOR]

    :sswitch_data_42
    .sparse-switch
        0x7d2 -> :sswitch_3b
        0x7d3 -> :sswitch_3b
        0x7d5 -> :sswitch_36
        0x7d6 -> :sswitch_3b
        0x7d7 -> :sswitch_3b
        0x7da -> :sswitch_3b
        0x7db -> :sswitch_2a
        0x7dd -> :sswitch_2a
        0x7e7 -> :sswitch_2a
        0x7ee -> :sswitch_2a
        0x7ef -> :sswitch_2a
        0x7f0 -> :sswitch_2a
[COLOR="Red"]		0xbb5 -> :sswitch_2d
        0xbb6 -> :sswitch_2d[/COLOR]
    .end sparse-switch
.end method

notice that the goto: after "com.sony.smallapp.permission.SMALLAPP" is the same goto as a the goto above :sswitch_2d

and that the :sswitch_2d was not in the origonal method if you already have a :sswitch_2d make it something else like :sswitch_3

Look at this line for sswitch_3

Code:
 const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"

    .line 2202
    const/16 v3, 0x18

    aput v3, p2, v2

    goto :goto_1

   [COLOR="Red"] .line 1793
    :sswitch_3
    const-string v0, "com.sony.smallapp.permission.SMALLAPP"[/COLOR]

[COLOR="Red"]    .line 1795
    goto :goto_1

    .line 1862
    nop[/COLOR]

    :sswitch_data_0
    .sparse-switch
        0x7d2 -> :sswitch_2
        0x7d3 -> :sswitch_2
        0x7d5 -> :sswitch_1
        0x7d6 -> :sswitch_2
        0x7d7 -> :sswitch_2
        0x7da -> :sswitch_2
        0x7db -> :sswitch_0
        0x7dd -> :sswitch_0
        0x7e7 -> :sswitch_0
        0x7ee -> :sswitch_0
        0x7ef -> :sswitch_0
        0x7f0 -> :sswitch_0
     [COLOR="Red"]   0xbb5 -> :sswitch_3
        0xbb6 -> :sswitch_3[/COLOR]
    .end sparse-switch
.end method

Save your modifications and recompile it.

3.framework.jar

Decompile your framework.jar
Download this
Open folder smali2(or smali_classes2)/com/ and extract it there(sony folder)
Recompile it

4.SuperUserMode

Go to this page and follow SuperUserMode instructions



5.Flash Section
Download this and add your edited framework files in >>>>framework folder in Zip
1)android.policy.jar,
2)services.jar(step 4),
3)framework-res.apk,
4)framework.jar)
and Flash it.



Credits
@lukakas
@Kevin-0100
@sandy7
@STRYDER~007
@slipsystem
 
Last edited:

STRYDER~007

Inactive Recognized Developer / Recognized Themer
May 13, 2013
2,740
9,247
Pune
Good work @gamzekal! I think Z5 SystemUI is compulsory to use for full support of Xperia Small Apps since some of it's method invocation code is implemented in Z5 SystemUI..:)
 

sandy7

Inactive Recognized Developer
May 28, 2012
6,214
6,843
34
bangalore
@gamzekal

Good work , and a nice guide.
i wrote a guide long regarding the same porting technique for porting small apps.

now u have an updated guide may be i can try porting for cynogen os 12.1 for the oneplus one.
 

theonepharaoh

Senior Member
Feb 19, 2014
200
291
why not use xposed framework and make a module that enables small apps for all devices & builds
instead of re modifying the system every day because of new builds.
isn't that what the xposed framework is about not having to modify the framework every time.

I hope to see a small apps xposed module soon
and thanks for your amazing work.
 
  • Like
Reactions: devilmaycry2020

gamzekal

Senior Member
Aug 6, 2012
2,297
3,523
Fizan
why not use xposed framework and make a module that enables small apps for all devices & builds
instead of re modifying the system every day because of new builds.
isn't that what the xposed framework is about not having to modify the framework every time.

I hope to see a small apps xposed module soon
and thanks for your amazing work.

:good:
 

Shivam Kumar Jha

Senior Member
Dec 28, 2013
358
3,186
Hyderabad
Hello thanks for the guide.
I'm getting this error while compiling framework.jar

classout\com\sony\smallapp\AbstractSmallApplication.smali[21,4] Error for input '.param': Invalid directive
classout\com\sony\smallapp\AbstractSmallApplication.smali[21,11] mismatched input 'p1' expecting END_METHOD_DIRE
CTIVE
classout\com\sony\smallapp\internal\util\DialogHelper.smali[19,4] Error for input '.param': Invalid directive
classout\com\sony\smallapp\internal\util\DialogHelper.smali[20,4] Error for input '.param': Invalid directive
classout\com\sony\smallapp\internal\util\DialogHelper.smali[19,11] mismatched input 'p0' expecting END_METHOD_DI
RECTIVE
classout\com\sony\smallapp\internal\util\WindowUtils.smali[46,4] Error for input '.param': Invalid directive
classout\com\sony\smallapp\internal\util\WindowUtils.smali[47,4] Error for input '.param': Invalid directive
classout\com\sony\smallapp\internal\util\WindowUtils.smali[83,4] Error for input '.param': Invalid directive
classout\com\sony\smallapp\internal\util\WindowUtils.smali[84,4] Error for input '.param': Invalid directive
classout\com\sony\smallapp\internal\util\WindowUtils.smali[46,11] mismatched input 'p0' expecting END_METHOD_DIR
ECTIVE
classout\com\sony\smallapp\internal\util\WindowUtils.smali[83,11] mismatched input 'p0' expecting END_METHOD_DIR
ECTIVE

Any help??
 

Attachments

  • framework.jar
    5.3 MB · Views: 10
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 9
    RXS Moonbreakers presents proudly
    HOW TO PORT XPERIA Z5 SMALL APPS TO CM12 and CM12.1

    XDA PORTAL
    154yuc2.png
    xd8qdl.png
    2aif30m.png



    Hi
    I made this guide that will help you to mod your ROM for support fully Small Apps from Xperia Z3 5.0.2 [Cm12] and Xperia Z5 5.1.1[Cm12.1] (Include taskswitcher plugin mod)..

    I know that it is to port very Hard and some users doenst port it easily therefore we will use original Z3 Systemui or Z5 Systemui(Hardest progress) for it. But dont worry!!! .

    Small Apps Z3 5.0.2 and Z5 5.1.1 is latest version of Sony, it bring us features like:

    -Small Apps support.
    -Favorite list (Called taskswitcher plugin view) of small apps and "floatings" widgets on 'Recents Apps' (Taskswitcher).
    -Widget floating window supported. (Like if converted homescreen widgets to small apps).
    -Multiple windows by default from Z3 and Z5,
    -Latest features of small apps ported from Xperia Z3 with Android 5.0.2 and 5.1.1 version.
    -And much more to find.

    Before flashing this Mod please make a BACKUP

    Requiements
    -own framework.jar
    -own framework-res.apk
    -own android.policy.jar
    -own services.jar
    -Z3 Systemui(cm12) or Z5 Systemui(cm12.1)


    Lets Start

    For Cm12

    1.Framework-res.apk

    Decompile framework-res.apk
    And open AndroidManifest.xml(framework-res.apk/AndroidManifest.xml)
    Find this line "<uses-permission android:name="android.permission.CONFIRM_FULL_BACKUP"/>"
    and Paste those lines above this line
    Look at screnshoot(if you didnt see anything go to Attachment)
    2056udl.png


    Like this marked in red lines:
    <permission android:label= @String/permlab_serialPort" android:name="android.permission.SERIAL_PORT" android:protectionLevel="system|signature" android:description= @String/permdesc_serialPort" />
    <permission android:label= @String/permlab_accessContentProvidersExternally" android:name="android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY" android:protectionLevel="signature" android:description= @String/permdesc_accessContentProvidersExternally" />
    <permission android:label= @String/permlab_updateLock" android:name="android.permission.UPDATE_LOCK" android:protectionLevel="signatureOrSystem" android:description= @String/permdesc_updateLock" />
    <permission android:name="com.sony.smallapp.permission.CONTROL_SMALLAPP" android:protectionLevel="system|signature" />
    <permission android:label= @String/permlab_smallapp" android:name="com.sony.smallapp.permission.SMALLAPP" android:protectionLevel="dangerous" android:description= @String/permdesc_smallapp" />
    <permission android:label= @String/permlab_taskSwitcherPluginView" android:name="com.sonymobile.permission.TASK_SWITCHER_PLUGIN_VIEW" android:protectionLevel="signatureOrSystem" android:description= @String/permdesc_taskSwitcherPluginView" />
    <permission android:name="com.sonymobile.permission.ACCESS_BEACON_MANAGER" android:protectionLevel="system|signature" />

    <uses-permission android:name="android.permission.CONFIRM_FULL_BACKUP" />
    <application android:label= @String/android_system_label" android:icon="@drawable/ic_launcher_android" android:allowClearUserData="false" android:hasCode="false" android:persistent="true" android:process="system" android:backupAgent="com.android.server.SystemBackupAgent" android:killAfterRestore="false" android:supportsRtl="true">
    <activity android:theme="@style/Theme.Holo.Dialog.Alert" android:name="com.android.internal.app.ChooserActivity" android:multiprocess="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true">
    <intent-filter>
    <action android:name="android.intent.action.CHOOSER" />
    <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
    </activity>
    <activity android:theme="@style/Theme.Holo.Dialog" android:label= @String/heavy_weight_switcher_title" android:name="com.android.internal.app.HeavyWeightSwitcherActivity" android:process=":ui" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" />




    Then, go to res/values/strings.xml and add these lines at the end:
    Code:
     <string name="permlab_smallapp">Show small apps</string>
        <string name="permdesc_smallapp">Allow the application to display small apps on top of other applications.</string>
        <string name="permlab_taskSwitcherPluginView">Provide plugin-view to the task-switcher</string>
        <string name="permdesc_taskSwitcherPluginView">Allows the application to provide a plugin-view to the task-switcher.</string>
    Save your modifications and recompile it.

    2.android.policy.jar
    Decompile android.policy.jar
    And open smali\com\android\internal\policy\impl\PhoneWindowManager.smali

    Find for this words " android.permission.SYSTEM_ALERT_WINDOW":


    Like this marked in red:
    [I mean after goto:goto_1 add small app lines (in red marked) in your android policy.Line number musst be different from your other line numbers.EX:1793 belongs only to small app ]

    Code:
     .line 1881
        :sswitch_2
        const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
    
        .line 1882
        const/16 v3, 0x18
    
        aput v3, p2, v2
    
        goto :goto_1
    
      [B][COLOR="Red"]  .line 1793
        :sswitch_3
        const-string v0, "com.sony.smallapp.permission.SMALLAPP"
    
      [B][COLOR="Red"]  .line 1794[/COLOR][/B]
        goto :goto_1[/COLOR][/B]
    
        [B][COLOR="Red"].line 1862
        nop[/COLOR][/B]
    
        :sswitch_data_0
        .sparse-switch
            0x7d2 -> :sswitch_2
            0x7d3 -> :sswitch_2
            0x7d5 -> :sswitch_1
            0x7d6 -> :sswitch_2
            0x7d7 -> :sswitch_2
            0x7da -> :sswitch_2
            0x7db -> :sswitch_0
            0x7dd -> :sswitch_0
            0x7e7 -> :sswitch_0
            0x7ee -> :sswitch_0
            0x7ef -> :sswitch_0
           [B][COLOR="Red"] 0xbb5 -> :sswitch_3[/COLOR][/B]
           [B][COLOR="Red"] 0xbb6 -> :sswitch_3[/COLOR][/B]
        .end sparse-switch
    .end method

    Save your modifications and recompile it.

    3.framework.jar
    Decompile framework.jar
    Open folder smali2/com/
    Download this zip and extract it in there
    Recompile it

    4.Systemui
    Please go to this page and download Systemui flashable.zip or Skip this step and go to 5.step
    [You can add Smallapp resources and your frameowork files in this zip and flash it or i have prepared a flashable zip in next step]

    5.Flash Section
    Download this other Smallapp resources(flashable zip) and add your framework files in framework folder(android.policy.jar,framework-res.apk,framework.jar)
    and Flash it.

    For Cm12.1


    1.Framework-res.apk

    Decompile Framework-res.apk

    open \framework-res\AndroidManifest.xml

    Find this line "<uses-permission android:name="android.permission.CONFIRM_FULL_BACKUP"/>"
    and Paste those lines above this line
    Look at screnshoot(if you didnt see anything go to Attachment)
    2056udl.png



    open \framework-res\res\values\strings.xml

    and add these lines at the end before

    </resources>

    Code:
    <string name="permlab_smallapp">Show small apps</string> 
        <string name="permdesc_smallapp">Allow the application to display small apps on top of other applications.</string> 
        <string name="permlab_taskSwitcherPluginView">Provide plugin-view to the task-switcher</string> 
        <string name="permdesc_taskSwitcherPluginView">Allows the application to provide a plugin-view to the task-switcher.</string>

    Save your modifications and recompile it.

    2.android.policy.jar

    Decompile android.policy.jar

    open \android.policy\com\android\internal\policy\impl\PhoneWindowManager.smali

    find this "android.permission.SYSTEM_ALERT_WINDOW"

    my PhoneWindowManager.smali

    Code:
    const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
    
        const/16 v3, 0x18
    
        aput v3, p2, v2
    
        goto :goto_2a
    	
        :sswitch_data_42
        .sparse-switch
            0x7d2 -> :sswitch_3b
            0x7d3 -> :sswitch_3b
            0x7d5 -> :sswitch_36
            0x7d6 -> :sswitch_3b
            0x7d7 -> :sswitch_3b
            0x7da -> :sswitch_3b
            0x7db -> :sswitch_2a
            0x7dd -> :sswitch_2a
            0x7e7 -> :sswitch_2a
            0x7ee -> :sswitch_2a
            0x7ef -> :sswitch_2a
            0x7f0 -> :sswitch_2a
        .end sparse-switch
    .end method

    Compare and Copy Red lines in your Smali

    Code:
    const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
    
        const/16 v3, 0x18
    
        aput v3, p2, v2
    
        goto :goto_2a
    
    [COLOR="red"]	:sswitch_2d
        const-string v0, "com.sony.smallapp.permission.SMALLAPP"
    	
    	goto :goto_2a[/COLOR]
      
     [COLOR="Red"]  .line 3300
        goto :goto_1
    
        .line 3301
        nop	[/COLOR]
    
        :sswitch_data_42
        .sparse-switch
            0x7d2 -> :sswitch_3b
            0x7d3 -> :sswitch_3b
            0x7d5 -> :sswitch_36
            0x7d6 -> :sswitch_3b
            0x7d7 -> :sswitch_3b
            0x7da -> :sswitch_3b
            0x7db -> :sswitch_2a
            0x7dd -> :sswitch_2a
            0x7e7 -> :sswitch_2a
            0x7ee -> :sswitch_2a
            0x7ef -> :sswitch_2a
            0x7f0 -> :sswitch_2a
    [COLOR="Red"]		0xbb5 -> :sswitch_2d
            0xbb6 -> :sswitch_2d[/COLOR]
        .end sparse-switch
    .end method

    notice that the goto: after "com.sony.smallapp.permission.SMALLAPP" is the same goto as a the goto above :sswitch_2d

    and that the :sswitch_2d was not in the origonal method if you already have a :sswitch_2d make it something else like :sswitch_3

    Look at this line for sswitch_3

    Code:
     const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
    
        .line 2202
        const/16 v3, 0x18
    
        aput v3, p2, v2
    
        goto :goto_1
    
       [COLOR="Red"] .line 1793
        :sswitch_3
        const-string v0, "com.sony.smallapp.permission.SMALLAPP"[/COLOR]
    
    [COLOR="Red"]    .line 1795
        goto :goto_1
    
        .line 1862
        nop[/COLOR]
    
        :sswitch_data_0
        .sparse-switch
            0x7d2 -> :sswitch_2
            0x7d3 -> :sswitch_2
            0x7d5 -> :sswitch_1
            0x7d6 -> :sswitch_2
            0x7d7 -> :sswitch_2
            0x7da -> :sswitch_2
            0x7db -> :sswitch_0
            0x7dd -> :sswitch_0
            0x7e7 -> :sswitch_0
            0x7ee -> :sswitch_0
            0x7ef -> :sswitch_0
            0x7f0 -> :sswitch_0
         [COLOR="Red"]   0xbb5 -> :sswitch_3
            0xbb6 -> :sswitch_3[/COLOR]
        .end sparse-switch
    .end method

    Save your modifications and recompile it.

    3.framework.jar

    Decompile your framework.jar
    Download this
    Open folder smali2(or smali_classes2)/com/ and extract it there(sony folder)
    Recompile it

    4.SuperUserMode

    Go to this page and follow SuperUserMode instructions



    5.Flash Section
    Download this and add your edited framework files in >>>>framework folder in Zip
    1)android.policy.jar,
    2)services.jar(step 4),
    3)framework-res.apk,
    4)framework.jar)
    and Flash it.



    Credits
    @lukakas
    @Kevin-0100
    @sandy7
    @STRYDER~007
    @slipsystem
    1
    @gamzekal

    Good work , and a nice guide.
    i wrote a guide long regarding the same porting technique for porting small apps.

    now u have an updated guide may be i can try porting for cynogen os 12.1 for the oneplus one.

    Great idea:good:
    Thanks for your guide too.:good:
    1
    why not use xposed framework and make a module that enables small apps for all devices & builds
    instead of re modifying the system every day because of new builds.
    isn't that what the xposed framework is about not having to modify the framework every time.

    I hope to see a small apps xposed module soon
    and thanks for your amazing work.