[HOW TO] AOSP Lock + Toggle| 3 Way Ext. Power Menu| CRT-OFF| Long Menu Press to Kill - Galaxy S III Themes and Apps

Hy Guys! in my request to isolate all the codes in Smali files to enable Extended Power Menu, CRT-OF, Long Menu Press To Kill and AOSP Lockscreen working separately to implement in my ROM (crDroid ROM) i manage to found how to do it!
Updated 19.01.2013 = Working in latest XXELLC
Requirements :
- You need to know how to work with apktool, smali and baksmali stuffs.
- Notepad++
- 7-zip
WE WILL USE FOLLOING STEPS IN ALL 4 MODS
1 - You need to extract from inside the stock framework/ a file called android.policy.jar;
2 - Open android.policy.jar with 7-zip;
3 - Extract classes.dex from it;
2 - Decompile using baksmail commands;
3 - Once it's done Recompile using smali commands:
Click to expand...
Click to collapse
== AOSP Lockscreen with Toggle ==
Decompile android.policy.jar
Go to: com\android\internal\policy\impl\LockPatternKeyguardView.smali
Click to expand...
Click to collapse
Find this method
Code:
.method createLockScreen()Landroid/view/View;
And switch completely with this (Same method with new codes inside)
Code:
[left][color="blue"].method createLockScreen()Landroid/view/View;
.registers 7
.prologue
.line 1254
iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "aosp_lock"
const/4 v2, 0x0
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-nez v0, :cond_1f
new-instance v0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/sec/CircleLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
goto :goto_2e
.line 1260
:cond_1f
new-instance v0, Lcom/android/internal/policy/impl/LockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
.local v0, lockView:Landroid/view/View;
:goto_2e
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V
.line 1261
return-object v0
.end method[/color][/left]
It will create the AOSP lockscreen but with one issue. Adding only this "new" method will made the lockscreen unlockable using menu button;
So let's made some changes to fix this. There are 2 ways to fix it
1st way
Go to: com\android\internal\policy\impl\LockScreen.smali
Click to expand...
Click to collapse
Find and delete the red one
Code:
.field private mCreationOrientation:I
[color="red"]--- .field private mEnableMenuKeyInLockScreen:Z[/color]
.field private mEnableRingSilenceFallback:Z
Find and delete the red ones
Code:
[left].line 447
iput-object p5, p0, Lcom/android/internal/policy/impl/LockScreen;->mCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
.line 448
[color="red"]--- invoke-direct {p0}, Lcom/android/internal/policy/impl/LockScreen;->shouldEnableMenuKey()Z
--- move-result v0
--- iput-boolean v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mEnableMenuKeyInLockScreen:Z[/color]
.line 449
iget v0, p2, Landroid/content/res/Configuration;->orientation:I[/left]
Find the method and delete completely
Code:
[left][color="red"].method public onKeyDown(ILandroid/view/KeyEvent;)Z
.registers 4
.parameter "keyCode"
.parameter "event"
.prologue
.line 541
const/16 v0, 0x52
if-ne p1, v0, :cond_d
iget-boolean v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mEnableMenuKeyInLockScreen:Z
if-eqz v0, :cond_d
.line 542
iget-object v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-interface {v0}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
.line 544
:cond_d
const/4 v0, 0x0
return v0
.end method[/color][/left]
Recompile android.policy.jar and it's done!
AOSP Lockscreen Properly working
2nd way (Thanks to jimbo77)
Using this method we will need to decompile framework-res.apk
Go to: res/values/bools
Click to expand...
Click to collapse
Find and switch
Code:
[color="red"]--- <bool name="config_disableMenuKeyInLockScreen">false</bool>[/color]
[color="blue"]+++ <bool name="config_disableMenuKeyInLockScreen">true</bool>[/color]
Recompile framework-res.apk and it's done.
Lets put toggle in SecSettings.apk
decompile SecSettings.apk
Go to:res/values/strings
Click to expand...
Click to collapse
Add this at the end of the file, before close resources</resources>.
This 2 string bellow will be shown in settings, so feel free to change.
Code:
[left][color="blue"]+++ <string name="aosp">Jelly Bean (AOSP) Lockscreen</string>
+++ <string name="aosp_summary">Enable Original Jelly Bean Lockscreen</string>[/color]
[/left]
Go to: res/xml/Lockscreen_Settings.xml
Click to expand...
Click to collapse
Find and add
Code:
[left]<SwitchPreferenceScreen android:title="@string/lock_screen_shortcut_title" android:key="lock_screen_shortcut" android:summary="@string/lock_screen_shortcut_summary">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.lockscreenshortcut.LockScreenShortcutSettings" />
</SwitchPreferenceScreen>
[color="blue"]+++ <CheckBoxPreference android:title="@string/aosp" android:key="say_your_wakeup" android:summary="@string/aosp_summary" />[/color]
<SwitchPreferenceScreen android:title="@string/information_ticker" android:key="information_ticker" android:summary="@string/information_ticker_summary" android:fragment="com.android.settings.InformationTicker" />
[/left]
Go to: smali\com\android\settings\LockScreenSettings.smali
Click to expand...
Click to collapse
Find and add
Code:
[left].field private isWeatherEnabled:Z
[color="blue"]+++ .field private mAospLock:Landroid/preference/CheckBoxPreference;[/color]
.field private mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;[/left]
Find and Switch
Code:
[left]iput-object v0, p0, Lcom/android/settings/LockScreenSettings;->mMotionDialog:Landroid/app/AlertDialog;
[color="red"]--- const/16 v0, 0x8[/color]
[color="blue"]+++ const/16 v0, 0x11[/color]
new-array v0, v0, [I[/left]
Find and Switch
Code:
[left]invoke-virtual {v6, v3}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 294
:cond_3
[color="red"]--- iget-object v3, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iget-object v3, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
if-eqz v3, :cond_4
.line 295
[color="red"]--- iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
[color="red"]--- const-string v7, "wake_up_lock_screen"[/color]
[color="blue"]+++ const-string v7, "aosp_lock"[/color]
invoke-static {v3, v7, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I[/left]
Find and Switch
Code:
[left]const-string v8, "say_your_wakeup"
invoke-virtual {p0, v8}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v8
check-cast v8, Landroid/preference/CheckBoxPreference;
[color="red"]--- iput-object v8, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iput-object v8, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
.line 212
iget-object v8, p0, Lcom/android/settings/LockScreenSettings;->mRippleEffect:Landroid/preference/CheckBoxPreference;
if-eqz v8, :cond_8[/left]
Find and Switch
Code:
[left]goto :goto_4
:cond_9
[color="red"]--- iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_0
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
[color="red"]--- const-string v5, "wake_up_lock_screen"[/color]
[color="blue"]+++ const-string v5, "aosp_lock"[/color]
[color="red"]---iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_a[/left]
Find Switch and delete
Code:
[left]
invoke-interface {v1}, Ljava/util/List;->size()I
move-result v8
if-ge v8, v9, :cond_f
.line 240
[color="red"]--- iget-object v8, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="blue"]+++ iget-object v8, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/color]
if-eqz v8, :cond_e
[color="red"]--- invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;[/color]
[color="red"]--- move-result-object v8[/color]
[color="red"]--- iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/color]
[color="red"]--- invoke-virtual {v8, v9}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z[/color]
:cond_e
if-eqz v6, :cond_f
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;[/left]
Recompile SecSettings.apk and it's done!
== 3 Way Extended Power Menu ==
Go to: com/android/internal/policy/impl/GlobalActions.smali
Click to expand...
Click to collapse
Find this
Code:
[LEFT].line 368
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$5;[/LEFT]
And switch with this
Code:
[LEFT][COLOR="Blue"].line 368
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$99;[/COLOR][/LEFT]
Find this
Code:
[LEFT]invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$5;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V[/LEFT]
And switch with this
Code:
[LEFT][COLOR="Blue"]invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V[/COLOR][/LEFT]
Now go to
com/android/internal/policy/impl/GlobalActions$SinglePressAction.smali
Click to expand...
Click to collapse
Find this
Code:
[LEFT].end annotation
# instance fields
.field private final mIconResId:I
.field private final mMessage:Ljava/lang/CharSequence;
.field private final mMessageResId:I
[/LEFT]
And between .end annotation and # instance fields, add this
Code:
[LEFT][COLOR="Blue"]# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;[/COLOR][/LEFT]
Find this
Code:
[LEFT]# direct methods
.method protected constructor <init>(II)V
.registers 4
.parameter "iconResId"
.parameter "messageResId"
[/LEFT]
And between # direct methods and .method protected constructor <init>(II)V, add this
Code:
[LEFT][COLOR="Blue"].method static constructor <clinit>()V
.registers 3
const/4 v0, 0x3
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Reboot"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Recovery"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method[/COLOR][/LEFT]
To finalize Extended Power Menu you need to copy tree smali files (GlobalActions$99$1.smali, GlobalActions$99$2, and GlobalActions$1.smali) and paste then inside -> com/android/internal/policy/impl/
Recompile android.policy.jar using smali commands it's DONE!
== CRT OFF Animation ==
Follow the same procedure as android.policy.jar to decompile and extract classes.dex
Go to
Go to: com/android/internal/policy/impl/PhoneWindowManager.smali
Click to expand...
Click to collapse
find this
Code:
[LEFT]# interfaces
.implements Landroid/view/WindowManagerPolicy;
# annotations
[/LEFT]
Between .implements Landroid/view/WindowManagerPolicy and # annotations, add this
Code:
[LEFT][COLOR="Blue"].implements Ljava/lang/Runnable;[/COLOR][/LEFT]
find this
Code:
[LEFT].line 5938
.end local v9 #isAllowed:Z
.end local v16 #kioskMode:Landroid/app/enterprise/kioskmode/KioskMode;
:cond_66
:goto_66
return v19[/LEFT]
Between :goto_66 and return v19, add this
Code:
[LEFT][COLOR="Blue"]and-int/lit8 v0, v19, 0x4
if-eqz v0, :cond_71
and-int/lit8 v19, v19, -0x5
move-object/from16 v0, p0
invoke-virtual {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->sleepDelay()V
:cond_71[/COLOR][/LEFT]
Go to the Bottom of the file and add this hole code
Code:
[LEFT][COLOR="Blue"].method public sleepDelay()V
.locals 10
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
const-wide v2, 0x64
check-cast p0, Ljava/lang/Runnable;
invoke-virtual {v0, p0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
.end method
.method public run()V
.locals 10
.prologue
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const-string v1, "power"
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v2
const-wide/16 v6, 0x3e8
add-long/2addr v2, v6
invoke-virtual {v0, v2, v3}, Landroid/os/PowerManager;->goToSleep(J)V
return-void
.end method[/COLOR][/LEFT]
Now you can recompile android.policy.jar using smali commands.
Now
Extract services.jar from inside framework folder and follow the same procedure extract classes.dex and decompile it.
Go to
Go to: com/android/server/PowerMangerService$ScreenBrightnessAnimator.smali
Click to expand...
Click to collapse
find this
Code:
[LEFT]#getter for: Lcom/android/server/PowerManagerService;->mScreenBrightnessHandler:Landroid/os/Handler;
invoke-static {v7}, Lcom/android/server/PowerManagerService;->access$7300(Lcom/android/server/PowerManagerService;)Landroid/os/Handler;
move-result-object v7
const/16 v9, 0xa[/LEFT]
Between move-result-object v7 and const/16 v9, 0xa, add this
Code:
[LEFT][COLOR="Blue"]if-eqz p2, :cond_75
const/16 v9, 0xb
const/4 v10, 0x0
const v2, 0x10
invoke-virtual {v7, v9, v2, v10}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;
move-result-object v9
invoke-virtual {v9}, Landroid/os/Message;->sendToTarget()V
:cond_75[/COLOR][/LEFT]
Now you can recompile services.jar using apktool and smali commands
== Long Menu Press to Kill App ==
Follow the same procedure as android.policy.jar and services.jar to decompile and extract classes.dex again from android.policy.jar
Go to: com/android/internal/policy/impl/PhoneWindowManager.smali
Click to expand...
Click to collapse
find this
Code:
.line 1455
[COLOR="Red"]new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$8;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$8;-><init (Lcom/android/internal/policy/impl/PhoneWindowManager;)V[/COLOR]
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mMenuLongPress:Ljava/lang/Runnable;
change the red ones for blues under
Code:
[COLOR="Blue"]+ new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$MenuLongPress;
+ invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$MenuLongPress;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V[/COLOR]
Extract the PhoneWindowManager-file.zip attached, extract the file int it and copy to com/android/internal/policy/impl/
Recompile android.policy.jar using smali commands and it's done!
With this we will be able to add or remove this 4 mods from inside any other
CREDITS
For CRT OFF Animation method all the credits goes to Sorg. I've just follow his tutorial.
For part Extended Power Menu i like to thanks mgn2o
For part of AOSP Lockscreen i like to thanks Didact74

Nice, an EPM whitout Hot Reboot (mgn2o) thanks for reference ....
Enviado de meu GT-I9300 usando o Tapatalk 2

Excellent guide! Would love one for lockscreen media skip !! I cant find the source/guide anywhere !

Great guide.
It will be great:
Can you add how to decompile .odex such that we obtain .smali for editing ??
Thanks in advance mate.

Post updated with Long Menu Press to Kill for XXELK4

Akshay (Aky) said:
Great guide.
It will be great:
Can you add how to decompile .odex such that we obtain .smali for editing ??
Thanks in advance mate.
Click to expand...
Click to collapse
You can try to deodex a file, made the changes and re-odex.
I never try with odex. I only use roms deodexed and my (crDroid) in development is surely deodexed.
Take a look in here: CLICK

how to Inkeffect tutorial

One more thing, how to add the function "Long press volume key to jump muisc" in lockscreen mode? Thanks.

I'll definitely use this to add crt animation to the 4.1.2 ROM I have for the Sprint S2. Thanks!
Sent from my SPH-D710 using xda premium

Great job, Hoping this will become a central hub for source code ! Bookmarked for future use.. looking forward to future sources!

Would you please also add the mod for "long press volume key to skip song"? Thanks.

dongfangri said:
Would you please also add the mod for "long press volume key to skip song"? Thanks.
Click to expand...
Click to collapse
I'm working on this. Trying some kind of "reverse engineering" to spot the codes.

Great tutorial, for my first attempt at these types of edits, it made life very easy. Although i have a small problem. Ive made the edits so i can have extended power menu, crt off and any app multi window in my rom. Everything went smoothly but it seems that crt off is erratic. Sometimes it works and sometimes it does not. Any ideas?
Sent from my GT-I9300 using Tapatalk 2

anaraxia said:
Great tutorial, for my first attempt at these types of edits, it made life very easy. Although i have a small problem. Ive made the edits so i can have extended power menu, crt off and any app multi window in my rom. Everything went smoothly but it seems that crt off is erratic. Sometimes it works and sometimes it does not. Any ideas?
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Well a never had this kind of problem.
Using Kernle Perseus, by the way? It seems to broke CRT.

Cristiano Matos said:
Well a never had this kind of problem.
Using Kernle Perseus, by the way? It seems to broke CRT.
Click to expand...
Click to collapse
No... Stock kernel. Keeping in simple
Sent from my GT-I9300 using Tapatalk 2

anaraxia said:
No... Stock kernel. Keeping in simple
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
There's a problem with the Stock kernel on the newest JB update (For both leak and official)
Try using Siyah's 1.8.3 and use the CRT Fix in the STweaks application.
---------- Post added at 11:15 AM ---------- Previous post was at 10:29 AM ----------
Thanks alot for this tutorial, very simple and straight to the point!

Lost.soul said:
There's a problem with the Stock kernel on the newest JB update (For both leak and official)
Try using Siyah's 1.8.3 and use the CRT Fix in the STweaks application.
Thanks for the help. Downloaded, flashed and tested. Works perfectly now. Will have to add it to my next release. Thanks again :thumbup:
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse

Loved your post, but i have a question: is it possible to do this with gingerbread rom? is it the same procedure?
Também sou brasileiro, hehehe. Tem como tu me ajudar com algumas coisas?
Click to expand...
Click to collapse

Note II InkEffect Lockscreen
It is not compatible with Note II InkEffect Lockscreen Mod.
When I flash this mod (extended menu) the ink effect lockscreen stop working
thank you

anaraxia said:
Great tutorial, for my first attempt at these types of edits, it made life very easy. Although i have a small problem. Ive made the edits so i can have extended power menu, crt off and any app multi window in my rom. Everything went smoothly but it seems that crt off is erratic. Sometimes it works and sometimes it does not. Any ideas?
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
Can you confirm it works ONLY with Wifi On ? Seams like that on my try
in the service.jar...i have 2 times those codes...234, 264 something, so how do you choose where to insert your part ?
later edit:
Makes no diff where i add those it seams. Still CRT only works with WIFI on, its like a CRT SWICH haha...suppose "stuff" should be inserted differently on 4.1.2.

Related

[MOD][GUIDE] Lockscreen torch

I built this guide for the VW GS3 but I have to assume its extremely close for the Sprint varient as well.
The lockscreen torch will allow you to quickly turn on your flashlight from the lockscreen. Simply hold the home button in for torch, let it go and it will turn off. It is meant to function this way so you dont accidentally turn it on in your pocket or something and forget about it. Not sure who originally wrote the MOD but I have spent some time re-writing it to fit the GS3 based on a dozen or so other tutorials.
After reboot, it will take about 20 seconds before the MOD will engage. Then it will work at will as long as you are on the lockscreen.
I will include the three files that are being modified in the zip below so you can use them in your compare tool.
DEVs if you want to use this in your ROM feel free, just shoot me some credit and some thanks!
Hit the Thanks Button!
Here is the guide.....
First you will need to download the torch file below and drop it in /system/app. This will be in the zip file with the smali files.
We will be working with three smali files inside of android.policy.jar.
Navigate to smali/com/android/internal/policy/impl/KeyguardViewMediator$2.smali
Find the following code and add the part in RED
Code:
packed-switch v2, :pswitch_data_0
.line 1172
:goto_0
[COLOR="Red"][B] :pswitch_0
[/B][/COLOR] return-void
Find the 13 : pswitch_ lines and increase them by 1. For example
Code:
:pswitch_0 becomes :pswitch_1
:pswitch_1 becomes :pswitch_2
:pswitch_2 becomes :pswitch_3
:pswitch_3 becomes :pswitch_4
:pswitch_4 becomes :pswitch_5
:pswitch_5 becomes :pswitch_6
:pswitch_6 becomes :pswitch_7
:pswitch_7 becomes :pswitch_8
:pswitch_8 becomes :pswitch_9
:pswitch_9 becomes :pswitch_a
:pswitch_a becomes :pswitch_b
:pswitch_b becomes :pswitch_c
:pswitch_c becomes :pswitch_d
Find the following code
Code:
invoke-static {v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->access$300(Lcom/android/internal/policy/impl/KeyguardViewMediator;)V
.line 1169
monitor-exit v1
goto :goto_0
Add the following directly after
Code:
.line 974
:pswitch_e
iget-object v2, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator$2;->this$0:Lcom/android/internal/policy/impl/KeyguardViewMediator;
iget v3, p1, Landroid/os/Message;->arg1:I
if-eqz v3, :cond_2
move v3, v0
:goto_3
#calls: Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
invoke-static {v2, v3}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->access$1900(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
goto :goto_0
:cond_2
move v3, v1
goto :goto_3
Find the "nop' at the end and add another one right below it
Code:
throw v0
.line 1129
nop
nop
Find the stack of : pswitch_ lines at the end of the smali and delete : pswitch_0
Then add the following so the entire stack will end up looking like this
Code:
.packed-switch 0x1
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
:pswitch_5
:pswitch_6
:pswitch_7
:pswitch_8
:pswitch_9
:pswitch_a
:pswitch_b
:pswitch_c
:pswitch_d
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_0
:pswitch_e
.end packed-switch
.end method
Thats it for KeyguardViewMediator$2.smali. Save and close the file.
Navigate to smali/com/android/internal/policy/impl/KeyguardViewMediator.smali
Find the following code
Code:
.field private static final SET_HIDDEN:I = 0xc
Add this right after
Code:
[hide]
.field private static final SET_TORCH:I = 0x14
Find the following code
Code:
.field private mTelephonyManager:Landroid/telephony/TelephonyManager;
Add this right after
Code:
.field private mTorchEnabled:Z
.field private mTorchStateChanged:Z
Find the following code
Code:
const/4 v10, 0x0
const/4 v9, 0x1
.line 301
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
Add this after
Code:
iput-boolean v9, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
Find the following code
Code:
iput-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
.line 302
iput-object p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
.line 304
iput-object p3, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mRealPowerManager:Landroid/os/LocalPowerManager;
Add this after
Code:
iput-boolean v10, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
.line 1188
iput-boolean v10, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
Find this method
Code:
.method static synthetic access$200(Lcom/android/internal/policy/impl/KeyguardViewMediator;)V
Add this entire NEW method RIGHT BEFORE it.
Code:
.method static synthetic access$1900(Lcom/android/internal/policy/impl/KeyguardViewMediator;Z)V
.locals 0
.parameter "x0"
.parameter "x1"
.prologue
invoke-direct {p0, p1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
return-void
.end method
Find the following code
Code:
const/4 v0, 0x1
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustLocked(Z)V
.line 1315
monitor-exit p0
Add this right after
Code:
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V
Find the following code
Code:
.line 1496
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mKeyguardViewManager:Lcom/android/internal/policy/impl/KeyguardViewManager;
invoke-virtual {v0}, Lcom/android/internal/policy/impl/KeyguardViewManager;->onScreenTurnedOff()V
.line 1497
monitor-exit p0
Add this directly after
Code:
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V
Find the following code
Code:
iput-boolean p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHidden:Z
.line 611
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustUserActivityLocked()V
.line 612
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->adjustStatusBarLocked()V
Add this directly after
Code:
invoke-direct {p0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->resetTorchState()V
Find the following code
Code:
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
.end method
Add this ENTIRE NEW METHOD directly after
Code:
.method private handleSetTorch(Z)V
.locals 6
.parameter "enable"
.prologue
const/4 v5, 0x0
const/4 v4, 0x1
.line 504
:try_start_0
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-nez v1, :cond_1
.line 505
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
.line 506
const/4 v1, 0x1
iput-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
.line 515
:cond_0
:goto_0
return-void
.line 507
:cond_1
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
if-eq v1, p1, :cond_0
.line 508
iput-boolean p1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchEnabled:Z
.line 509
new-instance v0, Landroid/content/Intent;
const-string v1, "net.cactii.flash2.TOGGLE_FLASHLIGHT"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 510
.local v0, intent:Landroid/content/Intent;
const-string v1, "net.cactii.flash2.EXTRA_DISABLE_NOTIFICATION"
const/4 v2, 0x1
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;
.line 511
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mContext:Landroid/content/Context;
invoke-virtual {v1, v0}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
.line 514
.end local v0 #intent:Landroid/content/Intent;
:catch_0
move-exception v1
goto :goto_0
.end method
Find the following code
Code:
:goto_1
:try_start_2
iget-object v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mShowKeyguardWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v0}, Landroid/os/PowerManager$WakeLock;->release()V
Add the following after
Code:
.line 995
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
Find the following code
Code:
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
.line 752
return-void
.end method
Add this ENTIRE NEW METHOD after
Code:
.method private resetTorchState()V
.locals 1
.prologue
.line 1193
iget-boolean v0, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mTorchStateChanged:Z
if-eqz v0, :cond_0
.line 1194
const/4 v0, 0x0
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->handleSetTorch(Z)V
.line 1196
:cond_0
return-void
.end method
Find the following code
Code:
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
goto :goto_1
.end method
Add this ENTIRE NEW METHOD after
Code:
.method public setTorch(Z)V
.locals 5
.parameter "enable"
.prologue
const/16 v4, 0x14
const/4 v3, 0x0
.line 1155
iget-boolean v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mScreenOn:Z
if-eqz v1, :cond_0
.line 1157
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v4}, Landroid/os/Handler;->removeMessages(I)V
.line 1158
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
if-eqz p1, :cond_1
const/4 v2, 0x1
:goto_0
invoke-virtual {v1, v4, v2, v3}, Landroid/os/Handler;->obtainMessage(III)Landroid/os/Message;
move-result-object v0
.line 1159
.local v0, msg:Landroid/os/Message;
iget-object v1, p0, Lcom/android/internal/policy/impl/KeyguardViewMediator;->mHandler:Landroid/os/Handler;
invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
.line 1161
.end local v0 #msg:Landroid/os/Message;
:cond_0
return-void
:cond_1
move v2, v3
.line 1158
goto :goto_0
.end method
Thats it for KeyguardViewMediator.smali. Save the file and close.
Navigate to smali/com/android/internal/policy/impl/PhoneWindowManager.smali
Find the following code
Code:
const/16 v41, 0x3
move/from16 v0, v22
move/from16 v1, v41
Change the next line to the following
Code:
if-ne v0, v1, :cond_2b
Find the following code
Code:
invoke-static/range {v41 .. v42}, Landroid/util/safelog/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_a
:cond_20
Change the next line to the following
Code:
if-eqz v4, :cond_26
Find the following code
Code:
const/16 v41, 0x7d9
move/from16 v0, v38
move/from16 v1, v41
Change the next line to the following
Code:
if-ne v0, v1, :cond_23
Directly after that last change in code, add the following
Code:
:cond_21
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v41, v0
invoke-virtual/range {v41 .. v41}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->isShowingAndNotHidden()Z
move-result v41
if-eqz v41, :cond_22
.line 1275
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v41, v0
move-object/from16 v0, v41
move v1, v8
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->setTorch(Z)V
.line 1276
rem-int/lit8 v41, v31, 0xf
if-nez v41, :cond_22
.line 1277
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
move-object/from16 v41, v0
invoke-virtual/range {v41 .. v41}, Lcom/android/internal/policy/impl/KeyguardViewMediator;->pokeWakelock()V
:cond_22
Here is a sort of tricky part. Starting right after the above code change you need to comb the rest of this entire method for all references to ":cond_X" and increment them by one. THERE ARE A LOT! Take your time and find them all. For example
Code:
:cond_23 becomes :cond_24
:cond_29 becomes :cond_2a
:cond_3f becomes :cond_40
....etc. MAKE SURE YOU FIND THEM ALL! The last one you change should be :cond_47.
[/hide]
Thats it. Save all fines, recompile and push to /system/framework.
Enjoy and hit the Thanks Button!
So many smilies...
Sent from my SPH-L710 running FreeGS3 v1.0.0 Jellybean
Can I flash this on the leaked jelly bean touch wiz?
Humzaman said:
So many smilies...
Sent from my SPH-L710 running FreeGS3 v1.0.0 Jellybean
Click to expand...
Click to collapse
Turn off the code in your settings or just know that the smilies are semicolons followed by a lower case P.
Tornadobarrage said:
Can I flash this on the leaked jelly bean touch wiz?
Click to expand...
Click to collapse
This is not a flashable zip. It's just the files needed to compare and build the mod. It will work with JB and modifying the code I have attached a little.
Hope to see this on all roms soon... I love this feature on MIUI and would love to see it on TW
Maybe we could even get it like MIUI to where as if you press the power button with the light on it will stay on
I agree, that is the most missed mod of MIUI for me... Just so convenient to have such easy access to the flashlight!
I'd love this on Fre3 2.2.
Sent from my SPH-L710 using xda premium
Yo Didact, just wondering... do you play Halo? Or read the books?
_____________________________________________________
Sent from my SPH-L710 running FreeGS3 v1.0.0
"Wake me... when you need me." -Master Chief John 117
This is probably a noob question, but I am trying to use your guide for the Samsung Note II and the android.policy.jar does not contain the smali files. I cannot find the smali files anywhere as a matter of fact. Also to push them back to framework, do I just copy them via recovery using the updater-script or do they get injected into the jar file?
PS: I opened the android.policy.jar with winrar
Humzaman said:
Yo Didact, just wondering... do you play Halo? Or read the books?
_____________________________________________________
Sent from my SPH-L710 running FreeGS3 v1.0.0
"Wake me... when you need me." -Master Chief John 117
Click to expand...
Click to collapse
I do..
Sent from my SPH-L710 using xda premium
---------- Post added at 07:44 PM ---------- Previous post was at 07:41 PM ----------
Humzaman said:
Yo Didact, just wondering... do you play Halo? Or read the books?
_____________________________________________________
Sent from my SPH-L710 running FreeGS3 v1.0.0
"Wake me... when you need me." -Master Chief John 117
Click to expand...
Click to collapse
I just beat the campaign legendary solo with 5 skulls
Sent from my SPH-L710 using xda premium
I got the file deodexed, but now stuck at "Save all fines, recompile and push to /system/framework." How do I "push it"? Is it via ADB? Do I need to create a new dex file?
OK, so I got the smali files extracted. When I merge them with the android.policy.jar from note II, i get the optimizing apps screen followed by a reboot. I suspect the smali files in your ZIP may be specific to GS3.
Question: If I follow the guide to make the changes to the smali files directly from the Note II's android.policy.jar instead of using your files to merge, should that work or are these changes specific to the GS3?
Thanks!
geekasso said:
OK, so I got the smali files extracted. When I merge them with the android.policy.jar from note II, i get the optimizing apps screen followed by a reboot. I suspect the smali files in your ZIP may be specific to GS3.
Question: If I follow the guide to make the changes to the smali files directly from the Note II's android.policy.jar instead of using your files to merge, should that work or are these changes specific to the GS3?
Thanks!
Click to expand...
Click to collapse
You can not just make the changes as is directly to the Note or merge it. You can follow the guide to port it to your device but the registers are not the same e.g. iput-boolean v10, p0, could be iput-boolean v7, p0, on your device. Assuming you already know that and how to fix it and are on TW Jellybean this guide should help you port. :good:
I've been looking EVERYWHERE for this great feature...Does anyone know if this would work on the Galaxy Note II (AT&T)?
Thank you
Thanks Didact74, you are the man! I'm definitely adding this to my rom.
metalfan78 said:
Thanks Didact74, you are the man! I'm definitely adding this to my rom.
Click to expand...
Click to collapse
I just started this mod and on the sprint gs3 the first step is in KeyguardViewMediator$4. I will keep working on this, but I wont have much time today, just thought some people would like to know.
After getting into this a little it's way above my head. There are too many differences between Verizon and Sprint. I get a little lost. Lol
metalfan78 said:
After getting into this a little it's way above my head. There are too many differences between Verizon and Sprint. I get a little lost. Lol
Click to expand...
Click to collapse
Didact made an updated one for MD4...that's what MOAR is using
Maybe ask either rompnit or didact74 if they can share/explain how it was added
Thanks CNexus. Hey Didact74, do you think you can hook me up with the changes for MD4? I'd like to diff what I have so I can learn a little more about what I'm doing. Thanks.
It might help if you call them like this
@rompnit @Didact74

[MOD] [LIH/LJ1/LJ2/LJ4/LJ5/LK4/LKC deodex] back/menu long press kills foreground app

Thanks to Sorg, Poppuri, Pako, Wanam.
2 level reboot menu from Wanam also included.
The mod actually developed by sorg and implemented into poppuri ROM with 2 another mods. One of them is too complicated idnd changes whole logic of hard buttons behavior. I just separated it from another ones.
Warning:
Installing of this mod will:
1. Remove another hard keys related mods like volume long press etc.
2. Remove old TV effect.
I dislike this mods, so they are not implemented.
3. Replace power menu with one from WanamLite ROM.
If you need tis mods, please ask autors of mod or ROM for implementing this one or do it yourself.
v2 Update.
Always vibrate, also if nothing killed.
Kills launchers.
Excluded App list:
com.android.providers.applications
com.sec.android.app.clockpackage
com.sec.android.widgetapp.alarmclock
com.sec.phone
com.android.settings
com.android.defcontainer
com.android.contacts
com.sec.android.app.factorymode
v3 - Will not kill launchers, but always provide feedback
To implement into another ROM/file:
1. Decompile android.policy.jar (both from attachment and from your ROM).
2. Copy PhoneWindowManager$BackLongPress.smali into
\android.policy.jar.out\com\android\internal\policy\impl\
3. Merge changes from \android.policy.jar.out\com\android\internal\policy\impl\PhoneWindowManager.smali to your file.
You can use original file from LIH ROM to find differences.
4. Recompile.
hi, just flash the zip in cwm? Criskelo I LIH.?
You can.
Make backup first.
Better - ask Kriskello for implementing this mod.
It simple.
I hope that will work.
---------- Post added at 08:17 PM ---------- Previous post was at 08:13 PM ----------
So I already have and it seems fully functional, many thanks for your work, it's ok
Doesn't work in my custom LIH rom.
well i don.t have a notebook or a desktop system in the next few days,and i really like this feature...so can someone compile one for wanam 4.0 XXDLJ1?tx
Work in omega 29
Enviado desde mi GT-I9300 usando Tapatalk 2
Work on hyper light DLJ1 1.1.5
finally I don't need to install jkay
Tap talk killed now with kill back key
Envoyé depuis mon GT-I9300 avec Tapatalk
You may name my babies
Insert coin 2.0.0 XDLID. works perfectly, wanted this so long. if i could thousand thank i would
akelon said:
Work in omega 29
Enviado desde mi GT-I9300 usando Tapatalk 2
Click to expand...
Click to collapse
I tried on omega 29 and its not worked any solution will be appriciated. Thanks..
There is no differences in android.policy.jar between LIH and LJ1.
So, the mod should work on LJ1.
akelon said:
Work in omega 29
Enviado desde mi GT-I9300 usando Tapatalk 2
Click to expand...
Click to collapse
Have you recompiled it or just flashed it directly?
I am on Omega v29 and it didn't work after flashing. Could you please share the modded file? Thanks in advance.
tczhang said:
Have you recompiled it or just flashed it directly?
I am on Omega v29 and it didn't work after flashing. Could you please share the modded file? Thanks in advance.
Click to expand...
Click to collapse
Worked here on v29. Just flashed
Sent from my GT-I9300 using Xparent Green Tapatalk 2
d8389 said:
To implement into another ROM/file:
1. Decompile android.policy.jar (both from attachment and from your ROM).
2. Copy PhoneWindowManager$BackLongPress.smali into
\android.policy.jar.out\com\android\internal\policy\impl\
3. Merge changes from \android.policy.jar.out\com\android\internal\policy\impl\PhoneWindowManager.smali to your file.
You can use original file from LIH ROM to find differences.
4. Recompile.
Click to expand...
Click to collapse
Plz give us the guide about "the changes of PhoneWindowManager.smali"
androidphone2012 said:
Plz give us the guide about "the changes of PhoneWindowManager.smali"
Click to expand...
Click to collapse
You should add
Code:
.field private final mBackLongPress:Ljava/lang/Runnable;
.field public mBackLongPressed:I
somewhere in
# instance fields
---
Code:
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$BackLongPress;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$BackLongPress;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
in
Code:
.method public constructor <init>()V
i do it in another similar group
---
in
Code:
.method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J
I increased number of registers by 1 (not sure it's necessary)
and after something like
Code:
const-string v41, "RemoteException when showing recent apps"
move-object/from16 v0, v40
move-object/from16 v1, v41
invoke-static {v0, v1, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
goto :goto_521
.line 3110
.end local v10 #e:Landroid/os/RemoteException;
:cond_532
add
Code:
const/16 v40, 0x4
move/from16 v0, v21
move/from16 v1, v40
if-ne v0, v1, :cond_569
.line 2281
if-eqz v9, :cond_556
if-nez v30, :cond_55f
move-object/from16 v0, p0
const v1, 0x0
iput v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPressed:I
if-nez v22, :cond_569
iget-object v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
invoke-static {}, Landroid/view/ViewConfiguration;->getGlobalActionKeyTimeout()J
move-result-wide v2
const-wide/16 v4, 0x5
mul-long/2addr v2, v4
invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
goto :goto_569
:cond_556
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
:cond_55f
move-object/from16 v0, p0
iget v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPressed:I
if-eqz v1, :cond_569
const-wide/16 v40, -0x1
goto/16 :goto_ad
:cond_569
:goto_569
check also for conflicting goto & cond
d8389 said:
You should add
Code:
.field private static final LONG_PRESS_TIMEOUT:I = 0x190
somewhere in
# static fields
---
Code:
.field private final mBackLongPress:Ljava/lang/Runnable;
.field public mBackLongPressed:I
somewhere in
# instance fields
---
Code:
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$BackLongPress;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$BackLongPress;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
in
Code:
.method public constructor <init>()V
i do it in another similar group
---
in
Code:
.method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J
I increased number of registers by 1 (not sure it's necessary)
and after something like
Code:
const-string v41, "RemoteException when showing recent apps"
move-object/from16 v0, v40
move-object/from16 v1, v41
invoke-static {v0, v1, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
goto :goto_521
.line 3110
.end local v10 #e:Landroid/os/RemoteException;
:cond_532
add
Code:
const/16 v40, 0x4
move/from16 v0, v21
move/from16 v1, v40
if-ne v0, v1, :cond_569
.line 2281
if-eqz v9, :cond_556
if-nez v30, :cond_55f
move-object/from16 v0, p0
const v1, 0x0
iput v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPressed:I
if-nez v22, :cond_569
iget-object v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
invoke-static {}, Landroid/view/ViewConfiguration;->getGlobalActionKeyTimeout()J
move-result-wide v2
const-wide/16 v4, 0x5
mul-long/2addr v2, v4
invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
goto :goto_569
:cond_556
move-object/from16 v0, p0
iget-object v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
:cond_55f
move-object/from16 v0, p0
iget v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPressed:I
if-eqz v1, :cond_569
const-wide/16 v40, -0x1
goto/16 :goto_ad
:cond_569
:goto_569
check also for conflicting goto & cond
Click to expand...
Click to collapse
Thanks, but PhoneWindowManager.smali in Nexus S differs from SGS III Could you give me some tips?
d8389 said:
Thanks to Sorg, Poppuri, Pako, Wanam.
2 level reboot menu from Wanam also included.
The mod actually developed by sorg and implemented into poppuri ROM with 2 another mods. One of them is too complicated idnd changes whole logic of hard buttons behavior. I just separated it from another ones.
Click to expand...
Click to collapse
also working on CheckROM 5.5 DLIB!
@D8329,can you make Pin Code Unlock without pressing OK button mod too ?
works perfectly on foxhound 1.0

[GUIDE] [HOW-TO] [MOD] New Power Menu with Screenshot TW 4.3 MK3/MK5

New Power Menu with Screenshot TW 4.3 MK3/MK5​
Create a Backup First​
For Stock TW 4.3 SPH-L710 MK3/MK5 Builds Only!​Do not flash this on a custom ROM, it replaces important framework files​
Notes:
I know the extended restart menu has been around for quite a while but I really prefer the simplicity and ease of access to the standard Power Menu without that extra keypress.
Features:
- Reboot to Recovery (instant - no prompt)
- Reboot to Download Mode (instant - no prompt)
- Screenshot
Update:
Added a second New Power Menu with Airplane Mode toggle removed.
Just flash over the other one if you want to try it.
[Guide How-to] Power Menu
Download the support files located at the bottom of the post.
framework-res.apk edits:
Add the 3 icons (from the support file) to framework-res/res/drawable-xhdpi
Add 3 new lines to framework-res/res/values/strings:
Code:
<string name="download">Bootloader</string>
<string name="recovery">Recovery</string>
<string name="global_action_screenshot_txt">Screenshot</string>
</resources>
Compile then De-compile the new framework-res.apk. We will need to view the public.xml file later to get a few values for the next section.
android.policy.jar edits:
Add the 6 new smali files (from the support file) to android.policy/com/android/internal/policy/impl.
(In the same path) edit GlobalActions.smali (or diff the stock and modified GlobalActions.smali included in the support file):
Before:
Code:
.field private final mDreamManager:Landroid/service/dreams/IDreamManager;
.field private mHandler:Landroid/os/Handler;
After:
Code:
.field private final mDreamManager:Landroid/service/dreams/IDreamManager;
[COLOR="Blue"].field private mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.field private mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[/COLOR].field private mHandler:Landroid/os/Handler;
Before:
Code:
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
.field private final mShowSilentToggle:Z
After:
Code:
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
[COLOR="Blue"].field mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.field mScreenshotConnection:Landroid/content/ServiceConnection;
.field final mScreenshotLock:Ljava/lang/Object;
.field final mScreenshotTimeout:Ljava/lang/Runnable;
[/COLOR].field private final mShowSilentToggle:Z
Before:
Code:
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
sget-object v4, Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;->Off:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDataNetworkState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
iput-boolean v6, p0, Lcom/android/internal/policy/impl/GlobalActions;->mIsWaitingForEcmExit:Z
iput-boolean v5, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDisplayConfirm:Z
const/4 v4, 0x0
After:
Code:
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
sget-object v4, Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;->Off:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDataNetworkState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;
[COLOR="Blue"] new-instance v4, Ljava/lang/Object;
invoke-direct {v4}, Ljava/lang/Object;-><init>()V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotLock:Ljava/lang/Object;
const/4 v4, 0x0
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$29;
invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$29;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotTimeout:Ljava/lang/Runnable;
[/COLOR]
iput-boolean v6, p0, Lcom/android/internal/policy/impl/GlobalActions;->mIsWaitingForEcmExit:Z
iput-boolean v5, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDisplayConfirm:Z
const/4 v4, 0x0
New method:
Before:
Code:
.method static synthetic access$1700(Lcom/android/internal/policy/impl/GlobalActions;)Z
.locals 1
iget-boolean v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mKeyguardShowing:Z
return v0
.end method
.method static synthetic access$1800(Lcom/android/internal/policy/impl/GlobalActions;)Lcom/android/internal/policy/impl/GlobalActions$ConfirmDialogReceiver;
.locals 1
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mConfirmDialogReceiver:Lcom/android/internal/policy/impl/GlobalActions$ConfirmDialogReceiver;
return-object v0
.end method
After:
Code:
.method static synthetic access$1700(Lcom/android/internal/policy/impl/GlobalActions;)Z
.locals 1
iget-boolean v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mKeyguardShowing:Z
return v0
.end method
[COLOR="Blue"].method static synthetic access$1701(Lcom/android/internal/policy/impl/GlobalActions;)V
.locals 0
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->takeScreenshot()V
return-void
.end method
[/COLOR]
.method static synthetic access$1800(Lcom/android/internal/policy/impl/GlobalActions;)Lcom/android/internal/policy/impl/GlobalActions$ConfirmDialogReceiver;
.locals 1
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mConfirmDialogReceiver:Lcom/android/internal/policy/impl/GlobalActions$ConfirmDialogReceiver;
return-object v0
.end method
Before:
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$6;
const v1, 0x1080a60
const v2, 0x10401c8
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$6;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$7;
const v1, 0x1080a61
const v2, 0x10401c9
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
After:
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$6;
const v1, 0x1080a60
const v2, 0x10401c8
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$6;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[COLOR="Blue"] new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$Download;
const v1, 0x1081088
const v2, 0x1040a0b
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$Download;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$Recovery;
const v1, 0x1081089
const v2, 0x1040a0c
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$Recovery;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$28;
const v1, 0x108108a
const v2, 0x1040a0d
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$28;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[/COLOR]
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$7;
const v1, 0x1080a61
const v2, 0x10401c9
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
Edit above section
Before continuing, go back to the new DECOMPILED framework-res.apk and open res/values/public.xml with notepad++.
Search for <public type="drawable" name="tw_ic_download"
- All 3 of our new public drawable values for the png images will be listed together.
Search for <public type="string" name="download"
- All 3 of our new public string values will be listed together.
Now, using these we will edit the 3 new sections above for the these new public values. Instead of jumping back and forth in the public.xml, I do the drawables (V1 values) all at once and then go to the strings section and do the strings (V2 values) next.
Code:
<public type="drawable" name="tw_ic_download" id="0x01081088" />
<public type="drawable" name="tw_ic_recovery" id="0x01081089" />
<public type="drawable" name="tw_ic_screenshot" id="0x0108108a" />
Code:
<public type="string" name="download" id="0x01040a0b" />
<public type="string" name="recovery" id="0x01040a0c" />
<public type="string" name="global_action_screenshot_txt" id="0x01040a0d" />
For instance, we are editing these values:
Download:
const v1, 0x1081088 (V1 = DRAWABLE)
const v2, 0x1040a0b (V2 = STRING)
Important Note:
Please note that the leading zero is not used from the public value.
Next, search for const/16 v0, 0x8
Replace this entire section:
Before:
Code:
[COLOR="Red"] const/16 v0, 0x8
new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x1
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mTalkBack:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x2
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x3
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDataModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x4
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x5
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x6
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mBugReport:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x7
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mLonglife:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
[/COLOR]
After:
Code:
[COLOR="Blue"] const/16 v0, 0x8
new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mPowerOff:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x1
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAccessiblityShortcut:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x2
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mTalkBack:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x3
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
const/4 v1, 0x4
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x5
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x6
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x7
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
[/COLOR]
New method. Search for # virtual methods and insert this method BEFORE that line:
Code:
[COLOR="Blue"].method private takeScreenshot()V
.locals 8
iget-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotLock:Ljava/lang/Object;
monitor-enter v4
:try_start_0
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
if-eqz v3, :cond_0
monitor-exit v4
:goto_0
return-void
:cond_0
new-instance v0, Landroid/content/ComponentName;
const-string v3, "com.android.systemui"
const-string v5, "com.android.systemui.screenshot.TakeScreenshotService"
invoke-direct {v0, v3, v5}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V
new-instance v2, Landroid/content/Intent;
invoke-direct {v2}, Landroid/content/Intent;-><init>()V
invoke-virtual {v2, v0}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$30;
invoke-direct {v1, p0}, Lcom/android/internal/policy/impl/GlobalActions$30;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
const/4 v5, 0x1
sget-object v6, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;
invoke-virtual {v3, v2, v1, v5, v6}, Landroid/content/Context;->bindServiceAsUser(Landroid/content/Intent;Landroid/content/ServiceConnection;ILandroid/os/UserHandle;)Z
move-result v3
if-eqz v3, :cond_1
iput-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotConnection:Landroid/content/ServiceConnection;
iget-object v3, p0, Lcom/android/internal/policy/impl/GlobalActions;->mHandler:Landroid/os/Handler;
iget-object v5, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshotTimeout:Ljava/lang/Runnable;
const-wide/16 v6, 0x2710
invoke-virtual {v3, v5, v6, v7}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
:cond_1
monitor-exit v4
goto :goto_0
:catchall_0
move-exception v3
monitor-exit v4
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v3
.end method
[/COLOR]
[Guide How-to] Remove a Menu Item
Search for const/16 v0, 0x8
Each menu item of this array is only 3 lines. We will remove the Airplane Mode toggle. Delete or comment out these 3 lines.
Code:
const/4 v1, 0x3
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
aput-object v2, v0, v1
Since we have removed a menu item, the array constructor const/16 v0, 0x8
needs to be changed to const/16 v0, 0x7 (one less item 8-1=7 ).
Also, all the construct lines after the item you have just deleted need to be renumbered so they remain sequential. Here is the code changed after the item has been removed.
Code:
const/4 v1, 0x[COLOR="Red"]3[/COLOR]
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x[COLOR="Red"]4[/COLOR]
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDownload:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x[COLOR="Red"]5[/COLOR]
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRecovery:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
const/4 v1, 0x[COLOR="Red"]6[/COLOR]
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v2, v0, v1
Credits: Huge credits to @rompnit for the use of the Screenshot method for this mod.
Do you have to be on a deodexed rom? Just flashed this twice on stock MK3 and I'm getting nothin'.
Sent from my SPH-L710 using XDA Premium 4 mobile app
marcran75 said:
Do you have to be on a deodexed rom? Just flashed this twice on stock MK3 and I'm getting nothin'.
Click to expand...
Click to collapse
Yes, 99% of any mods are going to be for deodexed. That is partly why it is extremely difficult to find an odexed custom rom.
tdunham said:
Yes, 99% of any mods are going to be for deodexed. That is partly why it is extremely difficult to find an odexed custom rom.
Click to expand...
Click to collapse
That's what I figured but thought I would ask anyways.
Sent from my SPH-L710 using XDA Premium 4 mobile app
another awesome mod !!! love it - so happy you have started making these - keep em' coming !!!!
VM SIII - jdsingle76's MK5 4.3
decimalman's TW dkp kernel
Between you and @CNexus, I will be killing someone soon with all the extra theming you have me doing. Nice job...
[email protected]'$ [email protected]@XY
marcran75 said:
Do you have to be on a deodexed rom? Just flashed this twice on stock MK3 and I'm getting nothin'.
Sent from my SPH-L710 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Move android.policy.jar and android.policy.jar.odex to your sdcard (to make a "backup" of them and delete at the same time) then flash this and it will work.
Deodexed mods can be used on odex, but not the other way around. Only catch is you gotta delete the affected odex files or else the system will preload those cache files and ignore the new file
CNexus said:
Move android.policy.jar and android.policy.jar.odex to your sdcard (to make a "backup" of them and delete at the same time) then flash this and it will work.
Deodexed mods can be used on odex, but not the other way around. Only catch is you gotta delete the affected odex files or else the system will preload those cache files and ignore the new file
Click to expand...
Click to collapse
Tried this and got stock at boot screen. Pulled battery and still the same.
marcran75 said:
Tried this and got stock at boot screen. Pulled battery and still the same.
Click to expand...
Click to collapse
Hmm...I've done this tons of times before on stock odexed and it's worked
Check the zip to see what (if any) other files are affected and move the odex files for those, then try flashing again
Is there anyway you could make a guide. ...I would love this on Wicked sensations.
http://i.imgur.com/qrByUGN.jpg
remotehugger said:
VM SIII - jdsingle76's MK5 4.3
decimalman's TW dkp kernel
Click to expand...
Click to collapse
Notice youre running virgin mobile... Thanks to tdunham, I have put together a zip to get the virgin mobile network running on the wicked sensations ROM... I have stock 4.3 android thru my ota update and with the zip it works perfect in VM.
ROM is here --> http://forum.xda-developers.com/showthread.php?t=2581010
Read the second post for the virgin mobile fix..
Just bored and saw that part of your post lol
Sent from my Virgin Mobile Galaxy S3, running Wicked Sensations Rom powered by DKP kernel, using Tapatalk 4.
bigpappags3 said:
Is there anyway you could make a guide. ...I would love this on Wicked sensations.
http://i.imgur.com/qrByUGN.jpg
Click to expand...
Click to collapse
Shut up clown. Don't give that other clown any ideas... Soon i'll have a 10 in 1 power menu and 60 toggles to theme...
[email protected]'$ [email protected]@XY
Confirm working on wicked and is nice. Nice mod
Sent from my SPH-L710 using xda app-developers app
Thanks for this tdunham. I already clicked thanks but this is just awesome. :thumbup:
Awesome mod. Thank you very much!
Update:
Added to the OP a second New Power Menu with Airplane Mode toggle removed.
Just flash over the other one if you want to try it.
I tried this and it force closes my phone settings (sure it is related to something I did to my personal framework-res.apk). So my question is if you could tell me which if any xmls need modified?
notmyepic said:
I tried this and it force closes my phone settings (sure it is related to something I did to my personal framework-res.apk). So my question is if you could tell me which if any xmls need modified?
Click to expand...
Click to collapse
I won't do full guide until later:
Code:
framework-res.apk edits:
Add the 3 icons (from the support file) to framework-res/res/drawable-xhdpi
Add 3 new lines to framework-res/res/values/strings:
<string name="download">Bootloader</string>
<string name="recovery">Recovery</string>
<string name="global_action_screenshot_txt">Screenshot</string>
</resources>
Still no guarantees if other changes were made that alter public values that get generated when framework-res is compiled.
Hey man, I changed he pngs to match the rest of Dandroid. In the 3rd option down instead of saying "download mode" it says "bootloader". Where would I go to change this?
Chad The Pathfinder said:
Hey man, I changed he pngs to match the rest of Dandroid. In the 3rd option down instead of saying "download mode" it says "bootloader". Where would I go to change this?
Click to expand...
Click to collapse
It's in the post before this one.
Edit: Sorry, meant the post above yours.

[Guide/Tut]Adding 5 way reboot menu lollipop

Hello guys Here is a small tut on how to add 5 way advanced reboot menu
This is only for Deodexed files
The Files which need work are
Framework-res.apk
android.policy.jar
framework.jar
services.jar
Things You need are Baksmali version of 1.5
Here you can get it Click here
Apktool
signer tool
Thinking Brain and Patience
First We start with Framework-res.apk
Decompile it
Add these lines here in file /res/values/strings.xml
Code:
<string name="apm_reboot">Reboot</string>
<string name="apm_hotreboot">Hot reboot</string>
<string name="apm_recovery">Recovery</string>
<string name="apm_bootloader">Bootloader</string>
<string name="apm_safemode">Safe mode</string>
Then add these files to images to framework-res.apk View attachment drawable-hdpi.zip
Then Compile and Decompile again ( for public ids )
Ok Now Decompile android.policy.jar ( using Baksmali )
After Decompile Place the files to ( com/android/internal/policy/impl ) path View attachment android.policy.jar.zip
Now After Placing These 7 files open them in NotePad++ ( all 7 files )
Look For the .method private constructor <init> now Replace the Public Ids as per framework-res.apk created ( dont confuse everything was written )
Now Look For GlobalActions.smali and open it on notepad++
Look for
Code:
Lcom/android/internal/policy/impl/GlobalActions$PowerAction;
Then add these lines Above that
Code:
Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsReceiver;,
Lcom/android/internal/policy/impl/GlobalActions$PowerActionBootloader;,
Lcom/android/internal/policy/impl/GlobalActions$PowerActionHotReboot;,
Lcom/android/internal/policy/impl/GlobalActions$PowerActionReboot;,
Lcom/android/internal/policy/impl/GlobalActions$PowerActionRecovery;,
Lcom/android/internal/policy/impl/GlobalActions$PowerActionSafemode;,
Look For
Code:
.field private mHandler:Landroid/os/Handler;
Add Below
Code:
.field private mGlobalActionsReceiver:Landroid/content/BroadcastReceiver;
Look For
Code:
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$7;
invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
Add After That These lines
Code:
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsReceiver;
invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsReceiver;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mGlobalActionsReceiver:Landroid/content/BroadcastReceiver;
Look for
Code:
iget-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {p1, v4, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
Add after that code These lines
Code:
new-instance v1, Landroid/content/IntentFilter;
invoke-direct {v1}, Landroid/content/IntentFilter;-><init>()V
const-string v4, "android.intent.action.GLOBAL_ACTION_DIALOG"
invoke-virtual {v1, v4}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
iget-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mGlobalActionsReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {p1, v4, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
Look For
Code:
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$PowerAction;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$PowerAction;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
Add After that
Code:
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->getSysAPMTweak()Z
move-result v2
if-eqz v2, :cond_skip
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialogAdv;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialogAdv;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
:cond_skip
Find this Method
Code:
.method private createDialog()Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
After that Add this method ( meant after .end method )
Code:
.method private createDialogAdv()Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
.locals 13
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$1;
const v2, 0x1080377 #drawable ic_lock_airplane_mode
const v3, 0x1080379 #drawable ic_lock_airplane_mode_off
const v4, 0x10400fe #string global_actions_toggle_airplane_mode
const v5, 0x10400ff #string global_actions_airplane_mode_on_status
const v6, 0x1040100 #string global_actions_airplane_mode_off_status
move-object v1, p0
invoke-direct/range {v0 .. v6}, Lcom/android/internal/policy/impl/GlobalActions$1;-><init>(Lcom/android/internal/policy/impl/GlobalActions;IIIII)V
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;
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$PowerActionReboot;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$PowerActionReboot;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$PowerActionHotReboot;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$PowerActionHotReboot;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$PowerActionBootloader;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$PowerActionBootloader;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$PowerActionRecovery;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$PowerActionRecovery;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$PowerActionSafemode;
const/4 v2, 0x0
invoke-direct {v1, p0, v2}, Lcom/android/internal/policy/impl/GlobalActions$PowerActionSafemode;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
const/4 v1, 0x0
invoke-direct {v0, p0, v1}, Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAdapter:Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
new-instance v12, Lcom/android/internal/app/AlertController$AlertParams;
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-direct {v12, v0}, Lcom/android/internal/app/AlertController$AlertParams;-><init>(Landroid/content/Context;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAdapter:Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
iput-object v0, v12, Lcom/android/internal/app/AlertController$AlertParams;->mAdapter:Landroid/widget/ListAdapter;
iput-object p0, v12, Lcom/android/internal/app/AlertController$AlertParams;->mOnClickListener:Landroid/content/DialogInterface$OnClickListener;
const/4 v0, 0x1
iput-boolean v0, v12, Lcom/android/internal/app/AlertController$AlertParams;->mForceInverseBackground:Z
new-instance v10, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-direct {v10, v0, v12}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;-><init>(Landroid/content/Context;Lcom/android/internal/app/AlertController$AlertParams;)V
const/4 v0, 0x0
invoke-virtual {v10, v0}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->setCanceledOnTouchOutside(Z)V
invoke-virtual {v10}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->getListView()Landroid/widget/ListView;
move-result-object v0
const/4 v1, 0x1
invoke-virtual {v0, v1}, Landroid/widget/ListView;->setItemsCanFocus(Z)V
invoke-virtual {v10}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->getListView()Landroid/widget/ListView;
move-result-object v0
invoke-virtual {v10}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->getWindow()Landroid/view/Window;
move-result-object v0
const/16 v1, 0x7d9
invoke-virtual {v0, v1}, Landroid/view/Window;->setType(I)V
invoke-virtual {v10, p0}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->setOnDismissListener(Landroid/content/DialogInterface$OnDismissListener;)V
return-object v10
.end method
Now find
Code:
# virtual methods
Add after this below code
Code:
.method public getSysAPMTweak()Z
.locals 4
const/4 v0, -0x1
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "tweaks_apm"
const/4 v3, -0x2
invoke-static {v1, v2, v0, v3}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v1
if-nez v1, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x1
goto :goto_0
.end method
Now Find this method
Code:
.method public showDialog(ZZ)V
After that Add this method (after .end method )
Code:
.method public showDialogAdv()V
.locals 2
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->createDialogAdv()Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
move-result-object v0
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDialog:Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
invoke-direct {p0}, Lcom/android/internal/policy/impl/GlobalActions;->prepareDialog()V
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDialog:Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
invoke-virtual {v0}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->show()V
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mDialog:Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
invoke-virtual {v0}, Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;->getWindow()Landroid/view/Window;
move-result-object v0
invoke-virtual {v0}, Landroid/view/Window;->getDecorView()Landroid/view/View;
move-result-object v0
const/high16 v1, 0x10000
invoke-virtual {v0, v1}, Landroid/view/View;->setSystemUiVisibility(I)V
return-void
.end method
Now recompile Classes and replace the classes.dex with android.policy.jar and sign it
Here it was end with the Android.policy.jar ( be sure with Public ids )
If you have any doubts or conflict as not found just compare my file to fix this ( compile file View attachment compare.zip )
Next step will be in second post (below )
Continue 2 Framwework.jar
Decompile framwork.jar
Find and open WindowManagerPolicy$WindowManagerFuncs.smali
Look for
Code:
.method public abstract rebootSafeMode(Z)V
.end method
Add method before that this method
Code:
.method public abstract reboot(Ljava/lang/String;Z)V
.end method
now recompile and sign the file
Now go for third method in next post ( final )
Final part Service.jar
First Decompile the service.jar
and then disable the signature verification
Tut is here
then look for services\smali\com\android\server\wm\WindowManagerService.smali
open it in notepad++ and find this method
Code:
.method public rebootSafeMode(Z)V
Before that method Add this method
Code:
.method public reboot(Ljava/lang/String;Z)V
.locals 3
iget-object v0, p0, Lcom/android/server/wm/WindowManagerService;->mContext:Landroid/content/Context;
invoke-static {v0, p1, p2}, Lcom/android/server/power/ShutdownThread;->reboot(Landroid/content/Context;Ljava/lang/String;Z)V
return-void
.end method
Now recompile the service.jar
So the compiled files are Framework-re.apk, framework.jar, service.jar, android.policy.jar
Now replace then and reboot and you are done guys
Have fun
Credits:- lyapota and S0bes
Great work bro. Keep up the good work
Awesome Tut RXS bro ^^
Very usefull
Verstuurd vanaf mijn D6603 met Tapatalk
Awesome tutorial bro!!
Was waiting for it
Very cool, thanks!
Is there anyway to stop the reboot menu from showing if the device is locked? It'd be handy if somebody couldn't steal my phone and get into recovery..
Just tested, Aaaaaand it's working
Thanks bro!
venkat kamesh said:
Decompile framwork.jar
Find and open WindowManagerPolicy$WindowManagerFuncs.smali
Look for
Code:
.method public abstract rebootSafeMode(Z)V
.end method
Add method before that this method
Code:
.method public abstract reboot(Ljava/lang/String;Z)V
.end method
now recompile and sign the file
Now go for third method in next post ( final )
Click to expand...
Click to collapse
@venkat kamesh First of all, thank you for sharing this tut! Please mention where this file is so that newbies can find it instead of searching in whole directory.. smali_classes2/android/view/WindowManagerPolicy$WindowManagerFuncs.smali
the images you have given are little blurry so I have created new set of images if you want to share..Please find it in attachments..
Now about my experience, I tried this guide on CM12.1 but ran into some issues like all the buttons were performing only soft reboot (Hot reboot) instead of carrying out their functionality..Don't know the cause though! Will figure it out soon..
venkat kamesh said:
Decompile framwork.jar
Find and open WindowManagerPolicy$WindowManagerFuncs.smali
Look for
Code:
.method public abstract rebootSafeMode(Z)V
.end method
Add method before that this method
Code:
.method public abstract reboot(Ljava/lang/String;Z)V
.end method
now recompile and sign the file
Now go for third method in next post ( final )
Click to expand...
Click to collapse
WindowManagerPolicy$WindowManagerFuncs.smali not found
Hi @venkat kamesh first thanks for this tutorial. I ve follow this but i dont get any result. I tried with the files for the z1 firmware .236. could you please have a look? if there is something wrong? I attach the zip i ve made. cheers
advance_power.zip 27.6 MB
https://mega.nz/#!fxB3WLDZ!K46Adp8rvyG3EjUaIYgCk1ePSorO-FgL7Lxs1Obehtg
Someone knows how to change the "Smokkie Reboot Options" string?
http://i.imgur.com/reu88bh.png
BlackMesa123 said:
Someone knows how to change the "Smokkie Reboot Options" string?
http://i.imgur.com/reu88bh.png
Click to expand...
Click to collapse
In framework-res.apk >decompile>res>values>strings>search for "Smokkie Reboot Options", replace to whatever you want.
jitz975 said:
In framework-res.apk >decompile>res>values>strings>search for "Smokkie Reboot Options", replace to whatever you want.
Click to expand...
Click to collapse
Notepad++ says that it hasnt finded it
juanpirulo said:
Hi @venkat kamesh first thanks for this tutorial. I ve follow this but i dont get any result. I tried with the files for the z1 firmware .236. could you please have a look? if there is something wrong? I attach the zip i ve made. cheers
advance_power.zip27.6 MB
https://mega.nz/#!fxB3WLDZ!K46Adp8rvyG3EjUaIYgCk1ePSorO-FgL7Lxs1Obehtg
Click to expand...
Click to collapse
New apktool don't give result of adding codes
Best thing is
Try using baksmali bro
It works
BlackMesa123 said:
Someone knows how to change the "Smokkie Reboot Options" string?
http://i.imgur.com/reu88bh.png
Click to expand...
Click to collapse
Hmm you need to define the header code in smali
:good::good::good:
If i press recovery,bootloader,reboot and etc. buttons,phone hot rebooting. It can't start on recovery ,bootloader mode. Any solution?
Hi @venkat kamesh bro I don't have the code
Code:
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$7;
invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
iput-object v4, p0, Lcom/android/internal/policy/impl/GlobalActions;->mBroadcastReceiver:Landroid/content/BroadcastReceiver;
in my GlobalActions.smali and the GlobalActions.smali file you provide for comparison
Can you look at it?
venkat kamesh said:
New apktool don't give result of adding codes
Best thing is
Try using baksmali bro
It works
Hmm you need to define the header code in smali
Click to expand...
Click to collapse
Any response to my latest post?
lordriguez said:
Any response to my latest post?
Click to expand...
Click to collapse
hmm that line was not much mandatory bro ( i meant which haven't found )
in this code
Code:
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$[COLOR="Red"]7[/COLOR];
the red value may be varied
you can look for 10 or 12 or what ever there ( this line is example of persists to add new instance )
in my smali i had 7 and other
i had aaded after that line
hope you got what i mean
good luck bro

[Guide][tut] Enable/Disable Navigation Bar Swipe to sleep/Lock

Hello guys
i had got you a new tut
Which is Swipe on nav bar to sleep/lock
Lets start work
All you need is Deodexed Systemui.apk, settings.apk and Good patience ( if you dont have any of these then just dont try this )
Ok
1. Decompile SystemUI.apk
2. Now download this View attachment SystemUI.zip and merge to your systemui.apk
3. Open com/android/systemui/statusbar/phone/NavigationBarView.smali
Look for this annotation
Code:
Lcom/android/systemui/statusbar/phone/NavigationBarView$OnVerticalChangedListener;,
Below that add this annotation
Code:
Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;,
Now look for
Code:
.field final mDisplay:Landroid/view/Display;
Below that add these definitions
Code:
.field private mDownTime:J
.field private mDownX:F
.field private mDownY:F
.field private mIsDown:Z
.field private mPowerManager:Landroid/os/PowerManager;
.field mSwipe2SleepActive:Z
Now look for this method ( this #1 post will have completely on this method only dont confuse )
Code:
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
in that method first Change .locals 4 to .locals 6
after this
Code:
const/4 v3, 0x0
add this
Code:
const/4 v4, 0x1
look for this line
Code:
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mImeSwitcherClickListener:Landroid/view/View$OnClickListener;
Below that add this
Code:
iput-boolean v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mIsDown:Z
Look for this line
Code:
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDisplay:Landroid/view/Display;
Below that add this
Code:
const-string v1, "power"
invoke-virtual {p1, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/os/PowerManager;
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mPowerManager:Landroid/os/PowerManager;
Now look for this line
Code:
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mTaskSwitchHelper:Lcom/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper;
Below that add this
Code:
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->getIcons(Landroid/content/res/Resources;)V
Now look for this line
Code:
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->getIcons(Landroid/content/res/Resources;)V
Replace the above line with this code
Code:
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v3, "navbar_swipe_to_sleep"
invoke-static {v1, v3, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-ne v1, v4, :cond_0
:goto_0
iput-boolean v4, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mSwipe2SleepActive:Z
.line 207
new-instance p1, Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mHandler:Lcom/android/systemui/statusbar/phone/NavigationBarView$H;
invoke-direct {p1, p0, v1}, Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/NavigationBarView;Landroid/os/Handler;)V
.line 208
.local p1, "settingsObserver":Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;
invoke-virtual {p1}, Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;->observe()V
Now in the same method you will find this return-void
Below that add this code
Code:
.end local p1 # "settingsObserver":Lcom/android/systemui/statusbar/phone/NavigationBarView$SettingsObserver;
:cond_0
move v4, v2
.line 205
goto :goto_0
save and Continued in 2nd and 3rd post
part 2
In the same file
4. continue
Look for this method
Code:
.method private adjustExtraKeyGravity(Landroid/view/View;Z)V
Above that method
add these methods
Code:
.method static synthetic access$200(Lcom/android/systemui/statusbar/phone/NavigationBarView;)Landroid/content/Context;
.locals 1
.param p0, "x0" # Lcom/android/systemui/statusbar/phone/NavigationBarView;
.prologue
.line 64
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mContext:Landroid/content/Context;
return-object v0
.end method
.method static synthetic access$300(Lcom/android/systemui/statusbar/phone/NavigationBarView;)Landroid/content/Context;
.locals 1
.param p0, "x0" # Lcom/android/systemui/statusbar/phone/NavigationBarView;
.prologue
.line 64
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mContext:Landroid/content/Context;
return-object v0
.end method
5. Look for this method
Code:
.method private notifyVerticalChangedListener(Z)V
Above that method add these code
Code:
.method private mySwipeDetector(FFJFFJ)V
.locals 11
.param p1, "e1X" # F
.param p2, "e1Y" # F
.param p3, "e1Time" # J
.param p5, "e2X" # F
.param p6, "e2Y" # F
.param p7, "e2Time" # J
.prologue
.line 276
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mContext:Landroid/content/Context;
invoke-virtual {v6}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v6
invoke-virtual {v6}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;
move-result-object v6
iget v6, v6, Landroid/content/res/Configuration;->orientation:I
const/4 v7, 0x1
if-ne v6, v7, :cond_1
const/4 v2, 0x1
.line 277
.local v2, "isPortrait":Z
:goto_0
sub-float v0, p5, p1
.line 278
.local v0, "distanceX":F
sub-float v1, p6, p2
.line 279
.local v1, "distanceY":F
sub-long v6, p7, p3
long-to-float v6, v6
div-float v6, v0, v6
const/high16 v7, 0x447a0000 # 1000.0f
mul-float v4, v6, v7
.line 280
.local v4, "velocityX":F
sub-long v6, p7, p3
long-to-float v6, v6
div-float v6, v1, v6
const/high16 v7, 0x447a0000 # 1000.0f
mul-float v5, v6, v7
.line 281
.local v5, "velocityY":F
const-string v3, ""
.line 282
.local v3, "summary":Ljava/lang/String;
if-eqz v2, :cond_2
.line 283
invoke-static {v0}, Ljava/lang/Math;->abs(F)F
move-result v6
invoke-static {v1}, Ljava/lang/Math;->abs(F)F
move-result v7
cmpl-float v6, v6, v7
if-lez v6, :cond_0
invoke-static {v0}, Ljava/lang/Math;->abs(F)F
move-result v6
const/high16 v7, 0x43960000 # 300.0f
cmpl-float v6, v6, v7
if-lez v6, :cond_0
const/high16 v6, -0x3db80000 # -50.0f
cmpl-float v6, p6, v6
if-lez v6, :cond_0
invoke-static {v4}, Ljava/lang/Math;->abs(F)F
move-result v6
const/high16 v7, 0x447a0000 # 1000.0f
cmpl-float v6, v6, v7
if-lez v6, :cond_0
.line 285
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mPowerManager:Landroid/os/PowerManager;
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v8
invoke-virtual {v6, v8, v9}, Landroid/os/PowerManager;->goToSleep(J)V
.line 303
:cond_0
:goto_1
return-void
.line 276
.end local v0 # "distanceX":F
.end local v1 # "distanceY":F
.end local v2 # "isPortrait":Z
.end local v3 # "summary":Ljava/lang/String;
.end local v4 # "velocityX":F
.end local v5 # "velocityY":F
:cond_1
const/4 v2, 0x0
goto :goto_0
.line 298
.restart local v0 # "distanceX":F
.restart local v1 # "distanceY":F
.restart local v2 # "isPortrait":Z
.restart local v3 # "summary":Ljava/lang/String;
.restart local v4 # "velocityX":F
.restart local v5 # "velocityY":F
:cond_2
invoke-static {v1}, Ljava/lang/Math;->abs(F)F
move-result v6
invoke-static {v0}, Ljava/lang/Math;->abs(F)F
move-result v7
cmpl-float v6, v6, v7
if-lez v6, :cond_0
invoke-static {v1}, Ljava/lang/Math;->abs(F)F
move-result v6
const/high16 v7, 0x43960000 # 300.0f
cmpl-float v6, v6, v7
if-lez v6, :cond_0
const/high16 v6, -0x3db80000 # -50.0f
cmpl-float v6, p5, v6
if-lez v6, :cond_0
invoke-static {v5}, Ljava/lang/Math;->abs(F)F
move-result v6
const/high16 v7, 0x447a0000 # 1000.0f
cmpl-float v6, v6, v7
if-lez v6, :cond_0
.line 300
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mPowerManager:Landroid/os/PowerManager;
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v8
invoke-virtual {v6, v8, v9}, Landroid/os/PowerManager;->goToSleep(J)V
goto :goto_1
.end method
6. Now Find this
Code:
# virtual methods
Below that add this code
Code:
.method public dp2Px(F)I
.locals 3
.param p1, "dp" # F
.prologue
.line 544
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v1
invoke-virtual {v1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
move-result-object v1
iget v0, v1, Landroid/util/DisplayMetrics;->density:F
.line 545
.local v0, "scale":F
mul-float v1, p1, v0
const/high16 v2, 0x3f000000 # 0.5f
add-float/2addr v1, v2
float-to-int v1, v1
return v1
.end method
7. Look for this method
Code:
.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
In this code Change .locals 3 to .locals 4
Look for this
Code:
.local v1, "intercept":Z
if-nez v1, :cond_[COLOR="Red"]0[/COLOR]
Change to
Code:
.local v1, "intercept":Z
if-nez v1, :cond_[COLOR="red"]1[/COLOR]
Look for this line
Code:
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDelegateIntercepted:Z
Below that add this code
Code:
iget-boolean v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mSwipe2SleepActive:Z
if-eqz v2, :cond_0
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
move-result v2
if-nez v2, :cond_0
.line 318
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v2
iput-wide v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDownTime:J
.line 319
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v2
iput v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDownX:F
.line 320
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
move-result v2
iput v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDownY:F
.line 321
const/4 v2, 0x1
iput-boolean v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mIsDown:Z
.line 329
:cond_0
After adding this, just below 2 lines you will find this
After return v1 you will find this
:cond_0 to :cond_1
8. Now look for this method
Code:
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
Replace complete method from the below method
Code:
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.locals 11
.param p1, "event" # Landroid/view/MotionEvent;
.prologue
const/4 v10, 0x1
.line 248
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mSwipe2SleepActive:Z
if-eqz v1, :cond_0
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
move-result v1
if-ne v1, v10, :cond_0
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mIsDown:Z
if-eqz v1, :cond_0
.line 249
const/4 v1, 0x0
iput-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mIsDown:Z
.line 250
iget v2, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDownX:F
iget v3, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDownY:F
iget-wide v4, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDownTime:J
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v6
invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F
move-result v7
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v8
move-object v1, p0
invoke-direct/range {v1 .. v9}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mySwipeDetector(FFJFFJ)V
.line 252
:cond_0
invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/phone/NavigationBarView;->initDownStates(Landroid/view/MotionEvent;)V
.line 217
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDelegateIntercepted:Z
if-nez v1, :cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mTaskSwitchHelper:Lcom/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper;
invoke-virtual {v1, p1}, Lcom/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result v1
if-eqz v1, :cond_1
move v1, v10
.line 227
:goto_0
return v1
.line 220
:cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDeadZone:Lcom/android/systemui/statusbar/policy/DeadZone;
if-eqz v1, :cond_2
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
move-result v1
const/4 v2, 0x4
if-ne v1, v2, :cond_2
.line 221
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDeadZone:Lcom/android/systemui/statusbar/policy/DeadZone;
invoke-virtual {v1, p1}, Lcom/android/systemui/statusbar/policy/DeadZone;->poke(Landroid/view/MotionEvent;)V
.line 223
:cond_2
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDelegateHelper:Lcom/android/systemui/statusbar/DelegateViewHelper;
if-eqz v1, :cond_3
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDelegateIntercepted:Z
if-eqz v1, :cond_3
.line 224
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/NavigationBarView;->mDelegateHelper:Lcom/android/systemui/statusbar/DelegateViewHelper;
invoke-virtual {v1, p1}, Lcom/android/systemui/statusbar/DelegateViewHelper;->onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
.line 225
.local v0, "ret":Z
if-eqz v0, :cond_3
move v1, v10
goto :goto_0
.line 227
.end local v0 # "ret":Z
:cond_3
invoke-super {p0, p1}, Landroid/widget/LinearLayout;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result v1
goto :goto_0
.end method
9. Finally save and compile/sign and replace the systemui.apk
10. Now time to add switch from setting
Look for the below 3rd post
settings
Welcome to easy part on adding the option to hide/show in settings
1. Decompile the settings.apk
2. Download this View attachment Settings.zip and merge to your settings
3. Add the below code to your settings ( i had added to my own settings ) and your wish
Code:
<PreferenceScreen android:title="Navigation" android:key="navigation" android:fragment="com.android.settings.rz.Navigation" />
4. Compile it and Decompile and open
Settings.apk/smali/com/android/settings/rz/Navigation.smali
5. Compare the Public ID and replace it and recompile
6. God you did man,,, now replace and have fun
Thanks to atl4ntis for his Awesome rom Cataclysm and Cyanogenmod
I gonna try now ?
Working. ? ?
Works fine bro thanks a lot
woww.good job,thank bro
venkat kamesh said:
Welcome to easy part on adding the option to hide/show in settings
1. Decompile the settings.apk
2. Download this View attachment 3617852 and merge to your settings
3. Add the below code to your settings ( i had added to my own settings ) and your wish
Code:
<PreferenceScreen android:title="Navigation" android:key="navigation" android:fragment="com.android.settings.rz.Navigation" />
4. Compile it and Decompile and open
Settings.apk/smali/com/android/settings/rz/Navigation.smali
5. Compare the Public ID and replace it and recompile
6. God you did man,,, now replace and have fun
Thanks to atl4ntis for his Awesome rom Cataclysm and Cyanogenmod
Click to expand...
Click to collapse
when i recompile,,i have bug with @string/lockscreen_display_category
dark90
brother, give your SystemUI with the mod Enable/Disable Navigation Bar Swipe to sleep/Lock, pliz
Quoclam851995 said:
when i recompile,,i have bug with @string/lockscreen_display_category
Click to expand...
Click to collapse
haha its a dump string
not a deal bro
rename the @string/lockscreen_display_category to any thing like "display"
or remove the line and leave it or add string
nothing is a problem
dark90 said:
Working.
Click to expand...
Click to collapse
can you give me your systemui
Thanks bro.. Works like a charm.. Great tutorial. Expecting more from you..
Rajeev said:
Thanks bro.. Works like a charm.. Great tutorial. Expecting more from you..
Click to expand...
Click to collapse
Can you share with me your system ui
Quoclam851995 said:
Can you share with me your system ui
Click to expand...
Click to collapse
Why?
Rajeev said:
Why?
Click to expand...
Click to collapse
Maybe don't know how to make the tut i think .-.
Rajeev said:
Why?
Click to expand...
Click to collapse
I want compare some code to complete my system ui.
Quoclam851995 said:
I want compare some code to complete my system ui.
Click to expand...
Click to collapse
I am sorry my Friend. I am using 2g and very low signal. With my Samsung Galaxy Y
@Rajeev @venkat kamesh
why is there nobody to explain me how to "merge" a file to another.
in this case (and all other tuts as well from venkat) i don´t unterstand how to merge my public.xml with the downloaded from the OP.
this drives me crazy. i did all steps before but always failed at this point in each tutorial
all other things are clear and replacing the ID after re- and decompiling is no problem, but if nobody explain to me how to merge both public.xml, i
can´t re- and decompile the settings.apk without a failure.
Each dev started like me with little little steps, so come on guys, plz teach me this simple thing
There are tousand of tuts here from hundreds of devs, but nobody explain this thing - very very frustrating....
moonryder said:
@Rajeev @venkat kamesh
why is there nobody to explain me how to "merge" a file to another.
in this case (and all other tuts as well from venkat) i don´t unterstand how to merge my public.xml with the downloaded from the OP.
this drives me crazy. i did all steps before but always failed at this point in each tutorial
all other things are clear and replacing the ID after re- and decompiling is no problem, but if nobody explain to me how to merge both public.xml, i
can´t re- and decompile the settings.apk without a failure.
Each dev started like me with little little steps, so come on guys, plz teach me this simple thing
There are tousand of tuts here from hundreds of devs, but nobody explain this thing - very very frustrating....
Click to expand...
Click to collapse
Bro u don't need to merge the public.xml u only need to search the lines that the files u added to xml, layout etc and then compile and recompile and replace the public id and recompile ,sing and replace bro
moonryder said:
@Rajeev @venkat kamesh
why is there nobody to explain me how to "merge" a file to another.
in this case (and all other tuts as well from venkat) i don´t unterstand how to merge my public.xml with the downloaded from the OP.
this drives me crazy. i did all steps before but always failed at this point in each tutorial
all other things are clear and replacing the ID after re- and decompiling is no problem, but if nobody explain to me how to merge both public.xml, i
can´t re- and decompile the settings.apk without a failure.
Each dev started like me with little little steps, so come on guys, plz teach me this simple thing
There are tousand of tuts here from hundreds of devs, but nobody explain this thing - very very frustrating....
Click to expand...
Click to collapse
You need check the smali file and find 0x7fxxxx code, then search That code in the public(compare).xml and you get a specific líne now search That líne into your public.xml and copy your code 0x7fxxxx from the líne into your public.xml to the smali code.
You can use this to make it easy http://forum.xda-developers.com/showthread.php?p=64160375

Categories

Resources