[guide][jb][3-way] easily enable extended power menu for mtk devices - Android Themes

Hello Everyone ,
In this guide i'll show u how to add Reboot and Recovery option to power menu
There is lots of Guides on how to add recovery option to power menu but none worked perfectly on my device(MTK)
so i found a new way , in which we need not to find proper globalaction files
Requirements :
apktool
Notepad++
android.policy.jar
framework-res.apk
Time and Patience
Click to expand...
Click to collapse
Part-1
Decompile Your framework-res.apk and navigate to - res/value/strings.xml
add these lines at the end.
Code:
<string name="reboot_text">Reboot</string>
<string name="recovery_text">Recovery</string>
Like this
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
and add the attached pngs to - res/drawable-hdpi/ and compile the apk
again decompile the modded apk and open res/values/public.xml
Part-2
Now Decompile your "android.policy.jar" and add the attached files to - "android.policy.jar.out\smali\com\android\internal\policy\impl"
Now open GlobalActions.smali and find this method
Code:
.method private createDialog()Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
Below that you will see
Code:
.locals 11
change it to
Code:
.locals [COLOR="Red"]12[/COLOR]
Now find
Code:
.prologue
Below that paste this
Code:
const [COLOR="Red"]v11[/COLOR], 0x1080030 <------------ Replace the id with ic_lock_power_off (power off drawable) in the opened public.xml
Now Find this
Code:
new-instance [COLOR="Purple"]v1[/COLOR], Lcom/android/internal/policy/impl/GlobalActions$2;
const [COLOR="DarkGreen"]v2[/COLOR], 0x10400e7
change the id 0x10400e7 with the new id in public.xml
Code:
<public type="string" name="global_action_power_off"
now below that you will see
Code:
const [COLOR="Magenta"]v3[/COLOR], 0x10400e7
now delate the above line and paste this below
Code:
invoke-direct {v1, p0, v11, v2}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 317
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$98;
const [COLOR="Red"]v2[/COLOR], 0x108061a <----------id of <public type="drawable" name="ic_lock_reboot"
const [COLOR="Magenta"]v3[/COLOR], 0x104054f <----------id of <public type="string" name="reboot_text"
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$98;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 327
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$99;
const [COLOR="Red"]v2[/COLOR], 0x1080619 <---------- id of <public type="drawable" name="ic_lock_recovery"
const [COLOR="Magenta"]v3[/COLOR], 0x1040550 <-----------id of <public type="string" name="recovery_text"
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
Replace the above ids with the id in your public.xml
Before :
Code:
.line 281
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
.line 284
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
[COLOR="RoyalBlue"]new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x10400e7
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[/COLOR]
.line 309
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 312
After :
Code:
.line 281
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
.line 284
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
[COLOR="Blue"] const v2, 0x10400e7
invoke-direct {v1, p0, v11, v2}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 317
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$98;
const v2, 0x108061a
const v3, 0x104054f
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$98;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 327
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$99;
const v2, 0x1080619
const v3, 0x1040550
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[/COLOR] .line 309
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
Now compile and flash both the files
I have attached my GlobalActions.smali for comparision just change the extension from .zip to .smali
Result :
Hints :
1 . While Replacing the id from public.xml replace only last 7 digits
like this
2. keep track of registers (like v1 v2 v11 etc) and .Line numbers should be unique
3. Register values (like 0x108061a) will be Different for Different roms
I've Tested this guide on 3 different roms and it is working fine without any errors
If u Have any Problems Post here i'll try my best to help you
Credits/ Thanks
SuperDroidBond
Adi Aisiteru Reborn
Learnt many things from their guides ...
Click to expand...
Click to collapse
If you like my work Hit Thanks ..dont forget ​​

Reserved ...

+1
reserved ..

Great guide bro :good:

hello aweasome guide sir thanks alot
put can you give me a smali tool you used
the guide is aweasome realy want to do it thanks
i have done the tutorial and when i press and hold power volume it softreboots
so where is the problem
hope any one here helps me

working for my device Xperia C
after changing Const V3 with V2 that u said in the section of putting the line 317 and 327
u have to fix it more as things are going wrong cause thereis gona be amiss in the last line

Mohamed Yahia San said:
working for my device Xperia C
after changing Const V3 with V2 that u said in the section of putting the line 317 and 327
u have to fix it more as things are going wrong cause thereis gona be amiss in the last line
Click to expand...
Click to collapse
hello how do you mean changing Const V3 with V2 ????

i mean instead OF
const v3, 0x10400e7
i made it
const v2, 0x10400e7
but with different id of course

Thanx sir it works on my mt6589 cross a88

Related

[MOD][HOWTO][JB]Add quad lockscreen to any stock based JB rom. **UPDATED**

This howto will teach you how to add a quad lockscreen with phone and messaging to any jb rom in 2 ways:
[SMALI]: you're going to modify already compiled files, you will need a basic knowledge about decompiling/recompiling/editing jar, apk and smali files.
[JAVA]: you're going to modify the JB source code, you will need a basic knowledge about java and how to compile an AOSP.
Choose your path and always follow the instuction with that tag.
framework resources editing:
[SMALI]
Decompile your framework-res.apk
Put ic_lockscreen_phone_activated.png, ic_lockscreen_phone_normal.png, ic_lockscreen_sms_activated.png, ic_lockscreen_sms_normal.png in /res/drawable-hdpi/
[JAVA]
Put ic_lockscreen_phone_activated.png, ic_lockscreen_phone_normal.png, ic_lockscreen_sms_activated.png, ic_lockscreen_sms_normal.png in /frameworks/base/core/res/res/drawable-hdpi/
[SMALI]
Put ic_lockscreen_phone.xml, ic_lockscreen_sms.xml in /res/drawable/
[JAVA]
Put ic_lockscreen_phone.xml, ic_lockscreen_sms.xml in /frameworks/base/core/res/res/drawable/
Add the necessary entries in /frameworks/base/core/res/res/values/public.xml:
Code:
<java-symbol type="drawable" name="ic_lockscreen_sms" />
<java-symbol type="drawable" name="ic_lockscreen_phone" />
[SMALI]
Open /res/values/arrays.xml
[JAVA]
Open /frameworks/base/core/res/res/values/arrays.xml
[SMALI]/[JAVA]
Replace the whole array <array name="lockscreen_targets_with_camera"> .. </array> with:
Code:
<array name="lockscreen_targets_with_camera">
<item>@drawable/ic_lockscreen_unlock</item>
<item>@drawable/ic_lockscreen_sms</item>
<item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_phone</item>
<item>@drawable/ic_lockscreen_camera</item>
<item>@null</item>
<item>@null</item>
<item>@null</item>
</array>
Replace the whole array <array name="lockscreen_target_descriptions_with_camera"> .. </array> with:
Code:
<array name="lockscreen_target_descriptions_with_camera">
<item>@string/description_target_unlock</item>
<item>@string/description_target_sms</item>
<item>@string/description_target_search</item>
<item>@string/description_target_phone</item>
<item>@string/description_target_camera</item>
<item>@null</item>
<item>@null</item>
<item>@null</item>
</array>
[SMALI]
Open /res/values-land/arrays.xml
[JAVA]
Open /frameworks/base/core/res/res/values-land/arrays.xml
[SMALI]/[JAVA]
Replace the whole array <array name="lockscreen_targets_with_camera"> .. </array> with:
Code:
<array name="lockscreen_targets_with_camera">
<item>@null</item>
<item>@null</item>
<item>@drawable/ic_lockscreen_unlock</item>
<item>@drawable/ic_lockscreen_sms</item>
<item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_phone</item>
<item>@drawable/ic_lockscreen_camera</item>
<item>@null</item>
</array>
Replace the whole array <array name="lockscreen_target_descriptions_with_camera"> .. </array> with:
Code:
<array name="lockscreen_target_descriptions_with_camera">
<item>@null</item>
<item>@null</item>
<item>@string/description_target_unlock</item>
<item>@string/description_target_sms</item>
<item>@string/description_target_search</item>
<item>@string/description_target_phone</item>
<item>@string/description_target_camera</item>
<item>@null</item>
</array>
[SMALI]
Open /res/values/strings.xml
[JAVA]
Open /frameworks/base/core/res/res/values/strings.xml
[SMALI]/[JAVA]
Add the following entries:
Code:
<string name="description_target_sms">Sms</string>
<string name="description_target_phone">Phone</string>
[SMALI]
Recompile your framework. Then decompile the new one and write down the addresses of the following resources in /res/values/pubblic.xml:
Code:
ic_action_assist_generic
ic_lockscreen_camera
ic_lockscreen_silent
ic_lockscreen_unlock
ic_lockscreen_unlock_phantom
ic_lockscreen_phone
ic_lockscreen_sms
framework editing: ***UPDATED***
[JAVA]
Edit /frameworks/base/core/java/com/android/internal/widget/multiwaveview/GlowPadView.java
Code:
- return mTargetDescriptions.get(index);
+ String targetZ = "";
+ try {
+ targetZ = mTargetDescriptions.get(index);
+ } catch (Exception e) {
+ }
+ return targetZ;
Code:
- return mDirectionDescriptions.get(index);
+ try {
+ String directionZ = mDirectionDescriptions.get(index);
+ return directionZ;
+ } catch (Exception e) {
+ return "";
+ }
[SMALI]
Disassemble your framework.jar
Edit /com/android/internal/widget/multiwaveview/GlowPadView.smali and replace the whole methods ".method private getDirectionDescription(I)Ljava/lang/String;" and ".method private getTargetDescription(I)Ljava/lang/String;" with the following methods:
Code:
.method private getDirectionDescription(I)Ljava/lang/String;
.locals 4
.parameter "index"
.prologue
.line 1119
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
if-eqz v2, :cond_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->isEmpty()Z
move-result v2
if-eqz v2, :cond_1
.line 1120
:cond_0
iget v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptionsResourceId:I
invoke-direct {p0, v2}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->loadDescriptions(I)Ljava/util/ArrayList;
move-result-object v2
iput-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
.line 1121
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDrawables:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v2
iget-object v3, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result v3
if-eq v2, v3, :cond_1
.line 1122
const-string v2, "GlowPadView"
const-string v3, "The number of target drawables must be equal to the number of direction descriptions."
invoke-static {v2, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 1124
const/4 v0, 0x0
.line 1133
:goto_0
return-object v0
.line 1130
:cond_1
:try_start_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 1131
.local v0, directionZ:Ljava/lang/String;
goto :goto_0
.line 1132
.end local v0 #directionZ:Ljava/lang/String;
:catch_0
move-exception v1
.line 1133
.local v1, e:Ljava/lang/Exception;
const-string v0, ""
goto :goto_0
.end method
Code:
.method private getTargetDescription(I)Ljava/lang/String;
.locals 4
.parameter "index"
.prologue
.line 1099
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
if-eqz v2, :cond_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->isEmpty()Z
move-result v2
if-eqz v2, :cond_1
.line 1100
:cond_0
iget v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptionsResourceId:I
invoke-direct {p0, v2}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->loadDescriptions(I)Ljava/util/ArrayList;
move-result-object v2
iput-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
.line 1101
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDrawables:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v2
iget-object v3, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result v3
if-eq v2, v3, :cond_1
.line 1102
const-string v2, "GlowPadView"
const-string v3, "The number of target drawables must be equal to the number of target descriptions."
invoke-static {v2, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 1104
const/4 v1, 0x0
.line 1114
:goto_0
return-object v1
.line 1109
:cond_1
const-string v1, ""
.line 1111
.local v1, targetZ:Ljava/lang/String;
:try_start_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v2
move-object v0, v2
check-cast v0, Ljava/lang/String;
move-object v1, v0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
.line 1112
:catch_0
move-exception v2
goto :goto_0
.end method
Recompile your framework.jar
Now we're done with the framework, now we need to modify last file: android.policy.jar
android policy editing:
[JAVA]
Open /frameworks/base/policy/src/com/android/internal/policy/impl/LockScreen.java
Inside the method onTrigger, inside the switch (resId) add:
Code:
case com.android.internal.R.drawable.ic_lockscreen_phone:
Intent phoneIntent = new Intent(Intent.ACTION_MAIN);
phoneIntent.setClassName("com.android.contacts", "com.android.contacts.activities.DialtactsActivity");
phoneIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(phoneIntent);
mCallback.goToUnlockScreen();
break;
case com.android.internal.R.drawable.ic_lockscreen_sms:
Intent mmsIntent = new Intent(Intent.ACTION_MAIN);
mmsIntent.setClassName("com.android.mms", "com.android.mms.ui.ConversationList");
mmsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(mmsIntent);
mCallback.goToUnlockScreen();
break;
You're done, feel free to compile!
Of course you can use whatever activity you want, remember to change the images accordingly.
[SMALI]
Disassemble your android.policy.jar
Edit /com/android/internal/policy/impl/LockScreen.smali and add the following methods:
Code:
.method static synthetic access$1400(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
.locals 1
.parameter "x0"
.prologue
.line 56
iget-object v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mContext:Landroid/content/Context;
return-object v0
.end method
.method static synthetic access$1500(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
.locals 1
.parameter "x0"
.prologue
.line 56
iget-object v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mContext:Landroid/content/Context;
return-object v0
.end method
Edit /com/android/internal/policy/impl/LockScreen$GlowPadViewMethods.smali.
Replace the whole method onTrigger with:
Code:
.method public onTrigger(Landroid/view/View;I)V
.locals 7
.parameter "v"
.parameter "target"
.prologue
const/high16 v6, 0x1000
.line 313
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->mGlowPadView:Lcom/android/internal/widget/multiwaveview/GlowPadView;
invoke-virtual {v4, p2}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->getResourceIdForTarget(I)I
move-result v3
.line 321
.local v3, resId:I
sparse-switch v3, :sswitch_data_0
.line 367
:goto_0
return-void
.line 323
:sswitch_0
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1200(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
move-result-object v4
invoke-static {v4}, Landroid/app/SearchManager;->getAssistIntent(Landroid/content/Context;)Landroid/content/Intent;
move-result-object v0
.line 324
.local v0, assistIntent:Landroid/content/Intent;
if-eqz v0, :cond_0
.line 325
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->launchActivity(Landroid/content/Intent;)V
.line 329
:goto_1
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->pokeWakelock()V
goto :goto_0
.line 327
:cond_0
const-string v4, "LockScreen"
const-string v5, "Failed to get intent for assist activity"
invoke-static {v4, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_1
.line 333
.end local v0 #assistIntent:Landroid/content/Intent;
:sswitch_1
new-instance v4, Landroid/content/Intent;
const-string v5, "android.media.action.STILL_IMAGE_CAMERA"
invoke-direct {v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
invoke-direct {p0, v4}, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->launchActivity(Landroid/content/Intent;)V
.line 334
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->pokeWakelock()V
goto :goto_0
.line 339
:sswitch_2
new-instance v2, Landroid/content/Intent;
const-string v4, "android.intent.action.MAIN"
invoke-direct {v2, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 340
.local v2, phoneIntent:Landroid/content/Intent;
const-string v4, "com.android.contacts"
const-string v5, "com.android.contacts.activities.DialtactsActivity"
invoke-virtual {v2, v4, v5}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 341
invoke-virtual {v2, v6}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
.line 342
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1300(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
move-result-object v4
invoke-virtual {v4, v2}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
.line 343
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
goto :goto_0
.line 348
.end local v2 #phoneIntent:Landroid/content/Intent;
:sswitch_3
new-instance v1, Landroid/content/Intent;
const-string v4, "android.intent.action.MAIN"
invoke-direct {v1, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 349
.local v1, mmsIntent:Landroid/content/Intent;
const-string v4, "com.android.mms"
const-string v5, "com.android.mms.ui.ConversationList"
invoke-virtual {v1, v4, v5}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 350
invoke-virtual {v1, v6}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
.line 351
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1400(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
move-result-object v4
invoke-virtual {v4, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
.line 352
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
goto :goto_0
.line 357
.end local v1 #mmsIntent:Landroid/content/Intent;
:sswitch_4
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$500(Lcom/android/internal/policy/impl/LockScreen;)V
.line 358
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->pokeWakelock()V
goto/16 :goto_0
.line 364
:sswitch_5
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
goto/16 :goto_0
.line 321
:sswitch_data_0
.sparse-switch
0x1080294 -> :sswitch_0
0x10802dd -> :sswitch_1
0x10802f6 -> :sswitch_4
0x10802fe -> :sswitch_5
0x1080301 -> :sswitch_5
0x1080604 -> :sswitch_2
0x1080607 -> :sswitch_3
.end sparse-switch
.end method
Replace the values you wrote down back here:
Code:
0x1080294 -> :sswitch_0
0x10802dd -> :sswitch_1
0x10802f6 -> :sswitch_4
0x10802fe -> :sswitch_5
0x1080301 -> :sswitch_5
0x1080604 -> :sswitch_2
0x1080607 -> :sswitch_3
Recompile and you're good to go!
Enjoy and happy editing!
reserved
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Make this into a flashable zip please?
onasri15 said:
Make this into a flashable zip please?
Click to expand...
Click to collapse
lazy people are lazy
http://forum.xda-developers.com/showthread.php?t=1794061
atl4ntis said:
lazy people are lazy
http://forum.xda-developers.com/showthread.php?t=1794061
Click to expand...
Click to collapse
I am curious those flash-able frameworks are only if u have STOCK and then they will add only that feature only. So if I am running another MOD I cannot flash those mods because they will overwrite the framework file and maybe change something else?
Dude. This mod is supposed to be in the Themes and Apps section, is not here. This is an Android Development section.
kalinusa said:
I am curious those flash-able frameworks are only if u have STOCK and then they will add only that feature only. So if I am running another MOD I cannot flash those mods because they will overwrite the framework file and maybe change something else?
Click to expand...
Click to collapse
this thread isn't about flashable stuff so please refrain from asking anything but editing coding stuff.
as for you question, of course if you got any other mods this one "MAY" break it, depends from the files involved in the mods. Do a nand backup and try yourself or get your modded files and edit them accordingly to this howto.
DaXmax said:
Dude. This mod is supposed to be in the Themes and Apps section, is not here. This is an Android Development section.
Click to expand...
Click to collapse
DUDE i see code and stuff here, i don't see why this doesn't belong to dev section. It's a ****ing howto. No themes or mods are published here.
This deserve more then any make -j1 otapackage + busybox stuff.
This won't work on CM10 right because the framework-res apk will probably be different than stock?
onasri15 said:
This won't work on CM10 right because the framework-res apk will probably be different than stock?
Click to expand...
Click to collapse
framework isn't an issue since you are just adding things..
android.policy could be a problem... if you know a bit about smali you could handle it.
Anyway the best way is to try.
Didn't cm10 already have a quad lockscreen btw?
im almost done but i dont know how to do this
"Disassemble your android.policy.jar"
mixtapes08 said:
im almost done but i dont know how to do this
"Disassemble your android.policy.jar"
Click to expand...
Click to collapse
use smali/baksmali or aapt/apktool
edit:typo
atl4ntis said:
use smali/baksmali or aapt/apktool
edit:typo
Click to expand...
Click to collapse
I didn't see this one but I've done it using my own self method lol and I got it on j belly 0.1.4 thank you so much
Sent from my Nexus S™
atl4ntis said:
This howto will teach you how to add a quad lockscreen with phone and messaging to any jb rom in 2 ways:
...
Enjoy and happy editing!
Click to expand...
Click to collapse
atl4ntis thanks for your explanation!
i have some problem whit my quad lockscreen! When i start a services on setting -> accessibility (as example talkback or iphone notification application services or an app that required his services activated!)
when i tap the center of screen to unlock the phone.. it reboot!
where i can look into the code for revolve this annoying problem?
thanks!
impazzito said:
atl4ntis thanks for your explanation!
i have some problem whit my quad lockscreen! When i start a services on setting -> accessibility (as example talkback or iphone notification application services or an app that required his services activated!)
when i tap the center of screen to unlock the phone.. it reboot!
where i can look into the code for revolve this annoying problem?
thanks!
Click to expand...
Click to collapse
+1 here. Do you have a solution?
reference.phone said:
+1 here. Do you have a solution?
Click to expand...
Click to collapse
do you have same problem?
i don't have this issue cos i'm not using the accessibiity service but i think the issue is here in:
/base/com/android/internal/widget/multiwaveview/GlobalPadView.java
Code:
private String getTargetDescription(int index) {
if (mTargetDescriptions == null || mTargetDescriptions.isEmpty()) {
mTargetDescriptions = loadDescriptions(mTargetDescriptionsResourceId);
if (mTargetDrawables.size() != mTargetDescriptions.size()) {
Log.w(TAG, "The number of target drawables must be"
+ " equal to the number of target descriptions.");
return null;
}
}
return mTargetDescriptions.get(index);
}
private String getDirectionDescription(int index) {
if (mDirectionDescriptions == null || mDirectionDescriptions.isEmpty()) {
mDirectionDescriptions = loadDescriptions(mDirectionDescriptionsResourceId);
if (mTargetDrawables.size() != mDirectionDescriptions.size()) {
Log.w(TAG, "The number of target drawables must be"
+ " equal to the number of direction descriptions.");
return null;
}
}
return mDirectionDescriptions.get(index);
}
specifically in the return mTargetDescriptions.get(index); and return mDirectionDescriptions.get(index);.
This should fix it:
Code:
- return mDirectionDescriptions.get(index);
+ try {
+ String directionZ = mDirectionDescriptions.get(index);
+ return directionZ;
+ } catch (Exception e) {
+ return "";
+ }
Code:
- return mTargetDescriptions.get(index);
+ try {
+ String targetZ = mTargetDescriptions.get(index);
+ } catch (Exception e) {
+ return targetZ;
+ }
Didn't try it and not sure when i can add the smali part, but it involves editing a new file, framework.jar.
I'm quite busy atm, going holiday tomorrow.
atl4ntis said:
i don't have this issue cos i'm not using the accessibiity service but i think the issue is here in:
/base/com/android/internal/widget/multiwaveview/GlobalPadView.java
Code:
private String getTargetDescription(int index) {
if (mTargetDescriptions == null || mTargetDescriptions.isEmpty()) {
mTargetDescriptions = loadDescriptions(mTargetDescriptionsResourceId);
if (mTargetDrawables.size() != mTargetDescriptions.size()) {
Log.w(TAG, "The number of target drawables must be"
+ " equal to the number of target descriptions.");
return null;
}
}
return mTargetDescriptions.get(index);
}
private String getDirectionDescription(int index) {
if (mDirectionDescriptions == null || mDirectionDescriptions.isEmpty()) {
mDirectionDescriptions = loadDescriptions(mDirectionDescriptionsResourceId);
if (mTargetDrawables.size() != mDirectionDescriptions.size()) {
Log.w(TAG, "The number of target drawables must be"
+ " equal to the number of direction descriptions.");
return null;
}
}
return mDirectionDescriptions.get(index);
}
specifically in the return mTargetDescriptions.get(index); and return mDirectionDescriptions.get(index);.
This should fix it:
Code:
- return mDirectionDescriptions.get(index);
+ try {
+ String directionZ = mDirectionDescriptions.get(index);
+ return directionZ;
+ } catch (Exception e) {
+ return "";
+ }
Code:
- return mTargetDescriptions.get(index);
+ try {
+ String targetZ = mTargetDescriptions.get(index);
+ } catch (Exception e) {
+ return targetZ;
+ }
Didn't try it and not sure when i can add the smali part, but it involves editing a new file, framework.jar.
I'm quite busy atm, going holiday tomorrow.
Click to expand...
Click to collapse
Im patiently waiting for your revisions sir
Sent from my Nexus S™
mixtapes08 said:
Im patiently waiting for your revisions sir
Sent from my Nexus S™
Click to expand...
Click to collapse
mixtapes08 may you make an alpha mod with this changes end give it to me so, if works, you will publish for the nex release of jelly belly?
thanks a lot!
impazzito said:
mixtapes08 may you make an alpha mod with this changes end give it to me so, if works, you will publish for the nex release of jelly belly?
thanks a lot!
Click to expand...
Click to collapse
That codes is for compiling from sources. Compiling from smali is different.
Sent from my Nexus S™

[MOD][DEV][SMALI] Transparent Navbar for 4.1/4.2/4.3

MOD/DEV/SMALI TRANSPARENT NAVBAR
Hello guys , I want to share how to modded your navbar to have transparent background
Credit & Thanks to : Senior Member legend evilisto
ok lets go to Guide:
first of all need some requirement for this MOD-GUIDE
REQUIREMENT:
- BRAIN
- Patient
- experience
- Know how to decompile/recompiling Apk file
- Know how to decompile/recompiling jar Apk file
- notepad++
- Tool for decompiling, : apkmanager/apktool/Virtous/apkmultitools/ or else
How to enable Navbar
go here : http://forum.xda-developers.com/showthread.php?t=1364757
GUIDE NOW FIXED !!
It also work to, CM10 / CM10.1/ JB 4.1.1/ JB 4.1.2 / JB 4.2.1/JB 4.2.2/ JB 4.3
CREDIT & THANKS TO :
- Senior Member @evilisto
- Recognized themer @rodman01
- @mulbyungjahri
- @BOND1987
1. DECOMPILE android.policy.jar
\com\android\internal\policy\impl\ PhoneWindowManager.smali
find this method :
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
DELETE the RED CODE
AND REPLACE it with the BLUE CODE
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
.registers 3
.parameter "systemRect"
.prologue
.line 3057
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I
iput v0, p1, Landroid/graphics/Rect;->left:I
.line 3058
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I
iput v0, p1, Landroid/graphics/Rect;->top:I
.line 3059
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I
iput v0, p1, Landroid/graphics/Rect;->right:I
.line 3060
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I
.line 3061
[COLOR="Red"]iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
.line 3063
:goto_1a
return v0
.line 3062
:cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_26
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
goto :goto_1a
.line 3063
:cond_26
const/4 v0, 0x0
goto :goto_1a
.end method[/COLOR]
and replace with this BLUE CODE
Code:
[COLOR="Blue"]const/4 v0, 0x0
return v0
.end method[/COLOR]
DONE & COMPILE
android.policy.jar code is the same like in my Transparent status bar guide : http://forum.xda-developers.com/showpost.php?p=40278450&postcount=2
2. DECOMPILE SystemUI.apk
go to :
com/android/systemui/statusbar/phone/PhoneStatusBar.smali
Delete the RED CODE
and Add the BLUE CODE
- find this method :
Code:
.method private getNavigationBarLayoutParams()Landroid/view/WindowManager$LayoutParams;
.locals 6
.prologue
const/4 v1, -0x1
.line 943
new-instance v0, Landroid/view/WindowManager$LayoutParams;
const/16 v3, 0x7e3
const v4, 0x840068
[COLOR="Blue"]const/4 v5, -0x3[/COLOR]
move v2, v1
[COLOR="Red"]move v5, v1[/COLOR]
invoke-direct/range {v0 .. v5}, Landroid/view/WindowManager$LayoutParams;-><init>(IIIII)V
.line 954
invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z
move-result v1
if-eqz v1, :cond_0
.line 955
iget v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
const/high16 v2, 0x100
or-int/2addr v1, v2
iput v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
.line 958
:cond_0
const-string v1, "NavigationBar"
invoke-virtual {v0, v1}, Landroid/view/WindowManager$LayoutParams;->setTitle(Ljava/lang/CharSequence;)V
.line 959
const/4 v1, 0x0
iput v1, v0, Landroid/view/WindowManager$LayoutParams;->windowAnimations:I
.line 960
return-object v0
.end method
- NEXT :
Edit the BLUE CODE
go to :
SystemUI.apk\res\layout\navigation_bar.xml
Code:
<com.android.systemui.statusbar.phone.NavigationBarView [COLOR="Blue"]android:background="#88000000"[/COLOR] android:layout_width="fill_parent" android:layout_height="fill_parent"
SystemUI.apk\res\layout-sw600dp\navigation_bar.xml
Code:
<com.android.systemui.statusbar.phone.NavigationBarView [COLOR="Blue"]android:background="#88000000"[/COLOR] android:layout_width="fill_parent" android:layout_height="fill_parent"
SystemUI.apk\res\values\drawables.xml
Code:
<item type="drawable" name="system_bar_background">[COLOR="Blue"]#88000000[/COLOR]</item>
<item type="drawable" name="notification_icon_area_smoke">[COLOR="Blue"]#88000000[/COLOR]</item>
DONE AND COMPILE
THIS MOD NOW ONLY WORKING FINE WITH APEX LAUNCHER AND NOVA LAUNCHER., NOT TESTED YET ON OTHER LAUNCHER
THAT'S IT AND ENJOY :good::laugh:
SCREENSHOTS
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
[MOD][CM10.1] GALAXY WONDER - GT-I8150 Transparent Navbar & Transparent Status Bar for CM10.1 Alpha -7
reserved 2
Updated :
The mod Working fine with Apex launcher & Nova launcher
hey bro, i fllow your Guide, and you can see my attachmens. I don't know why!
chutanh7 said:
hey bro, i fllow your Guide, and you can see my attachmens. I don't know why!
Click to expand...
Click to collapse
Have you merge the source code for trebuchet ?
Done that, push Trebuchet. and
Do clear data Trebuchet, and don't change/check list any option of Trebuchet in Settings-Launcher-
Sent from my GT-I8150 using xda app-developers app
ok bro, i got it. [email protected]@
Thank you :good:
CM10.1 20130716 NIGHTLY on Nexus 4
Hey adi,
Would this work with cm10 too? I cant right now take look to code, but its different in cm10 than cm10.1 , right?
peetu20 said:
Hey adi,
Would this work with cm10 too? I cant right now take look to code, but its different in cm10 than cm10.1 , right?
Click to expand...
Click to collapse
Try it petu and report here
For CM10 (4.1) Use same code/step for android.policy.jar and SystemUI.apk , but skip Trebuchet.apk step and don't use the launcher, try it with Nova or Apex
Sent from my GT-I8150 using xda app-developers app
I will
Just a thought could these edits be applied to work on a tablet ui..
lacoursiere18 said:
Just a thought could these edits be applied to work on a tablet ui..
Click to expand...
Click to collapse
Tablet UI is not transparent navbar.
But it is transparent system_bar.xml.
Follow the android.policy.jar code.
Next go to
Res/layout/system_bar.xml
Or
Res/values/drawables.xml
Find system_bar_background.
Make it to #00000000
Sent from my GT-I8150 using xda app-developers app
Very nice Thank you for the details I will try and report back my results!
Sent from my SCH-I605 using xda app-developers app
my classex.dex in android policy jar sounds different, ie the method is
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
.registers 3
.parameter "systemRect"
.prologue
.line 3046
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I
iput v0, p1, Landroid/graphics/Rect;->left:I
.line 3047
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I
iput v0, p1, Landroid/graphics/Rect;->top:I
.line 3048
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I
iput v0, p1, Landroid/graphics/Rect;->right:I
.line 3049
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I
.line 3050
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
.line 3052
:goto_1a
return v0
.line 3051
:cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_26
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
goto :goto_1a
.line 3052
:cond_26
const/4 v0, 0x0
goto :goto_1a
.end method
can I safely substitute it with yours, even if line numbers are different?
(cm 10.1.2 for nook hd+)
stegg said:
my classex.dex in android policy jar sounds different, ie the method is
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
.registers 3
.parameter "systemRect"
.prologue
.line 3046
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I
iput v0, p1, Landroid/graphics/Rect;->left:I
.line 3047
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I
iput v0, p1, Landroid/graphics/Rect;->top:I
.line 3048
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I
iput v0, p1, Landroid/graphics/Rect;->right:I
.line 3049
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I
.line 3050
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
.line 3052
:goto_1a
return v0
.line 3051
:cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_26
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
goto :goto_1a
.line 3052
:cond_26
const/4 v0, 0x0
goto :goto_1a
.end method
can I safely substitute it with yours, even if line numbers are different?
(cm 10.1.2 for nook hd+)
Click to expand...
Click to collapse
Yes, tested on GalNex 10.1.2
Link : http://forum.xda-developers.com/showthread.php?t=2371216
Sent from my GT-I8150 using xda app-developers app
thank you for the quick answer!
I am modifiyng a tablet UI (better, the default phablet UI of CM 10.1)
in this post, you mean I should make #1 of Original Post, but completely ignore #2 of OP as there's no PhoneStatusBar.smali file?
Adi Aisiteru Reborn said:
Tablet UI is not transparent navbar.
But it is transparent system_bar.xml.
Follow the android.policy.jar code.
Next go to
Res/layout/system_bar.xml
Or
Res/values/drawables.xml
Find system_bar_background.
Make it to #00000000
Sent from my GT-I8150 using xda app-developers app
Click to expand...
Click to collapse
sorry for my noobness!
stegg said:
thank you for the quick answer!
I am modifiyng a tablet UI (better, the default phablet UI of CM 10.1)
in this post, you mean I should make #1 of Original Post, but completely ignore #2 of OP as there's no PhoneStatusBar.smali file?
sorry for my noobness!
Click to expand...
Click to collapse
for transparent System bar/Tablet Status Bar )
no need PhoneStatusBar.smali editing.
just do like you quoted above
Adi Aisiteru Reborn said:
for transparent System bar/Tablet Status Bar )
no need PhoneStatusBar.smali editing.
just do like you quoted above
Click to expand...
Click to collapse
When I do this I edit the drawables.xml to #000000 in system_bar and when i push the new systemui i get systemui fc would anything else have to be modified..
EDIT: BTW i am on tw 4.1.2 but my android policy jar matches yours pretty much to the exact.. Would that make that much a difference
lacoursiere18 said:
When I do this I edit the drawables.xml to #000000 in system_bar and when i push the new systemui i get systemui fc would anything else have to be modified..
Click to expand...
Click to collapse
it should #00000000 ( 8 digits )
not #000000 ( 6 digits ) <- that's why you got fcs

[TUTORIAL][JB/KK] how to add reboot , recovery and bootloader options in Power menu

So lets Start
Required
1-apktool
2-notepad++
3-some brains
REBOOT OPTIONS KK 4.4.2
USE THE RESOURCES ATTACHED BELOW (IF U HAVE ANY PROBLEMS DE/RECOMPILING ANDROID.POLICY.JAR USE THE smali.jar and backsmali.jar attached in the below resources)
framework-res.apk
-----------------
1 - Add to strings.xml:
Code:
<string name="reboot">@string/factorytest_reboot</string>
<string name="reboot_normal">@string/factorytest_reboot</string>
<string name="reboot_recovery">Recovery</string>
<string name="reboot_bootloader">Bootloader</string>
2 - Add to arrays.xml:
Code:
<string-array name="reboot_options">
<item>@string/reboot_normal</item>
<item>@string/reboot_recovery</item>
<item>@string/reboot_bootloader</item>
</string-array>
<string-array name="reboot_actions">
<item>now</item>
<item>recovery</item>
<item>bootloader</item>
</string-array>
3 - Add under \res\drawable-xxhdpi\ folder:
ic_lock_reboot.png
4 - Compile framework-res.apk
android.policy.jar
------------------
1 - Edit:
\com\android\internal\policy\impl\GlobalActions.smali
...LOOK FOR...
Code:
.line 252
.local v9, "quickbootEnabled":Z
:goto_3d
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x10400cb
invoke-direct {v1, p0, v2, v3, v9}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;IIZ)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[COLOR="Red"]
.line 282
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$12;
const v2, 0x108094c ----- HEX ID OF ic_lock_reboot.png ( make sure to change the hex id comparing ur Public xml )
const v3, 0x10407e8 ----- HEX ID OF reboot STRING ( make sure to change the hex id comparing ur Public xml )
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$12;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/COLOR]
.line 283
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
2 - Add these three new files:
GlobalActions$12$1.smali
GlobalActions$12$2.smali
GlobalActions$12.smali
3 - Done !!
FOR JB 4.3​
Before u decompile anything see this Guide by @erorcun for how to compile a JB framework without bootloop..
http://forum.xda-developers.com/showthread.php?t=2321207
STEP-1
Decompile Framework-res.apk
goto to res/vlaues/arrays.xml
and add these lines at the end
Code:
<string-array name="reboot_options">
<item>@string/reboot_normal</item>
<item>@string/reboot_recovery</item>
<item>@string/reboot_bootloader</item>
</string-array>
<string-array name="reboot_actions">
<item>now</item>
<item>recovery</item>
<item>bootloader</item>
</string-array>
now goto res/values/strings
and add these lines at the end
Code:
<string name="reboot">Reboot</string>
<string name="reboot_normal">Reboot</string>
<string name="reboot_recovery">Recovery</string>
<string name="reboot_bootloader">Bootloader</string>
goto add the ic_lock_reboot.png which i have i provided in the resources attached below this post to drawablw-hdpi folder
so before compiling the framework-res.apk follow erorcun's guide to properly recompile framework-res.apk
once recompile is done ....decompile again to get the HEX ID's
STEP-2
decompile android.policy.jar
goto classout\com\android\internal\policy\impl
and add the 3 smali's files which i provided in the resources attached below
Now option classout\com\android\internal\policy\impl\GlobalActions.smali
and find these lines and add the red marked lines between them
Code:
.line 235
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x10400fa
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[COLOR="Red"] .line 213
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x1080827
const v4, 0x104060b
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/COLOR]
.line 260
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
now we need to assign the Hex id's as per ur Public.xml
NOTE: the hex id's might be different from mine and yours so be careful while comparing
new as per the above changes in GlobalActions.xml
assign the id's as below
<public type="drawable" name="ic_lock_reboot" id="0x01080827" />
Code:
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x[COLOR="red"]1080827[/COLOR]
<public type="string" name="reboot" id="0x0104060b" />
Code:
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x1080827
const v4, 0x[COLOR="red"]104060b[/COLOR]
Now option up classout\com\android\internal\policy\impl\GlobalActions$11.smali
find and replace the following
@line 70
<public type="string" name="reboot" id="0x0104060b" />
Code:
const v3, 0x[COLOR="red"]104060b[/COLOR]
@line 90
<public type="array" name="reboot_options" id="0x0107003b" />
Code:
const v3, 0x[COLOR="red"]107003b[/COLOR]
@line 105
<public type="string" name="ok" id="0x0104000a" />
Code:
const v2, 0x[COLOR="red"]104000a[/COLOR]
@line 147
<public type="bool" name="config_sf_slowBlur" id="0x0111000b" />
Code:
const v3, 0x[COLOR="red"]111000b[/COLOR]
now open up classout\com\android\internal\policy\impl\GlobalActions$11$2.smali
@line 59
<public type="array" name="reboot_actions" id="0x0107003c" />
Code:
const v2, 0x[COLOR="red"]107003c[/COLOR]
save it and recompile android.policy.jar
now push all the files into ut phone...will have the new Advanced reboot options
CREDITS
@serajr --- my smali teacher
@auras76 -- for testing this method will work or not​
reserved
need this to
Congrats...
Anytime bro...
Inquiry...
I've tried and followed this instructions to a reboot to recovery.
I was able to recompile it after i've added the strings in strings.xml and the hdpi and xhdpi, However, when I decompiled it again to get the hex id it is giving me an error would you mind telling me what i've missed out?
Here is the log.
Decompiling "framework-res.apk"
With Tickle My Android
(tinyurl.com\ticklemyandroid)
----------------
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Francis\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=sharedUserId, value=0x00000020
Exception in thread "main" java.lang.NullPointerException
at java.io.Writer.write(Unknown Source)
at brut.androlib.res.util.ExtMXSerializer.writeAttrib uteValue(ExtMXSerializer.java:38)
at org.xmlpull.mxp1_serializer.MXSerializer.attribute (MXSerializer.java:673)
at org.xmlpull.v1.wrapper.classic.XmlSerializerDelega te.attribute(XmlSerializerDelegate.java:106)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializer Wrapper.writeStartTag(StaticXmlSerializerWrapper.j ava:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializer Wrapper.event(StaticXmlSerializerWrapper.java:211)
at brut.androlib.res.decoder.XmlPullStreamDecoder$1.e vent(XmlPullStreamDecoder.java:80)
at brut.androlib.res.decoder.XmlPullStreamDecoder.dec ode(XmlPullStreamDecoder.java:130)
at brut.androlib.res.decoder.XmlPullStreamDecoder.dec odeManifest(XmlPullStreamDecoder.java:144)
at brut.androlib.res.decoder.ResFileDecoder.decodeMan ifest(ResFileDecoder.java:131)
at brut.androlib.res.AndrolibResources.decode(Androli bResources.java:218)
at brut.androlib.Androlib.decodeResourcesFull(Androli b.java:115)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:11 4)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
----------------
Decompile Not Successful!
Thank you for your time. =)
Pangkoy08 said:
I've tried and followed this instructions to a reboot to recovery.
I was able to recompile it after i've added the strings in strings.xml and the hdpi and xhdpi, However, when I decompiled it again to get the hex id it is giving me an error would you mind telling me what i've missed out?
Here is the log.
Decompiling "framework-res.apk"
With Tickle My Android
(tinyurl.com\ticklemyandroid)
----------------
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Francis\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=sharedUserId, value=0x00000020
Exception in thread "main" java.lang.NullPointerException
at java.io.Writer.write(Unknown Source)
at brut.androlib.res.util.ExtMXSerializer.writeAttrib uteValue(ExtMXSerializer.java:38)
at org.xmlpull.mxp1_serializer.MXSerializer.attribute (MXSerializer.java:673)
at org.xmlpull.v1.wrapper.classic.XmlSerializerDelega te.attribute(XmlSerializerDelegate.java:106)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializer Wrapper.writeStartTag(StaticXmlSerializerWrapper.j ava:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializer Wrapper.event(StaticXmlSerializerWrapper.java:211)
at brut.androlib.res.decoder.XmlPullStreamDecoder$1.e vent(XmlPullStreamDecoder.java:80)
at brut.androlib.res.decoder.XmlPullStreamDecoder.dec ode(XmlPullStreamDecoder.java:130)
at brut.androlib.res.decoder.XmlPullStreamDecoder.dec odeManifest(XmlPullStreamDecoder.java:144)
at brut.androlib.res.decoder.ResFileDecoder.decodeMan ifest(ResFileDecoder.java:131)
at brut.androlib.res.AndrolibResources.decode(Androli bResources.java:218)
at brut.androlib.Androlib.decodeResourcesFull(Androli b.java:115)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:11 4)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
----------------
Decompile Not Successful!
Thank you for your time. =)
Click to expand...
Click to collapse
as i mentioned u need to recompile ur framework using erorcun's guide...the link is in OP.....that y u getting this error
Code:
.line 235
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x10400fa
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
cant find dat brov..... please help!!!
whalesplaho said:
Code:
.line 235
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x10400fa
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
cant find dat brov..... please help!!!
Click to expand...
Click to collapse
u need to add this line to GlobalActions.smali
EDIT: follow the tut properly....below this line u need to add the RED lines showed in OP
Nice guide.. Thanks.
Would the 'bootloader' option reboot into fastboot then?
Pangkoy08 said:
I've tried and followed this instructions to a reboot to recovery.
I was able to recompile it after i've added the strings in strings.xml and the hdpi and xhdpi, However, when I decompiled it again to get the hex id it is giving me an error would you mind telling me what i've missed out?
Here is the log.
Decompiling "framework-res.apk"
With Tickle My Android
(tinyurl.com\ticklemyandroid)
----------------
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Francis\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=sharedUserId, value=0x00000020
Exception in thread "main" java.lang.NullPointerException
at java.io.Writer.write(Unknown Source)
at brut.androlib.res.util.ExtMXSerializer.writeAttrib uteValue(ExtMXSerializer.java:38)
at org.xmlpull.mxp1_serializer.MXSerializer.attribute (MXSerializer.java:673)
at org.xmlpull.v1.wrapper.classic.XmlSerializerDelega te.attribute(XmlSerializerDelegate.java:106)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializer Wrapper.writeStartTag(StaticXmlSerializerWrapper.j ava:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializer Wrapper.event(StaticXmlSerializerWrapper.java:211)
at brut.androlib.res.decoder.XmlPullStreamDecoder$1.e vent(XmlPullStreamDecoder.java:80)
at brut.androlib.res.decoder.XmlPullStreamDecoder.dec ode(XmlPullStreamDecoder.java:130)
at brut.androlib.res.decoder.XmlPullStreamDecoder.dec odeManifest(XmlPullStreamDecoder.java:144)
at brut.androlib.res.decoder.ResFileDecoder.decodeMan ifest(ResFileDecoder.java:131)
at brut.androlib.res.AndrolibResources.decode(Androli bResources.java:218)
at brut.androlib.Androlib.decodeResourcesFull(Androli b.java:115)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:11 4)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
----------------
Decompile Not Successful!
Thank you for your time. =)
Click to expand...
Click to collapse
Wrong frameworks installed i guess..
sandy7 said:
u need to add this line to GlobalActions.smali
EDIT: follow the tut properly....below this line u need to add the RED lines showed in OP
Click to expand...
Click to collapse
i dnt know where to place it since i cant tha above line...... should i add it anywhere?
what about here?
Code:
.line 211
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$2;
const v3, 0x1080030
const v4, 0x104018e
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x7f020000
const v4, 0x7f030000
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 236
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 239
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$3;
const v3, 0x10805e8
const v4, 0x10400c1
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 263
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$Action;
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
whalesplaho said:
i dnt know where to place it since i cant tha above line...... should i add it anywhere?
what about here?
Click to expand...
Click to collapse
as per ur codes the changes will be in RED (note if u ahve my old reboot mod plz start from a fresh android.policy.jar)
Code:
.line 211
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$2;
const v3, 0x1080030
const v4, 0x104018e
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[COLOR="Red"].line 213
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x1080827
const v4, 0x104060b
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/COLOR]
.line 239
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$3;
const v3, 0x10805e8
const v4, 0x10400c1
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 263
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$Action;
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
NuriJ said:
Nice guide.. Thanks.
Would the 'bootloader' option reboot into fastboot then?
Click to expand...
Click to collapse
yes i does i think...i never tested it my self....lol
sandy7 said:
as per ur codes the changes will be in RED (note if u ahve my old reboot mod plz start from a fresh android.policy.jar)
Code:
.line 211
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$2;
const v3, 0x1080030
const v4, 0x104018e
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[COLOR="Red"].line 213
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x1080827
const v4, 0x104060b
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/COLOR]
.line 239
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$3;
const v3, 0x10805e8
const v4, 0x10400c1
move-object/from16 v0, p0
invoke-direct {v2, v0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 263
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$Action;
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
Click to expand...
Click to collapse
starting afresh brov.... thanks!!!
ll give it a shot & drop feedback.:good::good:
sandy7 said:
yes i does i think...i never tested it my self....lol
Click to expand...
Click to collapse
reboot tha phone when reboot to bootloader select.....
Sandy i think in tha tut, we only edit for reboot now & recovery.... none for bootloader!
but i notice i dnt have airplane mode in power options anymore!
---------- Post added at 11:51 AM ---------- Previous post was at 11:26 AM ----------
thanks for tut brov..... works fine!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
whalesplaho said:
reboot tha phone when reboot to bootloader select.....
Sandy i think in tha tut, we only edit for reboot now & recovery.... none for bootloader!
but i notice i dnt have airplane mode in power options anymore!
---------- Post added at 11:51 AM ---------- Previous post was at 11:26 AM ----------
thanks for tut brov..... works fine!
Click to expand...
Click to collapse
u did something wrong...if any old codes are there it happens...try with a fresh framework-res.apk and android.policy.jar
sandy7 said:
u did something wrong...if any old codes are there it happens...try with a fresh framework-res.apk and android.policy.jar
Click to expand...
Click to collapse
i did it with a fresh android_policy.jar but will retry again.
whalesplaho said:
i did it with a fresh android_policy.jar but will retry again.
Click to expand...
Click to collapse
take a fresh framework-res.apk also
sandy7 said:
take a fresh framework-res.apk also
Click to expand...
Click to collapse
okies brov.... will give it a shot now!
thanks
Whoa!!!! got it working buddy... yhu removed .line 236 from tha code i sent yhu dats why, dat line is for Airplane mode.
Code:
[color=red]
.line 236
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v2, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/color]
hi sandy
Recovey mode didn't work on my TX 4.3. please check

[Guide How-to] KitKat 4.4.2/Android L Music Control - Volume Music Skip and More

[Guide How-to] KitKat 4.4.2/Android L Music Control - Volume Music Skip
UPDATED FOR ANDROID L
This guide requires knowledge of decompiling and compiling apk and smali files.
It is only a guide.
I do not take requests. If you want this mod for your rom, get with a dev with the knowledge to get it done.
I have attached android.policy files for diffing in case you get stuck on a section.
SecSettings.apk
In SecSettings.apk we setup the Music Control menu items & toggles.
(This edit does not work on Android L)
*** Add the two new files from the SecSettings_new_files.zip attached at the bottom of this post.
res/values/strings.xml edit:
Add new lines
Code:
<string name="volbtn_toggle_title">Music Control</string>
<string name="volbtn_timeout_title">Button Delay</string>
<string name="volbtn_timeout_summary">%s</string>
<string name="volbtn_vol_up_title">Volume Up Action</string>
<string name="volbtn_vol_up_summary">%s</string>
<string name="volbtn_vol_down_title">Volume Down Action</string>
<string name="volbtn_vol_down_summary">%s</string>
res/values/arrays.xml edit:
Add new lines
Code:
<string-array name="volbtn_action_entries">
<item>Next</item>
<item>Pause</item>
<item>Play</item>
<item>Play/Pause</item>
<item>Previous</item>
<item>Stop</item>
</string-array>
<string-array name="volbtn_action_values">
<item>87</item>
<item>127</item>
<item>126</item>
<item>85</item>
<item>88</item>
<item>86</item>
</string-array>
<string-array name="volbtn_timeout_entries">
<item>100ms</item>
<item>150ms</item>
<item>200ms</item>
<item>250ms</item>
<item>300ms</item>
<item>350ms</item>
<item>400ms</item>
<item>450ms</item>
<item>500ms</item>
</string-array>
<string-array name="volbtn_timeout_values">
<item>100</item>
<item>150</item>
<item>200</item>
<item>250</item>
<item>300</item>
<item>350</item>
<item>400</item>
<item>450</item>
<item>500</item>
</string-array>
res/xml/sound_settings.xml edit:
Add new line where you want the menu item to appear in the Sound settings menu.
Code:
<SwitchPreferenceScreen android:title="@string/volbtn_toggle_title" android:key="volbtn_music_controls" android:fragment="com.android.settings.VolBtnSettings" />
Smali Edit:
smali/com/android/settings/SoundSettings.smali
Add new line in BLUE
Code:
.field private mVibrateWhenRinging:Landroid/preference/CheckBoxPreference;
[COLOR="Blue"].field private mVolBtnMusicCtrl:Landroid/preference/SwitchPreferenceScreen;
[/COLOR]
.field private mVolume:Lcom/android/settings/RingerVolumePreference;
Increase locals value by 1 indicated in GREEN
Note:
When the change to .locals is increased by one, both of the V7 values in the new lines should be one LESS than the .locals value.
(New .locals value in our example is 8. 8-1=7, so we use V7)
Add new lines indicated in BLUE
Code:
.method private updateState(Z)V
[COLOR="Green"].locals 8
[/COLOR]
const/4 v2, 0x1
const/4 v4, 0x0
invoke-virtual {p0}, Landroid/app/Fragment;->getActivity()Landroid/app/Activity;
move-result-object v0
if-nez v0, :cond_1
:cond_0
:goto_0
return-void
:cond_1
iget-object v0, p0, Lcom/android/settings/SoundSettings;->mAudioManager:Landroid/media/AudioManager;
invoke-virtual {v0}, Landroid/media/AudioManager;->getRingerMode()I
move-result v6
[COLOR="Blue"] iget-object v1, p0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/SwitchPreferenceScreen;
if-eqz v1, :cond_td
iget-object v3, p0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/SwitchPreferenceScreen;
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v7, "volbtn_music_controls"
invoke-static {v1, v7, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-eqz v1, :cond_vol
move v1, v2
:goto_vol
invoke-virtual {v3, v1}, Landroid/preference/SwitchPreferenceScreen;->setChecked(Z)V
:cond_td
[/COLOR] const-string v0, "CTC"
New lines at the end of the same method.
Add lines indicated in BLUE
Code:
.method private updateState(Z)V
.
.
.
goto/16 :goto_1
[COLOR="Blue"] :cond_vol
move v1, v4
goto/16 :goto_vol
[/COLOR].end method
Search for the string "phone_vibration" in SoundSettings.smali and add the new lines indicated in BLUE right above it.
Code:
[COLOR="Blue"]const-string v32, "volbtn_music_controls"
move-object/from16 v0, p0
move-object/from16 v1, v32
invoke-virtual {v0, v1}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v32
check-cast v32, Landroid/preference/SwitchPreferenceScreen;
move-object/from16 v0, v32
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/SwitchPreferenceScreen;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/SwitchPreferenceScreen;
move-object/from16 v32, v0
move-object/from16 v0, v32
move-object/from16 v1, p0
invoke-virtual {v0, v1}, Landroid/preference/Preference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[/COLOR]
const-string v32, "phone_vibration"
Add new lines indicated in BLUE
Make sure values v2, v3 & v4 values match surrounding code.
Code:
.method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/Object;)Z
.locals 6
const/4 v0, 0x0
const/4 v1, 0x1
invoke-virtual {p1}, Landroid/preference/Preference;->getKey()Ljava/lang/String;
move-result-object v2
const-string v3, "SoundSettings"
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
const-string v5, "onPreferenceChange : "
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-static {v3, v4}, Landroid/util/secutil/Log;->secV(Ljava/lang/String;Ljava/lang/String;)I
[COLOR="Blue"]const-string v3, "volbtn_music_controls"
invoke-virtual {v3, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_td3
check-cast p2, Ljava/lang/Boolean;
invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z
move-result v3
if-eqz v3, :cond_td4
const/4 v0, 0x1
:goto_td5
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v3, "volbtn_music_controls"
invoke-static {v4, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto :goto_0
:cond_td4
const/4 v0, 0x0
goto :goto_td5
:cond_td3[/COLOR]
const-string v3, "emergency_tone"
We need to change three public value so compile the changed SecSettings.apk, then decompile it. Open res/values/public.xml and search for the string these strings and write down the public values:
"action_bar_switch_padding"
"volbtn_toggle_title"
"volbtn_settings"
Now in the original SecSettings, open the smali file we added
smali/com/android/settings/VolBtnSettings.smali, search for each of the strings and change your public value to match as indicated in BLUE.
Code:
const v4, 0x[COLOR="Blue"]7f0f0045[/COLOR] # type="dimen" name="action_bar_switch_padding"
const v4, 0x[COLOR="Blue"]7f091a29[/COLOR] # type="string" name="volbtn_toggle_title"
const v0, 0x[COLOR="Blue"]7f0700fe[/COLOR] # type="xml" name="volbtn_settings"
That should be it for SecSettings.apk. Compile after making these last value changes and make sure the Music Control menu functions before continuing with android.policy.jar.
android.policy.jar
(also see additional changes for Android L linked at the bottom of this post)
*** Add the two new files from the android.policy.new_files.zip attached at the bottom of this post.
Smali Edits
smali/com/android/internal/policy/impl/PhoneWindowManager.smali
Add new line in BLUE
Code:
.field private mKeyEventInjectionThread:Ljava/lang/Thread;
[COLOR="Blue"].field mIsVolLongPressed:Z
[/COLOR]
.field mKeyboardTapVibePattern:[J
Add new lines in BLUE
Code:
.field mVirtualKeyVibePattern:[J
[COLOR="Blue"].field mVolBtnMusicControls:I
.field mVolBtnTimeout:I
.field mVolBtnVolDown:I
.field mVolBtnVolUp:I
[/COLOR].field private mVolumeDownKeyConsumedByScreenshotChord:Z
.field private mVolumeDownKeyTime:J
.field private mVolumeDownKeyTriggered:Z
[COLOR="Blue"].field final mVolumeDownLongPress:Ljava/lang/Runnable;
[/COLOR]
.field private mVolumeUpKeyConsumedByScreenshotChord:Z
.field private mVolumeUpKeyTime:J
.field private mVolumeUpKeyTriggered:Z
[COLOR="Blue"].field final mVolumeUpLongPress:Ljava/lang/Runnable;
[/COLOR]
.field mWifiDisplayConnected:Z
Add new lines in BLUE near end of method BEFORE the return-void.
Code:
.method public constructor <init>()V
.
.
.
[COLOR="Blue"] new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$MusicNext;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$MusicNext;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$MusicPrev;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$MusicPrev;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
[/COLOR]
return-void
.end method
.method static synthetic access$000(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
Add new methods ABOVE
.method public hasNavigationBar()Z
Code:
.method handleVolumeLongPress(I)V
.locals 4
const/16 v1, 0x18
if-ne p1, v1, :cond_0
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
:goto_0
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnTimeout:I
int-to-long v2, v2
invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
:cond_0
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
goto :goto_0
.end method
.method handleVolumeLongPressAbort()V
.locals 2
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
return-void
.end method
The next section may be a little difficult to find.
Search for the string: "interceptKeyBeforeQueueing: VOLUME key-down while ringing: Silence ringer!", scroll up a few lines and place the new lines indicated in BLUE, right below the :sswitch_1 statement.
Important Note:
(AFTER adding the new section below, come back here)
The v12 value may need to be changed to match surrounding code. The next occurrence in our code is this statement:
Code:
invoke-virtual {v0, v12, v6, v5}, Lcom/android/internal/policy/impl/sec/SamsungPhoneWindowManager;->handleSamsungVolumeControl(IZZ)V
Search for the next occurrence of handleSamsungVolumeControl(IZZ)V and if your second values of v12 & v6 match, then you are good to go. If it is NOT, then the v12 & v6 in the new code below needs to be changed to match that value.
Code:
:sswitch_1
[COLOR="Blue"] move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
if-eqz v0, :cond_td
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
move-result v0
if-eqz v0, :cond_td
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenOnEarly:Z
if-nez v0, :cond_td
if-eqz v6, :cond_td2
move-object/from16 v0, p0
move/from16 v1, v12
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(I)V
const/4 v15, 0x0
goto/16 :goto_0
:cond_td2
move-object/from16 v0, p0
invoke-virtual {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
iget-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolLongPressed:Z
if-nez v1, :cond_td3
move/from16 v1, v12
const/4 v3, 0x3
invoke-virtual {v0, v3, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_td3
const/4 v1, 0x0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolLongPressed:Z
:cond_td
[/COLOR]
if-eqz v6, :cond_19
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getTelephonyService()Lcom/android/internal/telephony/ITelephony;
move-result-object v17
if-eqz v17, :cond_19
:try_start_0
invoke-interface/range {v17 .. v17}, Lcom/android/internal/telephony/ITelephony;->isRinging()Z
move-result v21
if-eqz v21, :cond_19
const-string v21, "WindowManager"
const-string v22, "interceptKeyBeforeQueueing: VOLUME key-down while ringing: Silence ringer!"
invoke-static/range {v21 .. v22}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
invoke-interface/range {v17 .. v17}, Lcom/android/internal/telephony/ITelephony;->silenceRinger()V
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
and-int/lit8 v15, v15, -0x2
Android L version of previous section:
New code is BLUE, make sure the code in GREEN match original
Code:
:sswitch_0
[COLOR="Blue"] move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
if-eqz v0, :cond_td
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
move-result v0
if-eqz v0, :cond_td
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenOnEarly:Z
if-nez v0, :cond_td
if-eqz v5, :cond_td2
move-object/from16 v0, p0
move/from16 v1, v11
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(I)V
const/16 v16, 0x0
goto/16[/COLOR] [COLOR="Green"]:goto_8[/COLOR]
[COLOR="Blue"]:cond_td2
move-object/from16 v0, p0
invoke-virtual {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
iget-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolLongPressed:Z
if-nez v1, :cond_td3
move/from16 v1, v11
const/4 v3, 0x3
invoke-virtual {v0, v3, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_td3
const/4 v1, 0x0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolLongPressed:Z
:cond_td[/COLOR]
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getTelecommService()Landroid/telecom/TelecomManager;
move-result-object v17
if-eqz v17, :cond_19
if-eqz v5, :cond_18
invoke-virtual/range {v17 .. v17}, Landroid/telecom/TelecomManager;->isRinging()Z
move-result v21
if-eqz v21, :cond_18
const-string v21, "WindowManager"
const-string v22, "interceptKeyBeforeQueueing: VOLUME key-down while ringing: Silence ringer!"
invoke-static/range {v21 .. v22}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
invoke-virtual/range {v17 .. v17}, Landroid/telecom/TelecomManager;->silenceRinger()V
and-int/lit8 v16, v16, -0x2
goto/16 [COLOR="Green"]:goto_8[/COLOR]
Add new method indicated in BLUE:
Code:
.method public isMetaKeyEventRequested(Landroid/content/ComponentName;)Z
.locals 1
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemKeyManager:Lcom/android/internal/policy/impl/sec/SystemKeyManager;
invoke-virtual {v0, p1}, Lcom/android/internal/policy/impl/sec/SystemKeyManager;->isMetaKeyEventRequested(Landroid/content/ComponentName;)Z
move-result v0
return v0
.end method
[COLOR="Blue"].method isMusicActive()Z
.locals 3
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const-string v2, "audio"
invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/media/AudioManager;
if-nez v0, :cond_0
const-string v1, "WindowManager"
const-string v2, "isMusicActive: couldn\'t get AudioManager reference"
invoke-static {v1, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
const/4 v1, 0x0
:goto_0
return v1
:cond_0
invoke-virtual {v0}, Landroid/media/AudioManager;->isLocalOrRemoteMusicActive()Z
move-result v1
goto :goto_0
.end method[/COLOR]
Add new method indicated in BLUE:
Code:
.method sendCloseSystemWindows(Ljava/lang/String;)V
.locals 1
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-static {v0, p1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V
return-void
.end method
[COLOR="Blue"].method protected sendMediaButtonEvent(I)V
.locals 13
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
new-instance v11, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v11, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v0, Landroid/view/KeyEvent;
const/4 v5, 0x0
const/4 v7, 0x0
move-wide v3, v1
move v6, p1
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;-><init>(JJIII)V
invoke-virtual {p0, v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->dispatchMediaKeyWithWakeLockToAudioService(Landroid/view/KeyEvent;)V
const/16 v2, 0x1
invoke-static {v0, v2}, Landroid/view/KeyEvent;->changeAction(Landroid/view/KeyEvent;I)Landroid/view/KeyEvent;
move-result-object v0
invoke-virtual {p0, v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->dispatchMediaKeyWithWakeLockToAudioService(Landroid/view/KeyEvent;)V
return-void
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v11, v4, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v11, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
new-instance v12, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v12, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v3, Landroid/view/KeyEvent;
const/4 v8, 0x1
const/4 v10, 0x0
move-wide v4, v1
move-wide v6, v1
move v9, p1
invoke-direct/range {v3 .. v10}, Landroid/view/KeyEvent;-><init>(JJIII)V
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v12, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v12, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
return-void
.end method[/COLOR]
Add new lines indicated in BLUE
NOTE:
Make note of the value of the line in GREEN.
If your value is different, the 4 occurrences of v13 in our new code must also be changed to match.
Example:
If your line before the new code is:
move-result-object v8
You would change the 4 values of v13 to v8.
Code:
.method public updateSettings()V
.locals 23
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
move-object/from16 v18, v0
invoke-virtual/range {v18 .. v18}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
[COLOR="Green"]move-result-object v13
[/COLOR]
[COLOR="Blue"]const-string v7, "volbtn_music_controls"
const/4 v9, 0x0
invoke-static {v13, v7, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
const-string v7, "volbtn_timeout"
const/16 v9, 0x190
invoke-static {v13, v7, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnTimeout:I
const-string v7, "volbtn_vol_up"
const/16 v9, 0x57
invoke-static {v13, v7, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolUp:I
const-string v7, "volbtn_vol_down"
const/16 v9, 0x58
invoke-static {v13, v7, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolDown:I[/COLOR]
Android L Version of previous section:
New code is in BLUE
Code:
.method public updateSettings()V
.locals 19
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v9
[COLOR="Blue"]const-string v7, "volbtn_music_controls"
const/4 v10, 0x0
invoke-static {v9, v7, v10}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
const-string v7, "volbtn_timeout"
const/16 v10, 0x190
invoke-static {v9, v7, v10}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnTimeout:I
const-string v7, "volbtn_vol_up"
const/16 v10, 0x57
invoke-static {v9, v7, v10}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolUp:I
const-string v7, "volbtn_vol_down"
const/16 v10, 0x58
invoke-static {v9, v7, v10}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolDown:I[/COLOR]
Smali edit
\com\android\internal\policy\impl\PhoneWindowManager$SettingsObserver.smali
Search for string "immersive_mode_confirmations" and add new section in BLUE right above that line.
Make sure the values above in GREEN match the new code.
Code:
const-string v1, "default_input_method"
invoke-static {v1}, Landroid/provider/Settings$Secure;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {[COLOR="Green"]v0, v1, v4, p0, v5[/COLOR]}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
[COLOR="Blue"] const-string v1, "volbtn_music_controls"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v4, p0, v5}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
const-string v1, "volbtn_timeout"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v4, p0, v5}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
const-string v1, "volbtn_vol_up"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v4, p0, v5}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
const-string v1, "volbtn_vol_down"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v4, p0, v5}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;I)V
[/COLOR]
const-string v1, "immersive_mode_confirmations"
Android L UPDATE:
Additional Android L Changes
Additional changes for Android L are here --->> Android L amended guide
Credits: @loserskater for the orginal mod HERE ; @jeboo for his GitHub HERE @sac23 for the tremendous help getting framework.jar changes
tdunham said:
[Guide How-to] KitKat 4.4.2 Music Control - Volume Music Skip and More
This guide requires knowledge of decompiling and compiling apk and smali files.
It is only a guide.
I do not take requests. If you want this mod for your rom, get with a dev with the knowledge to get it done.
I have attached android.policy files for diffing in case you get stuck on a section.
Click to expand...
Click to collapse
Thank you, thank. You are a god...
Sent from my SM-T320 using Xparent BlueTapatalk 2
Gotta agree with the above post... You are awesome dude...
Are you about to ask a question? Hold up. Before you do that, did you check HERE? or HERE? :good:
FOR ANY ND8 RELATED QUESTIONS PLEASE VISIT THIS THREAD ----> TouchWiz 4.4 KitKat ND8 myth busters
My KITKAT 4.4.2 Touchwiz, Blue PCB Theme
TOUCHWIZ KITKAT ANIMATED PULLDOWN BAR AND ANIMATED PULLDOWN BACKGROUND MOD​
Another awesome guide TD! Thank you for sharing your knowledge with the community!
Sent from my SM-G900P using Tapatalk
@tdunham, you point to the VolBtnSettings in the settings.apk, but you didn't attach the files. Just giving you a heads up. Glad to see my work lives on! Thanks for updating this :good:
loserskater said:
@tdunham, you point to the VolBtnSettings in the settings.apk, but you didn't attach the files. Just giving you a heads up. Glad to see my work lives on! Thanks for updating this :good:
Click to expand...
Click to collapse
Thanks. I'm glad someone's looking out for me.
Thanks a ton for sharing your knowledge. You're a real class act man!
Appreciate you sharing the knowledge, thank you sir.
Delete
tdunham said:
Thanks. I'm glad someone's looking out for me.
Click to expand...
Click to collapse
Hey @tdunham...this is the first time for me using <SwitchPreferenceScreen in any mod...there shouldn't be a problem with me adding an icon to line should there?
<SwitchPreferenceScreen android:icon="@drawable/xxxxxxxx" android:title="@string/volbtn_toggle_title" android:key="volbtn_music_controls" android:fragment="com.android.settings.VolBtnSettings" />
Edit: I'll post pics when I'm done
deuce_biggins said:
Hey @tdunham...this is the first time for me using <SwitchPreferenceScreen in any mod...there shouldn't be a problem with me adding an icon to line should there?
<SwitchPreferenceScreen android:icon="@drawable/xxxxxxxx android:title="@string/volbtn_toggle_title" android:key="volbtn_music_controls" android:fragment="com.android.settings.VolBtnSettings" />
Click to expand...
Click to collapse
I don't see why not.
The good thing about SecSettings is that modifying it won't cause a bootloop, just a force close when you try to access the part of it that isn't coded properly.
However, why set an icon? This is a submenu of sounds and not a single item has an icon, stock Touchwiz of course. I just checked on my Galaxy SIII KitKat and the same goes there.
My SS is attached (without this menu item, we use CustomSettings.apk for toggles, colorizers & scripts).
Anyone get the android.policy edits right on the Sprint Note 3?
If someone with the know-how could take a look at my PhoneWindowsManager I'd sure be greatful. I'll leave it here......PhoneWindowsManager.smali
This is an error I'm getting when I...1 2 3 4 screenshot!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Thank you
Once again my Sammy tablet is a bit diff...
Code:
.method public updateSettings()V
.locals 17
.prologue
.line 1714
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v12}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v8
.line 1715
.local v8, resolver:Landroid/content/ContentResolver;
const/4 v9, 0x0
.line 1722
.local v9, updateRotation:Z
const-string v12, "multi_window_enabled"
const/4 v13, 0x0
const/4 v14, -0x2
invoke-static {v8, v12, v13, v14}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v1
.line 1726
.local v1, enableMultiWindowUISetting:I
move-object/from16 v0, p0
iget-object v13, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLock:Ljava/lang/Object;
monitor-enter v13
.line 1728
:try_start_0
move-object/from16 v0, p0
iget-boolean v12, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsMultiWindowEnabled:Z
if-eqz v12, :cond_1
.line 1729
move-object/from16 v0, p0
iget-boolean v12, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemReady:Z
if-eqz v12, :cond_1
.line 1730
move-object/from16 v0, p0
iget v12, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mEnableMultiWindowUISetting:I
const/4 v14, -0x1
if-ne v12, v14, :cond_c
.line 1731
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v12}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v12
const-string v14, "multi_window_flashbar_shown"
const/4 v15, -0x1
const/16 v16, -0x2
move/from16 v0, v16
invoke-static {v12, v14, v15, v0}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v6
.line 1734
.local v6, lastFlashBarVisibility:I
if-nez v6, :cond_b
Where and how to put this last piece of code. in. I have tried several times, but all I get is Sammy Logo. No boot...
Code:
#Music Mod
const-string v7, "volbtn_music_controls"
const/4 v9, 0x0
invoke-static {v12, v7, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
const-string v7, "volbtn_timeout"
const/16 v9, 0x190
invoke-static {v12, v7, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnTimeout:I
const-string v7, "volbtn_vol_up"
const/16 v9, 0x57
invoke-static {v12, v7, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolUp:I
const-string v7, "volbtn_vol_down"
const/16 v9, 0x58
invoke-static {v12, v7, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnVolDown:I
#End of Add - Music Mod
1brainsurgeon said:
If someone with the know-how could take a look at my PhoneWindowsManager I'd sure be greatful. I'll leave it here......PhoneWindowsManager.smali
This is an error I'm getting when I...1 2 3 4 screenshot!
Thank you
Click to expand...
Click to collapse
The error is somewhere on or around line 16553 is what the baksmali is reporting there.
Gunthermic said:
Once again my Sammy tablet is a bit diff...
Click to expand...
Click to collapse
Line right before adding the new section:
Code:
move-result-object v8
You didn't use v8 in the 4 places like I recommended in the guide to replace v13 in the new code.
tdunham said:
Line right before adding the new section:
Code:
move-result-object v8
You didn't use v8 in the 4 places like I recommended in the guide to replace v13 in the new code.
Click to expand...
Click to collapse
Will try again. I actually tried be and v12.. but maybe the placement is the screwy part... will try and see.
Thank you for helping tdun
Sent from my SM-T320 using Xparent BlueTapatalk 2
Gunthermic said:
Will try again. I actually tried be and v12.. but maybe the placement is the screwy part... will try and see.
Click to expand...
Click to collapse
It HAS to be v8 in those 4 places but maybe we need to change some other values too. Let me know how you make out.
tdunham said:
It HAS to be v8 in those 4 places but maybe we need to change some other values too. Let me know how you make out.
Click to expand...
Click to collapse
I will try v8... I think that is the area that can cause a big issue... I will report back....
Sent from my SM-T320 using Xparent BlueTapatalk 2
Question. I haven't had time to try the android policy edits yet but finished settings.... I tried to click the menu in settings to see if it works.... But get an fc in tap, menu won't even open..... Is this due to not doing the policy edits yet.... Or should it at least open anyways? Curious if I should go back thru settings or not.
Thanks.

[GUIDE][CM9-11] Add partition info in Settings.apk

Assalamualaikum
Hello guys, i want to share a simple guide with you
WHAT IS IT?
it's a guide to make a partition info in the Settings.apk
Source:
SCREENSHOT
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Ok, let's start working on it
WHATS NEEDED?
- Brain
- A cup of coffe
- Use Apktool v 2.0.0 beta 9
- Settings.apk
- Attachment file
1. Decompile your Settings.apk
2. Download and extrack Attachment file and place it in the right place
3. Go to the ~\Settings\res\values\strings.xml
Add this code below before </resources>
Code:
<string name="partition_info_title">Partition info</string>
<string name="partition_info_system">/system</string>
<string name="partition_info_data">/data</string>
<string name="partition_info_cache">/cache</string>
<string name="partition_info_sdcard">/sdcard (FAT)</string>
<string name="partition_info_sdext">/sd-ext (EXT)</string>
<string name="partition_info_used_of">/</string>
<string name="nol">Unavailable</string>
</resources>
3. Go to the ~\Settings\res\xml\settings_headers.xml
Add this code below wherever you want inside settings_headers.xml
Code:
<header android:icon="@drawable/partition_info" android:title="@string/partition_info_title">
<intent android:targetPackage="com.android.settings" android:action="com.android.action.MAIN" android:targetClass="com.android.settings.ktech.PartitionInfo" />
</header>
4. Compile your Settings.apk and decompile again
5. Go to ~\Settings\AndroidManifest.xml
Code:
<activity android:label="@string/partition_info_title" android:name=".ktech.PartitionInfo">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.VOICE_LAUNCH"/>
</intent-filter>
</activity>
6. Go to the ~\Settings\smali\com\android\settings\ktech\PartitionInfo.smali
Find & replace this code below with your public id
Code:
Line 110 0x7f080403 public type="string" name="partition_info_used_of"
Line 189 0x7f050043 public type="xml" name="partition_info"
7. Recompile Settings.apk then Sign it
8. Push it in your phone
hi i have one problem i make all the steps and im getting fc of settings when im pushing ''partition info'' and then i see that after decompile (the second decompile) the partition_info is in pyblic type drawable and not in pyblic type xml im trying 5 times but nothing (sorry for my bad english)
G.M.L said:
hi i have one problem i make all the steps and im getting fc of settings when im pushing ''partition info'' and then i see that after decompile (the second decompile) the partition_info is in pyblic type drawable and not in pyblic type xml im trying 5 times but nothing (sorry for my bad english)
Click to expand...
Click to collapse
Post your log here
Here is it
OK I made it I changed the icon name in drawable-hdpi and after decomplile (the second time) in public the names are correct thanks k_tech!!!!!!
G.M.L.
G.M.L said:
OK I made it I changed the icon name in drawable-hdpi and after decomplile (the second time) in public the names are correct thanks k_tech!!!!!!
G.M.L.
Click to expand...
Click to collapse
Ok, good job
Thx sir, its work on my LG P713 (4.1.2)
Thx sir...
step6 is little confusing....could u plz be in detail.
rrajesh011 said:
step6 is little confusing....could u plz be in detail.
Click to expand...
Click to collapse
Open smali/com/android/settings/k_tech/partitioninfo.smali and leave it open
Open value/public.xml and find
type=string name=partition_info_used_of id=this number copy and paste to partition info.smali in line 1100
And
type=xml name=partition_info id=this number copy and paste in partition info.Smali in line 1890
Compile and its ready!!!
G.M.L.
G.M.L said:
Open smali/com/android/settings/k_tech/partitioninfo.smali and leave it open
Open value/public.xml and find
type=string name=partition_info_used_of id=this number copy and paste to partition info.smali in line 1100
And
type=xml name=partition_info id=this number copy and paste in partition info.Smali in line 1890
Compile and its ready!!!
G.M.L.
Click to expand...
Click to collapse
this is my partitioninfo.smali i didnot find line 189. i found line 110 but where to add public id.
Code:
.class public Lcom/android/settings/ktech/PartitionInfo;
.super Landroid/preference/PreferenceActivity;
.source "PartitionInfo.java"
# instance fields
.field private extfsIsMounted:Z
.field private mCachePartSize:Landroid/preference/Preference;
.field private mDataPartSize:Landroid/preference/Preference;
.field private mSDCardPartEXTSize:Landroid/preference/Preference;
.field private mSDCardPartFATSize:Landroid/preference/Preference;
.field private mSystemPartSize:Landroid/preference/Preference;
# direct methods
.method public constructor <init>()V
.locals 1
.prologue
.line 45
invoke-direct {p0}, Landroid/preference/PreferenceActivity;-><init>()V
.line 60
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/settings/ktech/PartitionInfo;->extfsIsMounted:Z
return-void
.end method
.method private ObtainFSPartSize(Ljava/lang/String;)Ljava/lang/String;
.locals 11
.param p1, "PartitionPath" # Ljava/lang/String;
.prologue
.line 103
new-instance v4, Ljava/io/File;
invoke-direct {v4, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 104
.local v4, "extraPath":Ljava/io/File;
new-instance v5, Landroid/os/StatFs;
invoke-virtual {v4}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v7
invoke-direct {v5, v7}, Landroid/os/StatFs;-><init>(Ljava/lang/String;)V
.line 105
.local v5, "extraStat":Landroid/os/StatFs;
invoke-virtual {v5}, Landroid/os/StatFs;->getBlockSize()I
move-result v7
int-to-long v0, v7
.line 106
.local v0, "eBlockSize":J
invoke-virtual {v5}, Landroid/os/StatFs;->getBlockCount()I
move-result v7
int-to-long v2, v7
.line 107
.local v2, "eTotalBlocks":J
mul-long v7, v2, v0
invoke-virtual {v5}, Landroid/os/StatFs;->getAvailableBlocks()I
move-result v9
int-to-long v9, v9
mul-long/2addr v9, v0
sub-long/2addr v7, v9
invoke-static {p0, v7, v8}, Landroid/text/format/Formatter;->formatFileSize(Landroid/content/Context;J)Ljava/lang/String;
move-result-object v6
.line 108
.local v6, "retstr":Ljava/lang/String;
new-instance v7, Ljava/lang/StringBuilder;
invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v7, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
const-string v8, " "
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {p0}, Lcom/android/settings/ktech/PartitionInfo;->getResources()Landroid/content/res/Resources;
move-result-object v8
const v9, 0x7f080403
invoke-virtual {v8, v9}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
move-result-object v8
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
const-string v8, " "
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
.line 109
new-instance v7, Ljava/lang/StringBuilder;
invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v7, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
mul-long v8, v2, v0
invoke-static {p0, v8, v9}, Landroid/text/format/Formatter;->formatFileSize(Landroid/content/Context;J)Ljava/lang/String;
move-result-object v8
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
.line 110
return-object v6
.end method
# virtual methods
.method public fileExists(Ljava/lang/String;)Z
.locals 2
.param p1, "filename" # Ljava/lang/String;
.prologue
.line 114
new-instance v0, Ljava/io/File;
invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 115
.local v0, "f":Ljava/io/File;
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v1
return v1
.end method
.method protected onCreate(Landroid/os/Bundle;)V
.locals 5
.param p1, "icicle" # Landroid/os/Bundle;
.prologue
const/4 v4, 0x1
.line 64
invoke-super {p0, p1}, Landroid/preference/PreferenceActivity;->onCreate(Landroid/os/Bundle;)V
.line 66
const v2, 0x7f050043
invoke-virtual {p0, v2}, Lcom/android/settings/ktech/PartitionInfo;->addPreferencesFromResource(I)V
.line 68
invoke-virtual {p0}, Lcom/android/settings/ktech/PartitionInfo;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v1
.line 70
.local v1, "prefSet":Landroid/preference/PreferenceScreen;
const-string v2, "system_part_info"
invoke-virtual {v1, v2}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
iput-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSystemPartSize:Landroid/preference/Preference;
.line 71
const-string v2, "data_part_info"
invoke-virtual {v1, v2}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
iput-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mDataPartSize:Landroid/preference/Preference;
.line 72
const-string v2, "cache_part_info"
invoke-virtual {v1, v2}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
iput-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mCachePartSize:Landroid/preference/Preference;
.line 73
const-string v2, "sdcard_part_info_fat"
invoke-virtual {v1, v2}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
iput-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSDCardPartFATSize:Landroid/preference/Preference;
.line 74
const-string v2, "sdcard_part_info_ext"
invoke-virtual {v1, v2}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
iput-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSDCardPartEXTSize:Landroid/preference/Preference;
.line 76
const-string v2, "/dev/block/mmcblk0p2"
invoke-virtual {p0, v2}, Lcom/android/settings/ktech/PartitionInfo;->fileExists(Ljava/lang/String;)Z
move-result v2
if-ne v2, v4, :cond_0
.line 77
const-string v2, "PartitionInfo"
const-string v3, "sd: ext partition mounted"
invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 78
iput-boolean v4, p0, Lcom/android/settings/ktech/PartitionInfo;->extfsIsMounted:Z
.line 84
:goto_0
:try_start_0
iget-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSystemPartSize:Landroid/preference/Preference;
const-string v3, "/system"
invoke-direct {p0, v3}, Lcom/android/settings/ktech/PartitionInfo;->ObtainFSPartSize(Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
.line 85
iget-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mDataPartSize:Landroid/preference/Preference;
const-string v3, "/data"
invoke-direct {p0, v3}, Lcom/android/settings/ktech/PartitionInfo;->ObtainFSPartSize(Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
.line 86
iget-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mCachePartSize:Landroid/preference/Preference;
const-string v3, "/cache"
invoke-direct {p0, v3}, Lcom/android/settings/ktech/PartitionInfo;->ObtainFSPartSize(Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
.line 87
iget-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSDCardPartFATSize:Landroid/preference/Preference;
const-string v3, "/sdcard"
invoke-direct {p0, v3}, Lcom/android/settings/ktech/PartitionInfo;->ObtainFSPartSize(Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
.line 89
iget-boolean v2, p0, Lcom/android/settings/ktech/PartitionInfo;->extfsIsMounted:Z
if-ne v2, v4, :cond_1
.line 90
iget-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSDCardPartEXTSize:Landroid/preference/Preference;
const-string v3, "/external_sd"
invoke-direct {p0, v3}, Lcom/android/settings/ktech/PartitionInfo;->ObtainFSPartSize(Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
:try_end_0
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
.line 99
:goto_1
return-void
.line 80
:cond_0
const-string v2, "PartitionInfo"
const-string v3, "sd: ext partition not mounted"
invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_0
.line 92
:cond_1
:try_start_1
iget-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSDCardPartEXTSize:Landroid/preference/Preference;
const/4 v3, 0x0
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setEnabled(Z)V
:try_end_1
.catch Ljava/lang/IllegalArgumentException; {:try_start_1 .. :try_end_1} :catch_0
goto :goto_1
.line 95
:catch_0
move-exception v0
.line 96
.local v0, "e":Ljava/lang/IllegalArgumentException;
invoke-virtual {v0}, Ljava/lang/IllegalArgumentException;->printStackTrace()V
goto :goto_1
.end method
Change
0x7f080403 in line 110 with the id of partition_info_used_of
and
0x7f050058 in line 189 with the id of partition_info
Thanks
nice sir.
but i have problem, for /sd-ext(EXT) is displayed unavailable. i have 16gb external storage..
My rom is stock 4.1.2 touchwiz.
hope can fix :fingers-crossed:
syaeful said:
nice sir.
but i have problem, for /sd-ext(EXT) is displayed unavailable. i have 16gb external storage..
My rom is stock 4.1.2 touchwiz.
hope can fix :fingers-crossed:
Click to expand...
Click to collapse
Try this smali and tell me if it work
G.M.L said:
Try this smali and tell me if it work
Click to expand...
Click to collapse
thanks sir... i will try and give feedback later
---------- Post added at 10:23 AM ---------- Previous post was at 10:04 AM ----------
Still same sir,,
syaeful said:
thanks sir... i will try and give feedback later
---------- Post added at 10:23 AM ---------- Previous post was at 10:04 AM ----------
Still same sir,,
Click to expand...
Click to collapse
I will check it again later and I will tell you
G.M.L.
syaeful said:
thanks sir... i will try and give feedback later
---------- Post added at 10:23 AM ---------- Previous post was at 10:04 AM ----------
Still same sir,,
Click to expand...
Click to collapse
in partition_info.xml try to change @string/nol with @string/status_unavailable and tell me
in Android_manifest.xml did you add the activity?
G.M.L said:
in partition_info.xml try to change @string/nol with @string/status_unavailable and tell me
in Android_manifest.xml did you add the activity?
Click to expand...
Click to collapse
i have done with manifest..
i wil try for strings. thanks before
G.M.L said:
Try this smali and tell me if it work
Click to expand...
Click to collapse
thank you. ROM cook me JB 4.1.2
i try this smali

Categories

Resources