FORUMS

Analysis & Opinion

Top Forum Discussions

[GUIDE][Cm12]How to easily Port Xperia Lolipop Small Apps to Cm12

1,657 posts
Thanks Meter: 2,715
 
By gamzekal, Senior Member on 17th May 2015, 10:27 AM
Post Reply Subscribe to Thread Email Thread
RXS Moonbreakers presents proudly
HOW TO PORT XPERIA LOLIPOP SMALL APPS TO CM12

Hi
I made this guide that will help you to mod your ROM for support fully Small Apps from Xperia Z3 5.0.2 (Include taskswitcher plugin mod). Works only for CM12 and Maybe Cm12.1.

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

Small Apps Z3 5.0.2 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,
-Latest features of small apps ported from Xperia Z3 with Android 5.0.2 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
-Z3 Lolipop Systemui


Lets Start


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_BACK UP"/>"
and Paste those lines above this line
<permission android:name="com.sony.smallapp.permission.CONTROL _SMALLAPP" androidrotectionLevel="system|signature"/>
<permission android:description= @String/permdesc_smallapp" android:label= @String/permlab_smallapp" android:name="com.sony.smallapp.permission.SMALLAP P" androidrotectionLevel="dangerous"/>
<permission android:description= @String/permdesc_taskSwitcherPluginView" android:label= @String/permlab_taskSwitcherPluginView" android:name="com.sonymobile.permission.TASK_SWITC HER_PLUGIN_VIEW" androidrotectionLevel="signatureOrSystem"/>
<permission android:name="com.sonymobile.permission.ACCESS_BEA CON_MANAGER" androidrotectionLevel="system|signature" />


Like this marked in red lines:
<permission android:label= @String/permlab_serialPort" android:name="android.permission.SERIAL_PORT" androidrotectionLevel="system|signature" android:description= @String/permdesc_serialPort" />
<permission android:label= @String/permlab_accessContentProvidersExternally" android:name="android.permission.ACCESS_CONTENT_PR OVIDERS_EXTERNALLY" androidrotectionLevel="signature" android:description= @String/permdesc_accessContentProvidersExternally" />
<permission android:label= @String/permlab_updateLock" android:name="android.permission.UPDATE_LOCK" androidrotectionLevel="signatureOrSystem" android:description= @String/permdesc_updateLock" />
<permission android:name="com.sony.smallapp.permission.CONTROL _SMALLAPP" androidrotectionLevel="system|signature" />
<permission android:label= @String/permlab_smallapp" android:name="com.sony.smallapp.permission.SMALLAP P" androidrotectionLevel="dangerous" android:description= @String/permdesc_smallapp" />
<permission android:label= @String/permlab_taskSwitcherPluginView" android:name="com.sonymobile.permission.TASK_SWITC HER_PLUGIN_VIEW" androidrotectionLevel="signatureOrSystem" android:description= @String/permdesc_taskSwitcherPluginView" />
<permission android:name="com.sonymobile.permission.ACCESS_BEA CON_MANAGER" androidrotectionLevel="system|signature" />

<uses-permission android:name="android.permission.CONFIRM_FULL_BACK UP" />
<application android:label= @String/android_system_label" android:icon="@drawable/ic_launcher_android" android:allowClearUserData="false" android:hasCode="false" androidersistent="true" androidrocess="system" android:backupAgent="com.android.server.SystemBack upAgent" android:killAfterRestore="false" android:supportsRtl="true">
<activity android:theme="@style/Theme.Holo.Dialog.Alert" android:name="com.android.internal.app.ChooserActi vity" 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.HeavyWeight SwitcherActivity" androidrocess=":ui" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" />




Then, go to res/values/strings.xml and add these lines at the end:
PHP 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\PhoneWindow Manager.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 ]

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

    
.line 1882
    
const/16 v30x18

    aput v3
p2v2

    
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.


Credits
@lukakas
@Kevin-0100
@sandy7
@STRYDER~007
Last edited by gamzekal; 17th May 2015 at 07:30 PM.
The Following 11 Users Say Thank You to gamzekal For This Useful Post: [ View ]
 
 
17th May 2015, 10:34 AM |#2  
afah_me's Avatar
Senior Member
Here
Thanks Meter: 310
 
More
Quote:
Originally Posted by gamzekal

RXS Moonbreakers presents proudly]

Oh man... very awesome
i want to try it but i'm not finished yet port xperia framework to cm12.1
17th May 2015, 10:48 AM |#3  
gamzekal's Avatar
OP Senior Member
Flag Fizan
Thanks Meter: 2,715
 
Donate to Me
More
Quote:
Originally Posted by afah_me

Oh man... very awesome
i want to try it but i'm not finished yet port xperia framework to cm12.1

Thanks
You can try it on cm12 and report to me
17th May 2015, 10:58 AM |#4  
Pandemic's Avatar
Senior Member
Flag MePpEl
Thanks Meter: 15,675
 
Donate to Me
More
Nice tut bro @gamzekal
Another great one from the team ^^
17th May 2015, 11:50 AM |#5  
gamzekal's Avatar
OP Senior Member
Flag Fizan
Thanks Meter: 2,715
 
Donate to Me
More
Quote:
Originally Posted by Pandemic

Nice tut bro @gamzekal
Another great one from the team ^^

thanks bro
17th May 2015, 12:15 PM |#6  
STRYDER~007's Avatar
Recognized Themer
Flag Pune
Thanks Meter: 2,755
 
Donate to Me
More
Very good tutorial! Nicely explained! Keep it up bro..
17th May 2015, 12:25 PM |#7  
Pandemic's Avatar
Senior Member
Flag MePpEl
Thanks Meter: 15,675
 
Donate to Me
More
Quote:
Originally Posted by gamzekal

thanks bro

Anytime bro
17th May 2015, 03:35 PM |#8  
sandy7's Avatar
Recognized Contributor / Recognized Developer
Flag bangalore
Thanks Meter: 6,924
 
Donate to Me
More
good work @gamzekal
18th May 2015, 05:49 AM |#9  
CressKH's Avatar
Senior Member
Thanks Meter: 56
 
More
Good work!
I'll try to mod this for my XZR cm12.1 when I got time.
Will come back with report.
26th May 2015, 01:41 AM |#10  
Junior Member
Flag Medellin
Thanks Meter: 1
 
More
Excellent contribution !!!
I wanted to send you the Logcat you ordered, but you have surpassed private messages
26th May 2015, 09:15 PM |#11  
gamzekal's Avatar
OP Senior Member
Flag Fizan
Thanks Meter: 2,715
 
Donate to Me
More
Quote:
Originally Posted by anormal08

I wanted to send you the Logcat you ordered, but you have surpassed private messages

i have cleaned my messeage storage.You can now send it to me

Read More
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes