Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,732,206 Members 44,174 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] How to port SONY Small Apps/Taskswitcher Plugin Xperia Z1 to CM10.2/4.3.1

Tip us?
 
lukakas
Old
(Last edited by lukakas; 25th April 2014 at 08:46 PM.) Reason: Z1 version multiple windows by default from z1
#1  
Senior Member - OP
Thanks Meter 384
Posts: 440
Join Date: Jun 2012
Location: São Paulo - SP
Calculator [GUIDE] How to port SONY Small Apps/Taskswitcher Plugin Xperia Z1 to CM10.2/4.3.1

How to port SONY Small Apps/Taskswitcher plugin Xperia Z1 Android 4.3 for CM10.1 or CM10.2



CyanogenMod 10.1 with Small Apps Z1 on my mango!

Hello I'm @lukakas.

I made this guide that will help you to mod your ROM for support fully Small Apps from Xperia Z1 4.3 (Include taskswitcher plugin mod). Works only for CM10.1/CM10.2 and maybe 4.2.2/4.3 based devices (Confirmed for working).

Small Apps Z1 4.3 is latest version of Sony, it bring us new features like:
  1. Small Apps support.
  2. Favorite list (Called taskswitcher plugin view) of small apps and "floatings" widgets on 'Recents Apps' (Taskswitcher).
  3. Widget floating window supported. (Like if converted homescreen widgets to small apps).
  4. Multiple windows by default from Z1, watch this vídeo: http://www.youtube.com/watch?v=PfspA0-YcYY
  5. Latest features of small apps ported from Xperia Z1 with Android 4.3 version.
  6. And much more to find.

Watch this video for looking these features working on CM10.1:



Information:

Quote:
android.policy.jar, framework.jar and framework-res.apk port is based from @sandy7 guide with some updates made by me for support Z1 4.3 small app version.

Link @sandy7 guide http://forum.xda-developers.com/show....php?t=2228969

Port Taskswitcher plugin (inside of SystemUI.apk) guide is made by me @lukakas.


Let's go to mod:

Step 1 - Decompile android.policy.jar

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

Find for method 'checkAddPermission' and replace all method to this lines below::

For CM11

 
Code:
.method public checkAddPermission(Landroid/view/WindowManager$LayoutParams;[I)I
    .locals 4
    .parameter "attrs"
    .parameter "outAppOp"

    .prologue
    const/4 v2, 0x0

    .line 1455
    iget v1, p1, Landroid/view/WindowManager$LayoutParams;->type:I

    .line 1457
    .local v1, type:I
    const/4 v3, -0x1

    aput v3, p2, v2

    .line 1459
    const/16 v3, 0x7d0

    if-lt v1, v3, :cond_0

    const/16 v3, 0xbb7

    if-le v1, v3, :cond_1

    .line 1497
    :cond_0
    :goto_0
    return v2

    .line 1463
    :cond_1
    const/4 v0, 0x0

    .line 1464
    .local v0, permission:Ljava/lang/String;
    sparse-switch v1, :sswitch_data_0

    .line 1489
    const-string v0, "android.permission.INTERNAL_SYSTEM_WINDOW"

    .line 1491
    :goto_1
    :sswitch_0
    if-eqz v0, :cond_0

    .line 1492
    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 1494
    const/4 v2, -0x8

    goto :goto_0

    .line 1481
    :sswitch_1
    const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"

    .line 1482
    const/16 v3, 0x18

    aput v3, p2, v2

    goto :goto_1

    .line 1486
    :sswitch_2
    const-string v0, "com.sony.smallapp.permission.SMALLAPP"

    .line 1487
    goto :goto_1

    .line 1464
    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
        0x7ee -> :sswitch_0
        0xbb5 -> :sswitch_2
        0xbb6 -> :sswitch_2
    .end sparse-switch
.end method


For CM10.2

 
Code:
.method public checkAddPermission(Landroid/view/WindowManager$LayoutParams;[I)I
    .locals 4
    .parameter "attrs"
    .parameter "outAppOp"

    .prologue
    const/4 v2, 0x0

    .line 1367
    iget v1, p1, Landroid/view/WindowManager$LayoutParams;->type:I

    .line 1369
    .local v1, type:I
    const/4 v3, -0x1

    aput v3, p2, v2

    .line 1371
    const/16 v3, 0x7d0

    if-lt v1, v3, :cond_0

    const/16 v3, 0xbb7

    if-le v1, v3, :cond_1

    .line 1408
    :cond_0
    :goto_0
    return v2

    .line 1375
    :cond_1
    const/4 v0, 0x0

    .line 1376
    .local v0, permission:Ljava/lang/String;
    sparse-switch v1, :sswitch_data_0

    .line 1400
    const-string v0, "android.permission.INTERNAL_SYSTEM_WINDOW"

    .line 1402
    :goto_1
    :sswitch_0
    if-eqz v0, :cond_0

    .line 1403
    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 1405
    const/4 v2, -0x8

    goto :goto_0

    .line 1392
    :sswitch_1
    const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"

    .line 1393
    const/16 v3, 0x18

    aput v3, p2, v2

    goto :goto_1

    .line 1397
    :sswitch_2
    const-string v0, "com.sony.smallapp.permission.SMALLAPP"

    .line 1398
    goto :goto_1

    .line 1376
    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
        0xbb5 -> :sswitch_2
        0xbb6 -> :sswitch_2
    .end sparse-switch
.end method



For CM10.1

 
Code:
.method public checkAddPermission(Landroid/view/WindowManager$LayoutParams;)I
	.locals 4
	.parameter "attrs"

	.prologue
	const/4 v2, 0x0

	.line 1315
	iget v1, p1, Landroid/view/WindowManager$LayoutParams;->type:I

	.line 1317
	.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 1353
	:cond_0
	:goto_0
	return v2

	.line 1321
	:cond_1
	const/4 v0, 0x0

	.line 1322
	.local v0, permission:Ljava/lang/String;
	sparse-switch v1, :sswitch_data_0

	.line 1345
	const-string v0, "android.permission.INTERNAL_SYSTEM_WINDOW"

	.line 1347
	:goto_1
	:sswitch_0
	if-eqz v0, :cond_0

	.line 1348
	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 1350
	const/4 v2, -0x8

	goto :goto_0

	.line 1338
	:sswitch_1
	const-string v0, "android.permission.SYSTEM_ALERT_WINDOW"

	.line 1339
	goto :goto_1

	.line 1342
	:sswitch_2
	const-string v0, "com.sony.smallapp.permission.SMALLAPP"

	.line 1343
	goto :goto_1

	.line 1322
	: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
		0xbb5 -> :sswitch_2
		0xbb6 -> :sswitch_2
	.end sparse-switch
.end method


Save your modifications and recompile it.


Step 2 - Decompile framework.jar

Open folder smali/com/

For CM10.2
Code:
Paste 'Sony' folder (provided SmallApps_Z1-4.3Resources.zip - 16.98 KB file attached in folder resources/framework)
Save your modifications and recompile it.

For CM10.1
Code:
Paste 'Sony' folder (provided SmallApps_Z1-4.2.2_Resources.zip - 17.71 KB file attached in folder resources/framework)
Save your modifications and recompile it.


Step 3 - Decompile framework-res.apk

And open AndroidManifest.xml

Add these lines:

Code:
	
<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" />
Like this marked in red lines:

Code:
<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" />
<uses-permission android:name="android.permission.CONFIRM_FULL_BACKUP" />
<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" />
<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_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>
<string name="permlab_smallapp">Small application overlay</string>
<string name="permdesc_smallapp">Allows running movable small applications on top of other applications.</string>
Save your modifications and recompile it.

Now we go to most difficult part: Porting TaskSwitcher in SystemUI.apk.
The Following 51 Users Say Thank You to lukakas For This Useful Post: [ Click to Expand ]
 
lukakas
Old
(Last edited by lukakas; 8th February 2014 at 01:04 AM.)
#2  
Senior Member - OP
Thanks Meter 384
Posts: 440
Join Date: Jun 2012
Location: São Paulo - SP
Step 4 - Decompile SystemUI.apk

1 - Open AndroidManifest.xml

Add these lines:

Code:
<uses-permission android:name="com.sonymobile.permission.XSSM_PROVIDER" />
<uses-permission android:name="com.sonymobile.permission.XSSM" />
<uses-permission android:name="android.permission.BIND_APPWIDGET" />
<uses-permission android:name="com.sony.smallapp.app.widget.permission.BIND_SMALLAPP_WIDGET_MANAGER" />
<uses-permission android:name="com.sony.smallapp.permission.SMALLAPPMANAGER_CONTROL" />
<uses-permission android:name="com.sony.smallapp.launcher.permission.ACCESS_DATABASE" />
<uses-permission android:name="android.permission.DELETE_PACKAGES" />
<permission android:name="com.sonymobile.permission.TASK_SWITCHER_PLUGIN_VIEW" android:protectionLevel="signatureOrSystem" />
Like this marked in blue:

Code:
<uses-permission android:name="android.permission.SET_ORIENTATION" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.READ_DREAM_STATE" />
<uses-permission android:name="android.permission.WRITE_DREAM_STATE" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="com.sonymobile.permission.XSSM_PROVIDER" />
<uses-permission android:name="com.sonymobile.permission.XSSM" />
<uses-permission android:name="android.permission.BIND_APPWIDGET" />
<uses-permission android:name="com.sony.smallapp.app.widget.permission.BIND_SMALLAPP_WIDGET_MANAGER" />
<uses-permission android:name="com.sony.smallapp.permission.SMALLAPPMANAGER_CONTROL" />
<uses-permission android:name="com.sony.smallapp.launcher.permission.ACCESS_DATABASE" />
<uses-permission android:name="android.permission.DELETE_PACKAGES" />
<permission android:name="com.sonymobile.permission.TASK_SWITCHER_PLUGIN_VIEW" android:protectionLevel="signatureOrSystem" />
<application android:label="@string/app_label" android:icon="@*android:drawable/platlogo" android:allowClearUserData="false" android:persistent="true" android:allowBackup="false" android:hardwareAccelerated="true">
        <service android:name="SystemUIService" android:exported="true" />
        <service android:name=".screenshot.TakeScreenshotService" android:exported="false" android:process=":screenshot" />
        <service android:name=".LoadAverageService" android:exported="true" />
        <service android:name=".ImageWallpaper" android:permission="android.permission.BIND_WALLPAPER" android:exported="true" />
        <receiver android:name=".BootReceiver" androidprv:primaryUserOnly="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            </intent-filter>
        </receiver>
Add this line in 'RecentsActivity' activity:

Code:
<action android:name="com.android.systemui.recent.action.OPEN_RECENTS_INTENT_FROM_SMALL_APP_LAUNCHER" />
Like this below of "<action android:name="com.android.systemui.TOGGLE_RECENTS" />" marked in red:

Code:
<activity android:theme="@style/RecentsStyle" android:label="@string/accessibility_desc_recent_apps" android:name=".recent.RecentsActivity" android:exported="true" android:excludeFromRecents="true" android:launchMode="singleInstance">
	<intent-filter>
		<action android:name="com.android.systemui.TOGGLE_RECENTS" />
		<action android:name="com.android.systemui.recent.action.OPEN_RECENTS_INTENT_FROM_SMALL_APP_LAUNCHER" />
	</intent-filter>
</activity>

2 - Go to res/values/attrs.xml

Add this line:

Code:
<attr name="lookupKey" format="string" />
Like this marked in blue:

Code:
<resources>
    <attr name="keyCode" format="integer" />
    <attr name="keyRepeat" format="boolean" />
    <attr name="glowBackground" format="reference" />
    <attr name="text" format="string" />
    <attr name="insetLeft" format="dimension" />
    <attr name="rowHeight" format="dimension" />
    <attr name="recentItemLayout" format="reference" />
    <attr name="minSize" format="dimension" />
    <attr name="maxSize" format="dimension" />
    <attr name="holdTime" format="integer" />
    <attr name="decayTime" format="integer" />
    <attr name="orientation">
        <enum name="horizontal" value="0" />
	<enum name="vertical" value="1" />
    </attr>
    <attr name="lookupKey" format="string" />
</resources>
3 - Go to res/values/ids.xml

Add these lines at the end:

Code:
<item type="id" name="recents_inject_custom_view">false</item>
<item type="id" name="recents_layout">false</item>
<item type="id" name="recents_pluginview_container">false</item>
Like this marked in red:

Code:
<resources>
	...
	<item type="id" name="notification_inspect_item">false</item>
	<item type="id" name="recent_remove_item">false</item>
	<item type="id" name="recent_inspect_item">false</item>
	<item type="id" name="recents_inject_custom_view">false</item>
	<item type="id" name="recents_layout">false</item>
	<item type="id" name="recents_pluginview_container">false</item>
        
</resources>
4 - Open res/values/public.xml

ATTENTION: Don't duplicate "hex id", create always next "hex id" from the last type of the name, it's for previne duplicate.

Where's hex id?

For example:

Code:
<public type="attr" name="lookupKey" id="0x7f01000c" />
"Hex id" is: 0x7f01000c marked in blue

Save all hex id yours created because we need it later:

For example, where's the last type of 'attr'? See in public.xml, the last type of 'attr' marked in green and name is"orientation" like this marked in red:

Code:
<resources>
    <public type="attr" name="keyCode" id="0x7f010000" />
    <public type="attr" name="keyRepeat" id="0x7f010001" />
    <public type="attr" name="glowBackground" id="0x7f010002" />
    <public type="attr" name="text" id="0x7f010003" />
    <public type="attr" name="insetLeft" id="0x7f010004" />
    <public type="attr" name="rowHeight" id="0x7f010005" />
    <public type="attr" name="recentItemLayout" id="0x7f010006" />
    <public type="attr" name="minSize" id="0x7f010007" />
    <public type="attr" name="maxSize" id="0x7f010008" />
    <public type="attr" name="holdTime" id="0x7f010009" />
    <public type="attr" name="decayTime" id="0x7f01000a" />
    <public type="attr" name="orientation" id="0x7f01000b" />
    <public type="drawable" name="bugdroid" id="0x7f02000e" />
    <public type="drawable" name="cid_angry" id="0x7f02000f" />
    <public type="drawable" name="cid_confused" id="0x7f020010" />
    <public type="drawable" name="cid_normal" id="0x7f020011" />
    <public type="drawable" name="cidlogo" id="0x7f020012" />
It comes with an id=0x7f01000b marked in blue, it's like hex numeral. Then, the next id should be 0x7f01000c like this marked in blue:

Code:
<resources>
    <public type="attr" name="keyCode" id="0x7f010000" />
    <public type="attr" name="keyRepeat" id="0x7f010001" />
    <public type="attr" name="glowBackground" id="0x7f010002" />
    <public type="attr" name="text" id="0x7f010003" />
    <public type="attr" name="insetLeft" id="0x7f010004" />
    <public type="attr" name="rowHeight" id="0x7f010005" />
    <public type="attr" name="recentItemLayout" id="0x7f010006" />
    <public type="attr" name="minSize" id="0x7f010007" />
    <public type="attr" name="maxSize" id="0x7f010008" />
    <public type="attr" name="holdTime" id="0x7f010009" />
    <public type="attr" name="decayTime" id="0x7f01000a" />
    <public type="attr" name="orientation" id="0x7f01000b" />
    <public type="attr" name="lookupKey" id="0x7f01000c" /> 
    <public type="drawable" name="bugdroid" id="0x7f02000e" />
    <public type="drawable" name="cid_angry" id="0x7f02000f" />
    <public type="drawable" name="cid_confused" id="0x7f020010" />
    <public type="drawable" name="cid_normal" id="0x7f020011" />
    <public type="drawable" name="cidlogo" id="0x7f020012" />
Easy way for everybody to get next HEX ID by @Android-Andi can be found here: http://forum.xda-developers.com/show...&postcount=103

You'll add this line with next id marked in blue that you find the last attr type in your public.xml (Don't duplicate "hex ids"):

Code:
<public type="attr" name="lookupKey" id="NEXT HEX ID PUT HERE" />
You will do the same with others types, add these lines as instructed below marked in red and put your next id marked in blue:

Code:
...lines to skip until last layout type... (Don't copy this line)
<public type="layout" name="plugin_view" id="NEXT HEX ID PUT HERE" />
...much lines to skip until last id type...(Don't copy this line) 
<public type="id" name="recents_inject_custom_view" id="NEXT HEX ID PUT HERE" />
<public type="id" name="recents_layout" id="NEXT HEX ID PUT HERE" />
<public type="id" name="recents_pluginview_container" id="NEXT HEX ID PUT HERE" />


5 - Go to res/layout/ (Check Resources files attached in OP for copy necessary files.)
plugin_view.xml - paste this file from resource/res-files/layout/
status_bar_recents_panel.xml - paste and replace this file from resource/res-files/layout/
6 - Go to res/layout-land
status_bar_recents_panel.xml - paste and replace this file from resource/res-files/layout-land/.

7 - Go to smali/com/android/systemui/ - paste and replace all files from 'resources/smali-files/R/' folder.

8 - Go to smali/com/android/systemui/recent/ - paste and replace all files from 'resources/smali-files/RecentsActivity/' folder.

10 - Go to smali/com/android/systemiu/recent/ and open RecentsActivity.smali

Find these names below:

recents_pluginview_container
recents_layout
plugin_view
status_bar_recent_panel
recents_root
config_recent_item_min_alpha
recents_pluginview_container
recents_return_to_launcher_enter
recents_return_to_launcher_exit


You'll replace these names with "hex id" from res/values/public.xml, it need to match the same name for replace "hex id", for example recents_pluginview_container is marked in blue that you find in RecentsActivity.smali:

Code:
.line 310
    invoke-static {}, Lcom/android/systemui/recent/RecentsActivity;->detachPluginView()V

    .line 311
    const v3, recents_pluginview_container

    invoke-virtual {p0, v3}, Lcom/android/systemui/recent/RecentsActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/view/ViewGroup;
Find for recents_pluginview_container in res/values/public.xml and copy your hex id:

Code:
<public type="id" name="recents_pluginview_container" id="COPY YOUR ID HEX" />
Replace recents_pluginview_container with your hex id that you find in public.xml, like this:

Code:
.line 310
    invoke-static {}, Lcom/android/systemui/recent/RecentsActivity;->detachPluginView()V

    .line 311
    const v3, "PASTE YOUR ID HEX"

    invoke-virtual {p0, v3}, Lcom/android/systemui/recent/RecentsActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/view/ViewGroup;
Quote:
My port looked like this, I copied this code in red: (Don't do that just see as working)

Code:
<public type="id" name="recents_pluginview_container" id="0x7f0900e7" />
And I replaced recents_pluginview_container to 0x7f0900e7 in RecentsActivity.smali like this marked in blue:

Code:
.line 310
    invoke-static {}, Lcom/android/systemui/recent/RecentsActivity;->detachPluginView()V

    .line 311
    const v3, 0x7f0900e7

    invoke-virtual {p0, v3}, Lcom/android/systemui/recent/RecentsActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/view/ViewGroup;
You'll do the same with others names:

recents_layout
plugin_view
status_bar_recent_panel
recents_root
config_recent_item_min_alpha
recents_pluginview_container
recents_return_to_launcher_enter
recents_return_to_launcher_exit

11 - Go to smali/com/android/systemui/ and open R$styleable.smali

Find for lookupKey like this marked in blue:

Code:
 .line 2536
    new-array v0, v3, [I

    const v1, lookupKey

    aput v1, v0, v2

    sput-object v0, Lcom/android/systemui/R$styleable;->RemotePluginView:[I
Find lookupKey in res/values/public.xml and copy your hex id:

Code:
<public type="attr" name="lookupKey" id="COPY YOUR ID HEX" />
Replace lookupKey with your hex id that you find in public.xml, like this:

Code:
 .line 2536
    new-array v0, v3, [I

    const v1, "PASTE YOUR ID HEX"

    aput v1, v0, v2

    sput-object v0, Lcom/android/systemui/R$styleable;->RemotePluginView:[I
Save all modifications and recompile SystemUI.apk!

Step 5 -

For CM10.2

 
Now add these files recompiled in flashable zip attached
SystemUI.apk to system/app
android.policy.jar, framework.jar, framework-res.apk to system/framework

For CM10.1
 
Now add these files recompiled in flashable zip attached
SystemUI.apk to system/app
android.policy.jar, framework.jar, framework-res.apk to system/framework


Done! Your ROM already support small apps Z1 with taskswitcher working!

Changelog:
Quote:
07/02/2014 (Click here)
-Support for CM10.2
-Based from latest small apps taskswitcher plugin from Xperia Z1 - 4.3
-Multiple windows by default from Z1, watch this vídeo: http://www.youtube.com/watch?v=PfspA0-YcYY
-Latest small apps from Xperia Z1 4.3 system
-Improvements of small app manager code and library.
-Layout fixes.
-Guide separate for CM10.1 and CM10.2

10/10/2013 (Click here)

-Based from latest small apps taskswitcher plugin from Xperia Z1
-Multiple windows by default from Z1, watch this vídeo: http://www.youtube.com/watch?v=PfspA0-YcYY
-Latest small apps from Xperia Z1 system
-Fixed rotate orientation close small app
-Improvements of small app manager code and library.
-Add step 12 of SystemUI.apk step 5
If you have difficulty to port SystemUI.apk follow this video guide, it will help you to mod
(Recommended to use Virtuous Ten Studio)




Part 2:
 


Video-Tutorial on How to port SONY Small Apps/Taskswitcher plugin to CM10.1/4.2.2 using "Android Multitool" from @Flextrick by @Android-Andi
http://forum.xda-developers.com/show...6&postcount=75


Screenshots:

 



If you liked my work, just click on Thanks button.

Quote:
Credits:
Thanks sandy7 for provide this tutorial gave me possibility to port small app 4.3 version only.
Me (Lukakas) for port Taskswitcher plugin and latest version of Small Apps (Xperia Z1 Android 4.3)
Sony for create this awesome feature.
Serajr for some tips.
Xperia 2011 port thread: http://forum.xda-developers.com/show....php?t=2421678

Addons:

Quote:
@chotu222 have made a flashable zip of all the latest small apps.

The zip includes:
Smallapps
-Camera
-Mirror
-Toggle
-Walkman
-Web
-Google

update v2 with
-Latest voiceout
-Unit converter
-Currency converter

Download: LatestSmallapps-updatev2.zip

Post thread: http://forum.xda-developers.com/show...5&postcount=42
If anyone got working, please post screenshots in this thread!

Working reports with screenshot:

 
Confirmed for working by @chotu222 from Xperia T and Galaxy Grand DUOS screenshots:

 


Confirmed for working by @CressKH from Xperia ZR C5503:

 


Confirmed for working by @Android-Andi from Galaxy Tab 2 - P3110 and others screenshots (Tablet UI working too):

 


Working on some stock 4.2.2 Roms by @Koloses

 



Quote:
If you are using my Guide Mod in your ROM modded with small apps, please give me credits by mention my username @lukakas and post thread link guide
The Following 63 Users Say Thank You to lukakas For This Useful Post: [ Click to Expand ]
 
iiandskater
Old
#3  
iiandskater's Avatar
Senior Member
Thanks Meter 2687
Posts: 493
Join Date: Jan 2012
Location: Jogjakarta Hardcore

 
DONATE TO ME
Very well written,
thanks a lot my friend
Find it useful ??
Just need a few miliseconds to click

Thank you..

 

Code:
C1905 (current main device)
ST15i (current secondary/development device)
C6903 (sometimes in the future :p)
The Following 2 Users Say Thank You to iiandskater For This Useful Post: [ Click to Expand ]
 
lukakas
Old
(Last edited by lukakas; 28th September 2013 at 03:27 AM.)
#4  
Senior Member - OP
Thanks Meter 384
Posts: 440
Join Date: Jun 2012
Location: São Paulo - SP
Quote:
Originally Posted by iiandskater View Post
Very well written,
thanks a lot my friend
Thanks my friend, I think I can make the mod more compatible with other ROMS, but this needs to increase instructions guide maybe need create some smali code
 
serajr
Old
#5  
serajr's Avatar
Recognized Developer / Recognized Themer
Thanks Meter 8889
Posts: 2,304
Join Date: Apr 2011
Location: Rafard - SP
Masterpiece!!
The Following 2 Users Say Thank You to serajr For This Useful Post: [ Click to Expand ]
 
lukakas
Old
#6  
Senior Member - OP
Thanks Meter 384
Posts: 440
Join Date: Jun 2012
Location: São Paulo - SP
I update OP because I missed lookupkey to replace id in R$styable.smali.
 
sandy7
Old
#7  
sandy7's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 6840
Posts: 6,179
Join Date: May 2012
Location: bangalore

 
DONATE TO ME
Nice explanation...good work

Sent from my C5302 using XDA Premium 4 mobile app
The Following 2 Users Say Thank You to sandy7 For This Useful Post: [ Click to Expand ]
 
Vynikal
Old
#8  
Vynikal's Avatar
Senior Member
Thanks Meter 430
Posts: 715
Join Date: Sep 2012
Thank you very much lukakas.
Btw you got featured!!
Live with Walkman
ROM: CM11 20140720 with JustArchi's optimizations
Kernel: OptKernel
The Following 2 Users Say Thank You to Vynikal For This Useful Post: [ Click to Expand ]
 
uriel_zo
Old
(Last edited by uriel_zo; 28th September 2013 at 09:10 AM.)
#9  
uriel_zo's Avatar
Senior Member
Thanks Meter 467
Posts: 306
Join Date: Sep 2010
Location: ciudad del carmen campeche
Default help

Quote:
Originally Posted by lukakas View Post
I update OP because I missed lookupkey to replace id in R$styable.smali.


bro
I'm trying to do for motorola atrix cm10.1 4.2.2
and I skip this error
any idea?



thanks.
 
D2m_mhd
Old
#10  
D2m_mhd's Avatar
Senior Member
Thanks Meter 18
Posts: 104
Join Date: Nov 2012
Location: Damascus
Thumbs up Noob Q

I Have to decompile but i cant find the files (android.policy.jar , framework.jar , framework-res.apk) in your attachments that you said you've modified them to support 4.2.2 "android.policy.jar, framework.jar and framework-res.apk port is based from @sandy7 guide with some updates made by me for support 4.2.2 small app version" ... i am noob if somebody can upload a 'Ready to flash' zip that would be so helpful as we don't have experience in decompiling & recompiling
-and BTW Thank you very much for this awesome guide
Phone History :
1)- Samsung SGH-x506...............2)- Nokia 6600
3)- Nokia 5230.............................4)- Samsung S5230 star
5)- Nokia N97..............................6)- Nokia 701
7)- SonyEricsson Xperia Arc S......8)- SonyEricsson Xperia Play
9)- HTC Evo 3D............................10)- .....?!

Tags
small apps sony cm10.1 cyanogenmod
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes