[GUIDE] How to port SONY Small Apps to Any Device Cm Based Roms

Search This thread

greedisgood99999

Senior Member
Apr 13, 2012
304
11
follow this guide,do exactly what he said,slowly and carefully,step by step and tell me :eek:

ive already tried that one..but as recompile it give me error on status_bar_recents_panel.xml that i dont have recents_clear..but I add on ID and it accepts it even ic_notify_clear is not present so I changed it to ic_notify_clear_normal..then recompiled it and push when the given flashable apps but sadly as I long pressed my home button to open recent apps it say "SystemUI Unfortunately Close blah blah blah" and at the same time no Small Apps launcher on my drawer. So i tried it again from the very start but this time I delete the line on status_bar_recents_panel for both layout and layout-land which contain the recents_clear and ic_notify_clear recompiled it and then flash still the same results..NO FC at first but after pressing home button SYSTEMUI FC and no small apps launcher on app drawer as well..:(
 

billy_cater

Member
Dec 17, 2012
29
14
HoChiMinh
ive already tried that one..but as recompile it give me error on status_bar_recents_panel.xml that i dont have recents_clear..but I add on ID and it accepts it even ic_notify_clear is not present so I changed it to ic_notify_clear_normal..then recompiled it and push when the given flashable apps but sadly as I long pressed my home button to open recent apps it say "SystemUI Unfortunately Close blah blah blah" and at the same time no Small Apps launcher on my drawer. So i tried it again from the very start but this time I delete the line on status_bar_recents_panel for both layout and layout-land which contain the recents_clear and ic_notify_clear recompiled it and then flash still the same results..NO FC at first but after pressing home button SYSTEMUI FC and no small apps launcher on app drawer as well..:(

check again your id hex in file smali,i give you my file so you can compare line by line,download here,good luck guy :D
 

thirdzcee

Senior Member
May 13, 2012
1,745
589
Bacolod City
Got it to work on touchwiz :D:D:thumbup::thumbup::thumbup:

uploadfromtaptalk1381505123222.jpg

Sent from my GT-I9070 using xda app-developers app
 

devilmaycry2020

Senior Member
Apr 27, 2013
1,399
248
Hi sandy7

Please make guide to port it to TX because your guide didn't work for stock 4.1.2 on TX. thanks and best regards
 

Nasheich Xfiles

Senior Member
Aug 13, 2012
2,022
2,362
Free York
www.nasheich-xfiles.blogspot.com
I can't find strings.xml in the first step. I am trying to port small apps to legacyxperia cm11.

decompile framework-res.apk using apktool, not just extract with winrar/7zip,

---------- Post added at 07:03 AM ---------- Previous post was at 07:01 AM ----------

Hello, what about small apps on CM 10.2 (Xperia ZR) ?

same way. just follow the instructions

please tell me my phone grand, it is not rooted phone, can i install these apps?

no, you can't, root only and knowledge about decompiling/recompiling apk
 

naheel azawy

Senior Member
Mar 10, 2012
627
962
27
doha/qatar
send me the logcat...ill check on it...and do let me know the changes u made....

here's changes I made:
Screenshot_2014-06-02-15-32-28.png

I've themed it to look like new one :good:
and I noticed that small clip is working too as you can see on above screen shot
for logcat, it's on the attachment.
and what does this means?
HTML:
I/ActivityManager(  630): Start proc com.sony.smallapp for service com.pranavpan
dey.smallapp.stopwatch/.StopWatch: pid=22395 uid=10125 gids={50125}
I/dalvikvm(22395): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory
how it says there's no classes!
 

naheel azawy

Senior Member
Mar 10, 2012
627
962
27
doha/qatar
send me the logcat...ill check on it...and do let me know the changes u made....

I found out something, the "com.sony.smallapp.jar" you've shared is a normal jar, it will not do anything. it hasn't classes inside cuz it's the classes itself !

anyway, I tried another "com.sony.smallapp.jar"s but still force closing with all other small apps.
I think that the problem is still with that jar. cuz as I told you the calculator is working good, I decompiled it to see what's inside and discovered that it doesn't need to "com.sony.smallapp.jar" cuz it has something similar inside it, on the calculator smali: "com/sony/smallapp" all files look like the files on "com.sony.smallapp.jar"

the new log on the attachment. I guess this is where the problem happening:
Code:
W/AudioTrack(  631): AUDIO_OUTPUT_FLAG_FAST denied by client due to mismatching
sample rate (48000 vs 44100)
D/AudioFlinger(  245): start(4097), calling pid 631 session 46
D/AudioFlinger(  245): ? => ACTIVE (4097) on thread 0x126f540
I/Process ( 5626): Sending signal. PID: 5626 SIG: 9
W/InputMethodManagerService(  631): Window already focused, ignoring focus gain
of: com.android.internal.view.IInputMethodClient$Stub$Proxy@425094a0 attribute=n
ull, token = android.os.BinderProxy@4281c908
[COLOR="Red"]I/ActivityManager(  631): Process com.sony.smallapp (pid 5626) has died.[/COLOR]


have any idea how to fix?
 
Last edited:

AeonWorld

Senior Member
Jun 11, 2009
1,107
2,345
Somewhere I Belong
I found out something, the "com.sony.smallapp.jar" you've shared is a normal jar, it will not do anything. it hasn't classes inside cuz it's the classes itself !

anyway, I tried another "com.sony.smallapp.jar"s but still force closing with all other small apps.
I think that the problem is still with that jar. cuz as I told you the calculator is working good, I decompiled it to see what's inside and discovered that it doesn't need to "com.sony.smallapp.jar" cuz it has something similar inside it, on the calculator smali: "com/sony/smallapp" all files look like the files on "com.sony.smallapp.jar"

the new log on the attachment. I guess this is where the problem happening:
Code:
W/AudioTrack(  631): AUDIO_OUTPUT_FLAG_FAST denied by client due to mismatching
sample rate (48000 vs 44100)
D/AudioFlinger(  245): start(4097), calling pid 631 session 46
D/AudioFlinger(  245): ? => ACTIVE (4097) on thread 0x126f540
I/Process ( 5626): Sending signal. PID: 5626 SIG: 9
W/InputMethodManagerService(  631): Window already focused, ignoring focus gain
of: com.android.internal.view.IInputMethodClient$Stub$Proxy@425094a0 attribute=n
ull, token = android.os.BinderProxy@4281c908
[COLOR=Red]I/ActivityManager(  631): Process com.sony.smallapp (pid 5626) has died.[/COLOR]
have any idea how to fix?

You have an issue with launching the small apps from task switcher?
 
  • Like
Reactions: naheel azawy

Top Liked Posts

  • There are no posts matching your filters.
  • 79
    SONY SMALL APPS FOR CM BASED ROM


    1-STEP

    decompile framework-res.apk

    goto res/values/strings.xml and add these lines a the end



    Code:
     <string name="permlab_externalTaskSwitcher">Start as an external task switcher</string>
        <string name="permdesc_externalTaskSwitcher">Allows the application to be an external task switcher replacing the native task switcher</string>
        <string name="permlab_smallapp">Small application overlay</string>
        <string name="permdesc_smallapp">Allows running movable small applications on top of other applications.</string>



    open AndroidManifest.xml

    and add the following lines
    Code:
     <permission android:name="android.permission.SYSTEM_ALERT_WINDOW" android:label="@string/permlab_systemAlertWindow" android:description="@string/permdesc_systemAlertWindow" android:protectionLevel="dangerous" android:permissionGroup="android.permission-group.SYSTEM_TOOLS" />

    and
    Code:
     <permission android:name="com.sony.smallapp.permission.SMALLAPP" android:label="@string/permlab_smallapp" android:description="@string/permdesc_smallapp" android:protectionLevel="dangerous" />


    like this shown in the pic..

    Untitled.png




    done recompile the framework-res.apk

    2-STEP

    decompile android.policy.jar

    and open com\android\internal\policy\impl\PhoneWindowManager.smal

    and add the red marked lines

    Code:
    .field static final RECENT_APPS_BEHAVIOR_DISMISS_AND_SWITCH:I = 0x3
    
    .field static final RECENT_APPS_BEHAVIOR_EXIT_TOUCH_MODE_AND_SHOW:I = 0x1
    
    .field static final RECENT_APPS_BEHAVIOR_SHOW_OR_DISMISS:I = 0x0
    
    .field static final SHOW_PROCESSES_ON_ALT_MENU:Z = false
    
    [COLOR="red"].field static final SHOW_STARTING_ANIMATIONS:Z = true   ----------------------[COLOR="Blue"][B]add this line if u dont have[/B][/COLOR]
    
    .field static final SMALLAPP_LAYER:I = 0x3[/COLOR]
    
    .field public static final SYSTEM_DIALOG_REASON_ASSIST:Ljava/lang/String; = "assist"
    
    .field public static final SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS:Ljava/lang/String; = "globalactions"
    
    .field public static final SYSTEM_DIALOG_REASON_HOME_KEY:Ljava/lang/String; = "homekey"
    
    .field public static final SYSTEM_DIALOG_REASON_KEY:Ljava/lang/String; = "reason"
    
    .field public static final SYSTEM_DIALOG_REASON_RECENT_APPS:Ljava/lang/String; = "recentapps"


    and find these lines in the same file.

    Code:
    [COLOR="Blue"].method public checkAddPermission(Landroid/view/WindowManager$LayoutParams;)I
        .locals 4
        .parameter "attrs"
    
        .prologue
        const/4 v2, 0x0
    
        .line 1588
        iget v1, p1, Landroid/view/WindowManager$LayoutParams;->type:I
    
        .line 1590
        .local v1, type:I
        const/16 v3, 0x7d0
    
        if-lt v1, v3, :cond_0
    
        const/16 v3, 0xbb7
    
        if-le v1, v3, :cond_1
    
        .line 1622
        :cond_0
        :goto_0
        return v2
    
        .line 1594
        :cond_1
        const/4 v0, 0x0
    
        .line 1595
        .local v0, permission:Ljava/lang/String;
        sparse-switch v1, :sswitch_data_0
    
        .line 1614
        const-string v0, "android.permission.INTERNAL_SYSTEM_WINDOW"
    
        .line 1616
        :goto_1
        :sswitch_0
        if-eqz v0, :cond_0
    
        .line 1617
        iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
    
        invoke-virtual {v3, v0}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I
    
        move-result v3
    
        if-eqz v3, :cond_0
    
        .line 1619
        const/4 v2, -0x8
    
        goto :goto_0
    
        .line 1611
        :sswitch_1
        const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
    
        .line 1612
        goto :goto_1
    
        .line 1595
        nop
    
        :sswitch_data_0
        .sparse-switch
            0x7d2 -> :sswitch_1
            0x7d3 -> :sswitch_1
            0x7d5 -> :sswitch_0
            0x7d6 -> :sswitch_1
            0x7d7 -> :sswitch_1
            0x7da -> :sswitch_1
            0x7db -> :sswitch_0
            0x7dd -> :sswitch_0
            0x7e7 -> :sswitch_0
        .end sparse-switch
    .end method[/COLOR]


    no is the funny part replace all the above blue marked lines with the below red marked lines

    Code:
    [COLOR="red"].method public checkAddPermission(Landroid/view/WindowManager$LayoutParams;)I
        .locals 4
        .parameter "attrs"
    
        .prologue
        const/4 v2, 0x0
    
        .line 1115
        iget v1, p1, Landroid/view/WindowManager$LayoutParams;->type:I
    
        .line 1117
        .local v1, type:I
        const/16 v3, 0x7d0
    
        if-lt v1, v3, :cond_0
    
        const/16 v3, 0xbb7
    
        if-le v1, v3, :cond_1
    
        .line 1152
        :cond_0
        :goto_0
        return v2
    
        .line 1121
        :cond_1
        const/4 v0, 0x0
    
        .line 1122
        .local v0, permission:Ljava/lang/String;
        sparse-switch v1, :sswitch_data_0
    
        .line 1144
        const-string v0, "android.permission.INTERNAL_SYSTEM_WINDOW"
    
        .line 1146
        :goto_1
        :sswitch_0
        if-eqz v0, :cond_0
    
        .line 1147
        iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
    
        invoke-virtual {v3, v0}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I
    
        move-result v3
    
        if-eqz v3, :cond_0
    
        .line 1149
        const/4 v2, -0x8
    
        goto :goto_0
    
        .line 1137
        :sswitch_1
        const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"
    
        .line 1138
        goto :goto_1
    
        .line 1141
        :sswitch_2
        const-string v0, "com.sony.smallapp.permission.SMALLAPP"
    
        .line 1142
        goto :goto_1
    
        .line 1122
        :sswitch_data_0
        .sparse-switch
            0x7d2 -> :sswitch_1
            0x7d3 -> :sswitch_1
            0x7d5 -> :sswitch_0
            0x7d6 -> :sswitch_1
            0x7d7 -> :sswitch_1
            0x7da -> :sswitch_1
            0x7db -> :sswitch_0
            0x7dd -> :sswitch_0
            0xbb5 -> :sswitch_2
            0xbb6 -> :sswitch_2
        .end sparse-switch
    .end method[/COLOR]


    save it..done now recompile the android.policy.jar


    3-STEP

    decompile framework.jar

    add the whole sony folder (provided in the resources.zip attached below ) in classout/com

    and recompile framework.jar

    4-STEP

    now u need to add some files in system/app
    system/etc
    system/framework

    all the files are provided in resources.zip so just take them and add those files in ur flashable zip

    5-STEP

    once u flash the mod .u need an Slauncher or Small app launcher app to launch the small apps...download it from google play

    so its done enjoy the smalls on cm based roms..

    This is the screenshots from galaxy SL Running CM10 xperia themed..
    attachment.php
    attachment.php


    some more SS of more small apps
    attachment.php
    attachment.php
    attachment.php
    attachment.php

    attachment.php
    attachment.php


    ROM THREAD LINK with working small apps using this tutorial..
    http://xdaforums.com/showthread.php?t=1862705

    This method is tested working on most xperia devices and GALAXY SL and also on CM9 , CM10 , PA , PACMAN


    Also tested working CM10.1

    attachment.php
    attachment.php
    attachment.php


    Here is a video from CM10.1


    might also work on Stock based FW but not tested

    CREDITS
    c3ma138 (for help , resources , app)
    5
    Its weird how smilies show up in tutorials instead of : permission... It becomes :permission

    Anyways nice tutorial bro... The screens are of sony stock ROM... any screens of it running on CM?

    And are the smallapps affected by CM themes too?

    Edit: oops I missed the slauncher part. Got my answers.

    The screenshots are from galaxy SL running cm10 xperia themed rom...

    Sent from my SK17i using XDA Premium HD app
    3
    Sandy anyway you could make this work just like it does on Sony devices i mean with that multi window type of look?..

    Sent from my GT-I9300 using Tapatalk 2
    yes the task switcher has be patched to systemUI ...i tried once but while opening it fc's.....will start working it again when i get my phone repaired or when i buy a new phone
    2
    Its weird how smilies show up in tutorials instead of : permission... It becomes :permission

    Anyways nice tutorial bro... The screens are of sony stock ROM... any screens of it running on CM?

    And are the smallapps affected by CM themes too?

    Edit: oops I missed the slauncher part. Got my answers.
    2
    add new resources file in OP with more working small apps

    thanks to @yamin8000 and @Pranav Pandey


    attachment.php
    attachment.php
    attachment.php
    attachment.php

    attachment.php
    attachment.php