Happy New Year...
This is my first tutorial of 2014. Today I will teach
you how to add Reboot and Recovery option in Power Menu.
Make sure you have a basic knowledge on how to compile/decompile .apk/.jar files.
framework-res.apk
Decompile framework-res.apk
[*]Navigate to framework-res.apk\res\drawable-hdpi
[*]Extract all the files from PNG folder (Download From Attachment)
[*]Navigate to framework-res.apk\res\values
[*]Open strings.xml file in file editor
[*]Add these line at the end
Code:
<string name="reboot">Reboot</string>
<string name="reboot_progress">Rebooting…</string>
<string name="reboot_confirm">Your phone will reboot</string>
<string name="recovery">Recovery</string>
<string name="recovery_progress">Rebooting into recovery…</string>
<string name="recovery_confirm">Your phone will reboot into recovery</string>
[*]Save the file
[*]Recompile your framework-res.apk
[*]Decompile framework-res.apk which you have recompiled a moment ago
[*]Navigate to framework-res.apk\res\values
[*]Open public.xml file in file editor
framework.jar
Decompile framework.jar
[*]Navigate to framework.jar\smali\com\android\internal\app
[*]Open ShutdownThread.smali file in file editor
[*]Search for .field private static mReboot:Z and add the red line only
Code:
.field private static final TAG:Ljava/lang/String; = "ShutdownThread"
[COLOR="Red"].field public static mReboot:I[/COLOR]
.field private static mReboot:Z
[*]Search for .local v1, pd:Landroid/app/ProgressDialog; and add the red lines only
Code:
.line 184
.local v1, pd:Landroid/app/ProgressDialog;
[COLOR="Red"]sget v2, Lcom/android/internal/app/ShutdownThread;->mReboot:I
if-eq v2, v5, :cond_1
if-nez v2, :cond_2[/COLOR]
const v2, 0x104014a
[COLOR="Red"]goto :goto_1
:cond_1
const v2, name="reboot"
goto :goto_1
:cond_2
const v2, name="recovery"
:goto_1[/COLOR]
invoke-virtual {p0, v2}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;
move-result-object v2
[*]Search for invoke-virtual {v1, v2}, Landroid/app/ProgressDialog;->setTitle(Ljava/lang/CharSequenceV and add the red lines only
Code:
move-result-object v2
invoke-virtual {v1, v2}, Landroid/app/ProgressDialog;->setTitle(Ljava/lang/CharSequence;)V
.line 185
[COLOR="Red"]sget v2, Lcom/android/internal/app/ShutdownThread;->mReboot:I
if-eq v2, v5, :cond_3
if-nez v2, :cond_4[/COLOR]
const v2, 0x104014e
[COLOR="Red"]goto :goto_2
:cond_3
const v2, name="reboot_progress"
goto :goto_2
:cond_4
const v2, name="recovery_progress"
:goto_2[/COLOR]
invoke-virtual {p0, v2}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;
move-result-object v2
[*]Search for .catch Ljava/lang/SecurityException; {:try_start_1 .. :try_end_1} :catch_0 and change the blue lines only
Code:
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->acquire()V
:try_end_1
.catch Ljava/lang/SecurityException; {:try_start_1 .. :try_end_1} :catch_0
.line 208
[COLOR="Blue"]:goto_3[/COLOR]
sget-object v2, Lcom/android/internal/app/ShutdownThread;->sInstance:Lcom/android/internal/app/ShutdownThread;
iput-object v6, v2, Lcom/android/internal/app/ShutdownThread;->mScreenWakeLock:Landroid/os/PowerManager$WakeLock;
.line 209
sget-object v2, Lcom/android/internal/app/ShutdownThread;->sInstance:Lcom/android/internal/app/ShutdownThread;
iget-object v2, v2, Lcom/android/internal/app/ShutdownThread;->mPowerManager:Landroid/os/PowerManager;
invoke-virtual {v2}, Landroid/os/PowerManager;->isScreenOn()Z
move-result v2
[COLOR="Blue"]if-eqz v2, :cond_5[/COLOR]
.line 211
:try_start_2
[*]Search for .catch Ljava/lang/SecurityException; {:try_start_2 .. :try_end_2} :catch_1 and change the blue lines only
Code:
:try_end_2
.catch Ljava/lang/SecurityException; {:try_start_2 .. :try_end_2} :catch_1
.line 222
[COLOR="Blue"]:cond_5
:goto_4[/COLOR]
sget-object v2, Lcom/android/internal/app/ShutdownThread;->sInstance:Lcom/android/internal/app/ShutdownThread;
new-instance v3, Lcom/android/internal/app/ShutdownThread$2;
[*]Search for .end local v0 #e:Ljava/lang/SecurityException; and change the blue lines only
Code:
iput-object v6, v2, Lcom/android/internal/app/ShutdownThread;->mCpuWakeLock:Landroid/os/PowerManager$WakeLock;
[COLOR="Blue"]goto :goto_3[/COLOR]
.line 215
.end local v0 #e:Ljava/lang/SecurityException;
:catch_1
move-exception v0
.line 216
.restart local v0 #e:Ljava/lang/SecurityException;
const-string v2, "ShutdownThread"
const-string v3, "No permission to acquire wake lock"
invoke-static {v2, v3, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
.line 217
sget-object v2, Lcom/android/internal/app/ShutdownThread;->sInstance:Lcom/android/internal/app/ShutdownThread;
iput-object v6, v2, Lcom/android/internal/app/ShutdownThread;->mScreenWakeLock:Landroid/os/PowerManager$WakeLock;
[COLOR="Blue"]goto :goto_4[/COLOR]
.end method
.method public static reboot(Landroid/content/Context;Ljava/lang/String;Z)V
[*]Search for .method public static rebootOrShutdown(ZLjava/lang/StringV and change the blue line only
Code:
.end method
.method public static rebootOrShutdown(ZLjava/lang/String;)V
.locals 5
.parameter "reboot"
.parameter "reason"
.prologue
.line 403
[COLOR="Blue"]if-eqz p0, :cond_3[/COLOR]
.line 404
const-string v2, "ShutdownThread"
[*]Search for invoke-static {p1}, Landroid/os/Power;->reboot(Ljava/lang/StringV and add the red lines and change the blue lines only
Code:
:try_start_0
invoke-static {p1}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
:try_end_0
[COLOR="Blue"].catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1[/COLOR]
.line 428
:goto_0
const-string v2, "ShutdownThread"
const-string v3, "Performing low-level shutdown..."
invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
[COLOR="Red"]sget v1, Lcom/android/internal/app/ShutdownThread;->mReboot:I
const/4 v2, 0x1
if-eq v1, v2, :cond_0
const/4 v2, 0x2
if-eq v1, v2, :cond_1[/COLOR]
.line 429
invoke-static {}, Landroid/os/Power;->shutdown()V
.line 430
return-void
[COLOR="Red"]:cond_0
const-string/jumbo v4, "now"
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
return-void
:cond_1
:try_start_1
new-instance v1, Ljava/io/File;
const-string v4, "/cache/recovery/boot"
invoke-direct {v1, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 442
.restart local v1
invoke-virtual {v1}, Ljava/io/File;->exists()Z
move-result v4
if-nez v4, :cond_2
.line 443
invoke-virtual {v1}, Ljava/io/File;->createNewFile()Z
:try_end_1
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
:catch_0
:cond_2
const-string/jumbo v4, "recovery"
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
return-void[/COLOR]
.line 407
[COLOR="Blue"]:catch_1[/COLOR]
move-exception v0
.line 408
.local v0, e:Ljava/lang/Exception;
const-string v2, "ShutdownThread"
[*]Search for .end local v0 #e:Ljava/lang/Exception; and change the blue lines only
Code:
.line 412
.end local v0 #e:Ljava/lang/Exception;
[COLOR="Blue"]:cond_3[/COLOR]
new-instance v1, Landroid/os/Vibrator;
invoke-direct {v1}, Landroid/os/Vibrator;-><init>()V
.line 414
.local v1, vibrator:Landroid/os/Vibrator;
const-wide/16 v2, 0x1f4
[COLOR="Blue"]:try_start_2[/COLOR]
invoke-virtual {v1, v2, v3}, Landroid/os/Vibrator;->vibrate(J)V
[COLOR="Blue"]:try_end_2
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_3[/COLOR]
.line 422
:goto_1
const-wide/16 v2, 0x1f4
[COLOR="Blue"]:try_start_3[/COLOR]
invoke-static {v2, v3}, Ljava/lang/Thread;->sleep(J)V
[COLOR="Blue"]:try_end_3
.catch Ljava/lang/InterruptedException; {:try_start_3 .. :try_end_3} :catch_2[/COLOR]
goto :goto_0
.line 423
[COLOR="Blue"]:catch_2[/COLOR]
move-exception v2
goto :goto_0
.line 415
[COLOR="Blue"]:catch_3[/COLOR]
move-exception v0
.line 417
.restart local v0 #e:Ljava/lang/Exception;
[*]Search for .local v1, longPressBehavior:I and change the blue lines only
Code:
.line 106
.local v1, longPressBehavior:I
const/4 v3, 0x2
[COLOR="Blue"]if-ne v1, v3, :cond_4[/COLOR]
const v2, 0x1040150
.line 110
.local v2, resourceId:I
:goto_1
const-string v3, "ShutdownThread"
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
const-string v5, "Notifying thread to start shutdown longPressBehavior="
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 112
[COLOR="Blue"]if-eqz p1, :cond_7[/COLOR]
.line 113
new-instance v0, Lcom/android/internal/app/ShutdownThread$CloseDialogReceiver;
[*]Search for invoke-direct {v3, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/ContextV and add the red lines only
Code:
new-instance v3, Landroid/app/AlertDialog$Builder;
invoke-direct {v3, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V
[COLOR="Red"]const v5, 0x1
sget v4, Lcom/android/internal/app/ShutdownThread;->mReboot:I
if-eq v4, v5, :cond_2
if-nez v4, :cond_3[/COLOR]
const v4, 0x104014a
[COLOR="Red"]goto :goto_2
:cond_2
const v4, name="reboot"
goto :goto_2
:cond_3
const v4, name="recovery"
:goto_2[/COLOR]
invoke-virtual {v3, v4}, Landroid/app/AlertDialog$Builder;->setTitle(I)Landroid/app/AlertDialog$Builder;
move-result-object v3
[*]Search for invoke-virtual {v3}, Landroid/app/AlertDialog;->show()V and add the red lines and change the blue lines only
Code:
sget-object v3, Lcom/android/internal/app/ShutdownThread;->sConfirmDialog:Landroid/app/AlertDialog;
invoke-virtual {v3}, Landroid/app/AlertDialog;->show()V
[COLOR="Blue"]goto/16 :goto_0[/COLOR]
.line 102
.end local v0 #closer:Lcom/android/internal/app/ShutdownThread$CloseDialogReceiver;
.end local v1 #longPressBehavior:I
.end local v2 #resourceId:I
:catchall_0
move-exception v3
:try_start_1
monitor-exit v4
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
throw v3
.line 106
.restart local v1 #longPressBehavior:I
[COLOR="Blue"]:cond_4[/COLOR]
[COLOR="Red"]const v3, 0x1
sget v2, Lcom/android/internal/app/ShutdownThread;->mReboot:I
if-eq v2, v3, :cond_5
if-nez v2, :cond_6[/COLOR]
const v2, 0x104014f
[COLOR="Blue"]goto/16 :goto_1[/COLOR]
[COLOR="Red"]:cond_5
const v2, name="reboot_confirm"
goto/16 :goto_1
:cond_6
const v2, name="recovery_confirm"
goto/16 :goto_1[/COLOR]
.line 132
.restart local v2 #resourceId:I
[COLOR="Blue"]:cond_7[/COLOR]
invoke-static {p0}, Lcom/android/internal/app/ShutdownThread;->beginShutdownSequence(Landroid/content/Context;)V
goto/16 :goto_0
.end method
[*]Now you have to find the names below
Code:
name="reboot"
name="recovery"
name="reboot_progress"
name="recovery_progress"
name="reboot_confirm"
name="recovery_confirm"
[*]You have to replace these name with hex ids from public.xml which is already opened in file editor
[*]For example search for name="reboot" in public.xml file
[*]In my case I have got
Code:
<public type="string" name="reboot" id="[COLOR="Blue"]0x01040548[/COLOR]" />
[*]The blue marked part is hex. Copy the hex and remove the 3rd digit. So 0x01040548 will be 0x1040548
[*]Now search for name="reboot" in ShutdownThread.smali file and replace name="reboot" with 0x1040548
[*]Do the same for other names too
[*]Save the file
[*]Recompile your framework.jar
android.policy.jar
Decompile android.policy.jar
[*]Navigate to android.policy.jar\smali\com\android\internal\policy\impl
[*]Extract all the files from SMALI folder (Download From Attachment)
[*]Open GlobalActions$2.smali file in file editor
[*]Search for invoke-static {v0}, Lcom/android/internal/policy/impl/GlobalActions;->access$100(Lcom/android/internal/policy/impl/GlobalActionsLandroid/content/Context; and add the red lines only
Code:
#getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v0}, Lcom/android/internal/policy/impl/GlobalActions;->access$100(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
move-result-object v0
const/4 v1, 0x1
[COLOR="Red"]const/4 p0, 0x0
sput p0, Lcom/android/internal/app/ShutdownThread;->mReboot:I[/COLOR]
invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V
.line 171
return-void
.end method
[*]Save the file
[*]Open GlobalActions.smali file in file editor
[*]Search for .method private createDialog()Landroid/app/AlertDialog; and change the blue lines only
Code:
.end method
.method private createDialog()Landroid/app/AlertDialog;
[COLOR="Blue"].locals 12[/COLOR]
.prologue
const/4 v9, 0x1
[*]Search for invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V and add the red lines only
Code:
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[COLOR="Red"]iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "reboot"
const-string v2, "string"
const-string v3, "android"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v10
if-nez v10, :cond_0
const-string v1, "reboot_system"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v10
if-eqz v10, :cond_1
:cond_0
const-string v1, "ic_lock_reboot"
const-string v2, "drawable"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v11
if-eqz v11, :cond_1
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$7;
invoke-direct {v1, p0, v11, v10}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
:cond_1
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "recovery"
const-string v2, "string"
const-string v3, "android"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v10
if-nez v10, :cond_2
const-string v1, "recovery_system"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v10
if-eqz v10, :cond_3
:cond_2
const-string v1, "ic_lock_recovery"
const-string v2, "drawable"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v11
if-eqz v11, :cond_3
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$8;
invoke-direct {v1, p0, v11, v10}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/COLOR]
.line 183
[COLOR="Red"]:cond_3[/COLOR]
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
[*]Save the file
[*]Recompile your android.policy.jar
Please Note :
Take backup before doing anything.
Use Notepad++ to edit files.
Please read the tutorial properly befor editing files.
If you found any mistake in this tutorial then please let me know.
this is the one thing our xperia community was lacking of. Now it's fulfilled thanks for this :good:
Good Job bro
Thank u
WOW, really a nice guide, perfectly explained & noob Friendly
keep it coming
Great guide, will really help many people, not just to Arc owners but to all Xperia family
saqib nazm said:
this is the one thing our xperia community was lacking of. Now it's fulfilled thanks for this :good:
Click to expand...
Click to collapse
3andala said:
Good Job bro
Thank u
Click to expand...
Click to collapse
stanlin salu said:
WOW, really a nice guide, perfectly explained & noob Friendly
keep it coming
Click to expand...
Click to collapse
Ayush Singh said:
Great guide, will really help many people, not just to Arc owners but to all Xperia family
Click to expand...
Click to collapse
Thanks for these encouraging comments. You all are cordially welcome...
Awesome Guide
This is how its done!
Understanding that smali was a pain in the a**.
You just made this simpler to copy paste
Thank you!
Wonderful work man..
You ll soon be a great themer. Thanks for keeping 2011 xperias forum alive..:thumbup:
Cheers,
Vatsal
Nice work mate.. Nice write up. Way to go. Keep it up and hoping to see more of your works
Sent from my GT-P3110 using Tapatalk
Nice tutorial @BDFreak ...
Can you tell which apktool is recommended for use in this tutorial ?
karandpr said:
Nice tutorial @BDFreak ...
Can you tell which apktool is recommended for use in this tutorial ?
Click to expand...
Click to collapse
I am using THIS one. But I think you can use old versions too...
Ayush Singh said:
Great guide, will really help many people, not just to Arc owners but to all Xperia family
Click to expand...
Click to collapse
this is for Arc only, another xperia phone will be different .
in my TX, framework.jar dont have ShutdownThread.smali but it in services.jar
devilmaycry2020 said:
this is for Arc only, another xperia phone will be different .
in my TX, framework.jar dont have ShutdownThread.smali but it in services.jar
Click to expand...
Click to collapse
I meant all Xperia 2011 family
devilmaycry2020 said:
this is for Arc only, another xperia phone will be different .
in my TX, framework.jar dont have ShutdownThread.smali but it in services.jar
Click to expand...
Click to collapse
Would be the same for atleast the 2011 Xperia Line up
devilmaycry2020 said:
this is for Arc only, another xperia phone will be different .
in my TX, framework.jar dont have ShutdownThread.smali but it in services.jar
Click to expand...
Click to collapse
It's obvious that this will be different in 2012-13 xperias. But the main idea is quite same, like if you know where you have to look for
Nice tut! Its also not very complicated
i dont understand about "change the blue lines only" .what does it mean ? if my own different change it to same as yours ?
devilmaycry2020 said:
i dont understand about "change the blue lines only" .what does it mean ? if my own different change it to same as yours ?
Click to expand...
Click to collapse
Exactly. I mean yes...
BDFreak said:
Exactly. I mean yes...
Click to expand...
Click to collapse
i dont think so because i've modded this before and it work great but the only i missed was when i choose reboot or recovery it didn't show "Reboot" or "Recovery" tittle but only Power off. could you help me. thanks
basically my mod for TX as same as your but have some different
i can send to you all relate files for modding this, could you take a look to it. thanks
devilmaycry2020 said:
i dont think so because i've modded this before and it work great but the only i missed was when i choose reboot or recovery it didn't show "Reboot" or "Recovery" tittle but only Power off. could you help me. thanks
basically my mod for TX as same as your but have some different
i can send to you all relate files for modding this, could you take a look to it. thanks
Click to expand...
Click to collapse
Actually this tutorial is for 2011 Xperia phones. I didn't try in newer phones yet. But I will give it a try in my SP when times allow me.
Related
This tutorial is going to delve into the convoluted smali involved in handling dialogs, and ultimately bypassing them. I must warn you there will be a lot of tracing in this post, so if all you want is the patch, this may not be for you. The idea is to gain an intimate understanding of dialogs from smali! (This is based on LPD base)
Decompile jobmanager.apk, then search for 'Exit all', which leads to public.xml: <public type="string" name="kill_all" id="0x7f050005" />
Searching for '7f050005' leads us to RunningAppsListActivity.smali (referred to as RALA from now on), which we can now dissect. Start by looking at some of the variables at the top of
code. Two should stand out:
Code:
.field private mKillAll:Landroid/widget/Button;
...
.field private mOnClickListenerKillAll:Landroid/view/View$OnClickListener;
These represent the button and the code that executes when it's clicked. Let's find out what that code is by searching, which leads to:
Code:
.line 308
new-instance v0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;
invoke-direct {v0, p0}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;-><init>(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)V
iput-object v0, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mOnClickListenerKillAll:Landroid/view/View$OnClickListener;
So now we know RALA$6 is our executed code:
Code:
.method public onClick(Landroid/view/View;)V
.locals 2
.parameter "v"
.prologue
.line 311
iget-object v0, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
const/4 v1, 0x5
invoke-virtual {v0, v1}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->showDialog(I)V
.line 312
return-void
.end method
So what does this mean? When the button is clicked, it's calling back to RALA with a value of 0x5. Let's figure out what that means, look at '.method protected onCreateDialog'
Code:
packed-switch p1, :pswitch_data_0
(This is defined at the end of the method as)
:pswitch_data_0
.packed-switch 0x1
:pswitch_1
:pswitch_0
:pswitch_2
:pswitch_3
:pswitch_4
.end packed-switch
So our value when clicking the button is 0x5, which translates to pswitch_4
Code:
:pswitch_4
new-instance v3, Landroid/app/AlertDialog$Builder;
invoke-direct {v3, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V
const v4, 0x7f050005 <<<<<<<<<<<<<<<<<<<<<<<<<< Remember this #, it's our 'Exit all' string id
...
new-instance v4, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$12;
invoke-direct {v4, p0}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$12;-><init>(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)V
invoke-virtual {v3, v7, v4}, Landroid/app/AlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;
This last line sets the code executed when you click 'Ok', so lets look at RALA$12, inside OnClick:
Code:
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mHandler:Landroid/os/Handler;
invoke-static {v0}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$300(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Landroid/os/Handler;
move-result-object v0
const/4 v1, 0x6
invoke-virtual {v0, v1}, Landroid/os/Handler;->sendEmptyMessage(I)Z
So this is sending a code (0x6) to mHandler in the main RALA module, let's see what that means. mHandler is our message handler, and is defined here:
Code:
.line 331
new-instance v0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
invoke-direct {v0, p0}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;-><init>(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)V
iput-object v0, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mHandler:Landroid/os/Handler;
So RALA$7 is our next target, specifically '.method public handleMessage(Landroid/os/MessageV':
Code:
iget v3, p1, Landroid/os/Message;->what:I
packed-switch v3, :pswitch_data_0
(which is)
.line 333
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
:pswitch_5
:pswitch_6
:pswitch_7
.end packed-switch
(A side note, packed-switch 0x1 means the first entry starts with 0x1, so 0x6 is pswitch_5. Let's now look at that)
:pswitch_5
const-string v3, "RunningAppsListActivity"
const-string v4, "MSG_KILL_ALL"
invoke-static {v3, v4}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
.line 410
iget-object v3, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
new-instance v4, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;
...
So finally we have reached the true code for executing KILL ALL, and it lies within RALA$7$4. If you look at '.method public run()V' in RALA$7$4, you will see the extensive code to kill all running apps. So now we that we have what we want, how do we bypass the dialog? Simple, just abort creating the dialog and execute the code instead.
Let's take a moment to review the execution entirely:
RALA assigns button -> RALA$6 which calls back RALA -> Create dlg and set OK -> RALA$12 which then calls the message handler RALA$7 with code 0x5 ->
RALA$7$4 which is the ACTUAL 'kill all' code.
So our intercept point is in RALA$6, where we can bypass the creation of the dialog and execute the code directly. Now you can't just copy/paste the code from RALA$7$4 to RALA$6, there are variables specific to each .smali. So this is the fixed code with the manual changes highlighted:
Code:
.method public onClick(Landroid/view/View;)V
.locals [COLOR="Red"]7[/COLOR]
.parameter "v"
.prologue
.line 311
iget-object v0, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
const/4 v1, 0x5
[COLOR="red"]#[/COLOR] invoke-virtual {v0, v1}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->showDialog(I)V
.line 412
[COLOR="red"]#[/COLOR] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
[COLOR="red"] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;[/COLOR]
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPackageInfoAdapter:Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$000(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
move-result-object v4
invoke-virtual {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;->getBaseAppList()Ljava/util/List;
move-result-object v1
.line 413
.local v1, items:Ljava/util/List;,"Ljava/util/List<Lcom/sec/android/app/controlpanel/PackageInfoItem;>;"
new-instance v3, Ljava/util/HashSet;
invoke-direct {v3}, Ljava/util/HashSet;-><init>()V
.line 414
.local v3, removeTarget:Ljava/util/Set;,"Ljava/util/Set<Lcom/sec/android/app/controlpanel/PackageInfoItem;>;"
invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v0
.local v0, i$:Ljava/util/Iterator;
:cond_0
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v4
if-eqz v4, :cond_1
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lcom/sec/android/app/controlpanel/PackageInfoItem;
.line 415
.local v2, p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
invoke-virtual {v2}, Lcom/sec/android/app/controlpanel/PackageInfoItem;->isCanKilled()Z
move-result v4
if-eqz v4, :cond_0
.line 416
const-string v4, "RunningAppsListActivity"
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
const-string v6, "Kill runningApplication! "
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v2}, Lcom/sec/android/app/controlpanel/PackageInfoItem;->getPackageName()Ljava/lang/String;
move-result-object v6
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v5
invoke-static {v4, v5}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
.line 417
[COLOR="red"]#[/COLOR] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
[COLOR="red"] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;[/COLOR]
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPkgInfo:Lcom/sec/android/app/controlpanel/PackageInfo;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$400(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/PackageInfo;
move-result-object v4
invoke-virtual {v2}, Lcom/sec/android/app/controlpanel/PackageInfoItem;->getPackageName()Ljava/lang/String;
move-result-object v5
const/4 v6, 0x1
invoke-virtual {v4, v5, v6}, Lcom/sec/android/app/controlpanel/PackageInfo;->killPackage(Ljava/lang/String;Z)V
.line 418
invoke-interface {v3, v2}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
goto :goto_0
.line 421
.end local v2 #p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
:cond_1
invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v0
:goto_1
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v4
if-eqz v4, :cond_2
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lcom/sec/android/app/controlpanel/PackageInfoItem;
.line 422
.restart local v2 #p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
invoke-interface {v1, v2}, Ljava/util/List;->remove(Ljava/lang/Object;)Z
goto :goto_1
.line 424
.end local v2 #p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
:cond_2
[COLOR="red"]#[/COLOR] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
[COLOR="red"] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;[/COLOR]
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPackageInfoAdapter:Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$000(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
move-result-object v4
invoke-virtual {v4, v1}, Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;->setList(Ljava/util/List;)V
.line 425
[COLOR="red"]#[/COLOR] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
[COLOR="red"] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;[/COLOR]
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPackageInfoAdapter:Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$000(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
move-result-object v4
invoke-virtual {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;->notifyDataSetChanged()V
.line 428
[COLOR="red"]#[/COLOR] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
[COLOR="red"] iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;[/COLOR]
[COLOR="red"]#[/COLOR] iget-object v5, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
[COLOR="red"] iget-object v5, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;[/COLOR]
const v6, 0x7f050028
invoke-virtual {v5, v6}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->getText(I)Ljava/lang/CharSequence;
move-result-object v5
const/4 v6, 0x0
invoke-static {v4, v5, v6}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v4
invoke-virtual {v4}, Landroid/widget/Toast;->show()V
.line 312
return-void
.end method
That is it, recompile JobManager.apk, u/l and test it out! Hope you enjoyed the tut =)
Why didn't I see this before, your holding out on us in chat.
LiLChris06 said:
Why didn't I see this before, your holding out on us in chat.
Click to expand...
Click to collapse
I finished this a few weeks back, but just got around to writing it up..I'm pretty sure you got a pastebin msg one night =)
PS - For those that just want the patch, just copy/paste that last code box into RALA$6 (replacing the existing onclick method).
Lovely piece of information, easily readable
thanks very much
Update for 4.0.4
The overall structure is still the same, but here's the updated patch based on 4.0.4 LPO. You paste this into RALA$6, replacing the existing onclick method:
Code:
.method public onClick(Landroid/view/View;)V
.locals 8
.prologue
const/4 v7, 0x0
.line 428
# iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPackageInfoAdapter:Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$000(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
move-result-object v4
invoke-virtual {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;->getBaseAppList()Ljava/util/List;
move-result-object v1
.line 429
.local v1, items:Ljava/util/List;,"Ljava/util/List<Lcom/sec/android/app/controlpanel/PackageInfoItem;>;"
new-instance v3, Ljava/util/HashSet;
invoke-direct {v3}, Ljava/util/HashSet;-><init>()V
.line 432
.local v3, removeTarget:Ljava/util/Set;,"Ljava/util/Set<Lcom/sec/android/app/controlpanel/PackageInfoItem;>;"
if-eqz v1, :cond_3
.line 433
invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v0
.local v0, i$:Ljava/util/Iterator;
:cond_0
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v4
if-eqz v4, :cond_1
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lcom/sec/android/app/controlpanel/PackageInfoItem;
.line 434
.local v2, p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
invoke-virtual {v2}, Lcom/sec/android/app/controlpanel/PackageInfoItem;->isCanKilled()Z
move-result v4
if-eqz v4, :cond_0
.line 437
# iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPkgInfo:Lcom/sec/android/app/controlpanel/PackageInfo;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$400(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/PackageInfo;
move-result-object v4
invoke-virtual {v2}, Lcom/sec/android/app/controlpanel/PackageInfoItem;->getPackageName()Ljava/lang/String;
move-result-object v5
const/4 v6, 0x1
invoke-virtual {v4, v5, v6}, Lcom/sec/android/app/controlpanel/PackageInfo;->killPackage(Ljava/lang/String;Z)V
.line 438
invoke-interface {v3, v2}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
goto :goto_0
.line 441
.end local v2 #p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
:cond_1
invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v0
:goto_1
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v4
if-eqz v4, :cond_2
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lcom/sec/android/app/controlpanel/PackageInfoItem;
.line 442
.restart local v2 #p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
invoke-interface {v1, v2}, Ljava/util/List;->remove(Ljava/lang/Object;)Z
goto :goto_1
.line 444
.end local v2 #p:Lcom/sec/android/app/controlpanel/PackageInfoItem;
:cond_2
# iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPackageInfoAdapter:Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$000(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
move-result-object v4
invoke-virtual {v4, v1}, Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;->setList(Ljava/util/List;)V
.line 445
# iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
#getter for: Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->mPackageInfoAdapter:Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
invoke-static {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->access$000(Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;)Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;
move-result-object v4
invoke-virtual {v4}, Lcom/sec/android/app/controlpanel/activity/RunningAppsPackageInfoAdapter;->notifyDataSetChanged()V
.line 447
const/4 v4, 0x2
const/4 v5, 0x0
:try_start_0
invoke-static {v4, v5}, Lcom/sec/android/hardware/SecHardwareInterface;->setBatteryUse(IZ)V
.line 448
const/4 v4, 0x3
const/4 v5, 0x0
invoke-static {v4, v5}, Lcom/sec/android/hardware/SecHardwareInterface;->setBatteryUse(IZ)V
.line 449
const/4 v4, 0x4
const/4 v5, 0x0
invoke-static {v4, v5}, Lcom/sec/android/hardware/SecHardwareInterface;->setBatteryUse(IZ)V
.line 450
const/4 v4, 0x5
const/4 v5, 0x0
invoke-static {v4, v5}, Lcom/sec/android/hardware/SecHardwareInterface;->setBatteryUse(IZ)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 457
:goto_2
# iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
iget-object v4, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
# iget-object v5, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7$4;->this$1:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$7;
iget-object v5, p0, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity$6;->this$0:Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;
const v6, 0x7f050028
invoke-virtual {v5, v6}, Lcom/sec/android/app/controlpanel/activity/RunningAppsListActivity;->getText(I)Ljava/lang/CharSequence;
move-result-object v5
invoke-static {v4, v5, v7}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v4
invoke-virtual {v4}, Landroid/widget/Toast;->show()V
.line 461
.end local v0 #i$:Ljava/util/Iterator;
:cond_3
return-void
.line 451
.restart local v0 #i$:Ljava/util/Iterator;
:catch_0
move-exception v4
goto :goto_2
.end method
Hello Friends this is mine tutorial for quad targates in aosp lockscreen You can direct me here But when according to that tut when you decompile framework.jar you wont find any widget folder .
So my tut has very little change but fully wokring for XXLSJ rom
FOR WORKING quad targates you must have an AOSP lockscreen this tutorial is for adding over all quad targates to AOSP lockscreen
i m providing only smali part
Now Please start following the instuction with that tag.
Framework-res.apk Editing
[SMALI]
Decompile your framework-res.apk
Put ic_lockscreen_phone_activated.png, ic_lockscreen_phone_normal.png, ic_lockscreen_sms_activated.png, ic_lockscreen_sms_normal.png in /res/drawable-hdpi/
[SMALI]
Put ic_lockscreen_phone.xml, ic_lockscreen_sms.xml in /res/drawable/
[SMALI]
Open /res/values/arrays.xml
[SMALI]/
Replace the whole array .. with:
Code:
@drawable/ic_lockscreen_unlock
@drawable/ic_lockscreen_sms
@drawable/ic_action_assist_generic
@drawable/ic_lockscreen_phone
@drawable/ic_lockscreen_camera
@null
@null
@null
Replace the whole array .. with:
Code:
@string/description_target_unlock
@string/description_target_sms
@string/description_target_search
@string/description_target_phone
@string/description_target_camera
@null
@null
@null
[SMALI]
Open /res/values-land/arrays.xml
[SMALI]/
Replace the whole array .. with:
Code:
@null
@null
@drawable/ic_lockscreen_unlock
@drawable/ic_lockscreen_sms
@drawable/ic_action_assist_generic
@drawable/ic_lockscreen_phone
@drawable/ic_lockscreen_camera
@null
Replace the whole array .. with:
Code:
@null
@null
@string/description_target_unlock
@string/description_target_sms
@string/description_target_search
@string/description_target_phone
@string/description_target_camera
@null
[SMALI]
Open /res/values/strings.xml
[SMALI]/
Add the following entries:
Code:
Sms
Phone
Recompile your framework
framework editing:
[SMALI]
Disassemble your framework2.jar
Edit /com/android/internal/widget/multiwaveview/GlowPadView.smali and replace the whole methods ".method private getDirectionDescription(I)Ljava/lang/String;" and ".method private getTargetDescription(I)Ljava/lang/String;" with the following methods:
Code:
.method private getDirectionDescription(I)Ljava/lang/String;
.locals 4
.parameter "index"
.prologue
.line 1119
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
if-eqz v2, :cond_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->isEmpty()Z
move-result v2
if-eqz v2, :cond_1
.line 1120
:cond_0
iget v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptionsResourceId:I
invoke-direct {p0, v2}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->loadDescriptions(I)Ljava/util/ArrayList;
move-result-object v2
iput-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
.line 1121
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDrawables:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v2
iget-object v3, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result v3
if-eq v2, v3, :cond_1
.line 1122
const-string v2, "GlowPadView"
const-string v3, "The number of target drawables must be equal to the number of direction descriptions."
invoke-static {v2, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 1124
const/4 v0, 0x0
.line 1133
:goto_0
return-object v0
.line 1130
:cond_1
:try_start_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 1131
.local v0, directionZ:Ljava/lang/String;
goto :goto_0
.line 1132
.end local v0 #directionZ:Ljava/lang/String;
:catch_0
move-exception v1
.line 1133
.local v1, e:Ljava/lang/Exception;
const-string v0, ""
goto :goto_0
.end method
Code:
.method private getTargetDescription(I)Ljava/lang/String;
.locals 4
.parameter "index"
.prologue
.line 1099
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
if-eqz v2, :cond_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->isEmpty()Z
move-result v2
if-eqz v2, :cond_1
.line 1100
:cond_0
iget v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptionsResourceId:I
invoke-direct {p0, v2}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->loadDescriptions(I)Ljava/util/ArrayList;
move-result-object v2
iput-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
.line 1101
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDrawables:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v2
iget-object v3, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result v3
if-eq v2, v3, :cond_1
.line 1102
const-string v2, "GlowPadView"
const-string v3, "The number of target drawables must be equal to the number of target descriptions."
invoke-static {v2, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 1104
const/4 v1, 0x0
.line 1114
:goto_0
return-object v1
.line 1109
:cond_1
const-string v1, ""
.line 1111
.local v1, targetZ:Ljava/lang/String;
:try_start_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v2
move-object v0, v2
check-cast v0, Ljava/lang/String;
move-object v1, v0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
.line 1112
:catch_0
move-exception v2
goto :goto_0
.end method
Recompile your framework2.jar
Now we're done with the framework2.jar now we need to modify that last file android.policy.jar
[SMALI]
Disassemble your android.policy.jar
Edit /com/android/internal/policy/impl/LockScreen.smali and add the following methods:
Code:
.method static synthetic access$1400(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
.locals 1
.parameter "x0"
.prologue
.line 56
iget-object v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mContext:Landroid/content/Context;
return-object v0
.end method
.method static synthetic access$1500(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
.locals 1
.parameter "x0"
.prologue
.line 56
iget-object v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mContext:Landroid/content/Context;
return-object v0
.end method
Edit /com/android/internal/policy/impl/LockScreen$GlowPadViewMethods.smali.
Replace the whole method onTrigger with:
Code:
.method public onTrigger(Landroid/view/View;I)V
.locals 7
.parameter "v"
.parameter "target"
.prologue
const/high16 v6, 0x1000
.line 313
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->mGlowPadView:Lcom/android/internal/widget/multiwaveview/GlowPadView;
invoke-virtual {v4, p2}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->getResourceIdForTarget(I)I
move-result v3
.line 321
.local v3, resId:I
sparse-switch v3, :sswitch_data_0
.line 367
:goto_0
return-void
.line 323
:sswitch_0
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1200(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
move-result-object v4
invoke-static {v4}, Landroid/app/SearchManager;->getAssistIntent(Landroid/content/Context;)Landroid/content/Intent;
move-result-object v0
.line 324
.local v0, assistIntent:Landroid/content/Intent;
if-eqz v0, :cond_0
.line 325
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->launchActivity(Landroid/content/Intent;)V
.line 329
:goto_1
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->pokeWakelock()V
goto :goto_0
.line 327
:cond_0
const-string v4, "LockScreen"
const-string v5, "Failed to get intent for assist activity"
invoke-static {v4, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_1
.line 333
.end local v0 #assistIntent:Landroid/content/Intent;
:sswitch_1
new-instance v4, Landroid/content/Intent;
const-string v5, "android.media.action.STILL_IMAGE_CAMERA"
invoke-direct {v4, v5}, Landroid/content/Intent;->(Ljava/lang/String;)V
invoke-direct {p0, v4}, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->launchActivity(Landroid/content/Intent;)V
.line 334
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->pokeWakelock()V
goto :goto_0
.line 339
:sswitch_2
new-instance v2, Landroid/content/Intent;
const-string v4, "android.intent.action.MAIN"
invoke-direct {v2, v4}, Landroid/content/Intent;->(Ljava/lang/String;)V
.line 340
.local v2, phoneIntent:Landroid/content/Intent;
const-string v4, "com.android.contacts"
const-string v5, "com.android.contacts.activities.DialtactsActivity"
invoke-virtual {v2, v4, v5}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 341
invoke-virtual {v2, v6}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
.line 342
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1300(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
move-result-object v4
invoke-virtual {v4, v2}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
.line 343
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
goto :goto_0
.line 348
.end local v2 #phoneIntent:Landroid/content/Intent;
:sswitch_3
new-instance v1, Landroid/content/Intent;
const-string v4, "android.intent.action.MAIN"
invoke-direct {v1, v4}, Landroid/content/Intent;->(Ljava/lang/String;)V
.line 349
.local v1, mmsIntent:Landroid/content/Intent;
const-string v4, "com.android.mms"
const-string v5, "com.android.mms.ui.ConversationList"
invoke-virtual {v1, v4, v5}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 350
invoke-virtual {v1, v6}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
.line 351
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1400(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
move-result-object v4
invoke-virtual {v4, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
.line 352
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
goto :goto_0
.line 357
.end local v1 #mmsIntent:Landroid/content/Intent;
:sswitch_4
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$500(Lcom/android/internal/policy/impl/LockScreen;)V
.line 358
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->pokeWakelock()V
goto/16 :goto_0
.line 364
:sswitch_5
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
goto/16 :goto_0
.line 321
:sswitch_data_0
.sparse-switch
0x010802cd -> :sswitch_0
0x01080328 -> :sswitch_1
0x01080344 -> :sswitch_4
0x0108034f -> :sswitch_5
0x01080352 -> :sswitch_5
0x01080a4d -> :sswitch_2
0x01080a50 -> :sswitch_3
.end sparse-switch
.end method
Recompile and you're good to go!
I dont work only for thanks i work for my passion toward android too but if you will press thanks it will help me
Credits
atl4ntis for base tutorial
reserved
i used this one time ago: http://forum.xda-developers.com/showthread.php?t=2011461 pretty "same"
Mirko ddd said:
i used this one time ago: http://forum.xda-developers.com/showthread.php?t=2002620 pretty "same"
Click to expand...
Click to collapse
its for adding more targates to AOSP lockscreen
there is no link between mine and the one you give bcz i m not providing how to FOR TOGGLEING AOSP N TW LOCKSCREEN
ICS_XD said:
its for adding more targates to AOSP lockscreen
there is no link between mine and the one you give bcz i m not providing how to FOR TOGGLEING AOSP N TW LOCKSCREEN
Click to expand...
Click to collapse
sorry i linked wrong thing http://forum.xda-developers.com/showthread.php?t=2011461
this one is the same
Mirko ddd said:
sorry i linked wrong thing http://forum.xda-developers.com/showthread.php?t=2011461
this one is the same
Click to expand...
Click to collapse
I dont know
But i modified one which i linked in thread
Btw when i check the thread you gave previous
It will same like you post for LSJ ?
Toggle for TW n Aosp lockscreen
Sent from my GT-I9400 using Tapatalk
ICS_XD said:
I dont know
But i modified one which i linked in thread
Btw when i check the thread you gave previous
It will same like you post for LSJ ?
Toggle for TW n Aosp lockscreen
Sent from my GT-I9400 using Tapatalk
Click to expand...
Click to collapse
for sure is not the same as u can see mine consists to reuse an existings code and made it noobproof.
as u are not even explaining what this is
Code:
.line 321
:sswitch_data_0
.sparse-switch
0x010802cd -> :sswitch_0
0x01080328 -> :sswitch_1
0x01080344 -> :sswitch_4
0x0108034f -> :sswitch_5
0x01080352 -> :sswitch_5
0x01080a4d -> :sswitch_2
0x01080a50 -> :sswitch_3
.end sparse-switch
.end method
people may have different public values leading them into bootloops
Mirko ddd said:
for sure is not the same as u can see mine consists to reuse an existings code and made it noobproof.
as u are not even explaining what this is
Code:
.line 321
:sswitch_data_0
.sparse-switch
0x010802cd -> :sswitch_0
0x01080328 -> :sswitch_1
0x01080344 -> :sswitch_4
0x0108034f -> :sswitch_5
0x01080352 -> :sswitch_5
0x01080a4d -> :sswitch_2
0x01080a50 -> :sswitch_3
.end sparse-switch
.end method
people may have different public values leading them into bootloops
Click to expand...
Click to collapse
These values are not from that thread
These values are of LSJ rom i think these values will work on any LSJ rom ?
Isin't
Sent from my GT-I9400 using Tapatalk
ICS_XD said:
These values are not from that thread
These values are of LSJ rom i think these values will work on any LSJ rom ?
Isin't
Sent from my GT-I9400 using Tapatalk
Click to expand...
Click to collapse
suppose for a while that the guys who s applying your tutorial has one more png file on his framework-res.apk, or that the one u have has it, public valus will mismatch
noobproof is well explained, not easy to copy
Mirko ddd said:
suppose for a while that the guys who s applying your tutorial has one more png file on his framework-res.apk, or that the one u have has it, public valus will mismatch
noobproof is well explained, not easy to copy
Click to expand...
Click to collapse
Oh thanks mate
I will be updating thread tomorrow
Thanks for the help
Sent from my GT-I9100G using xda premium
ICS_XD said:
Oh thanks mate
I will be updating thread tomorrow
Thanks for the help
Sent from my GT-I9100G using xda premium
Click to expand...
Click to collapse
nice target is provide safer and detailed as possible guides
收件人: [TUT][LSJ] How to add quad targates in AOSP lockscreen
have a look. thx
Sent from my HTC X515d using xda premium
All Swagged Out Project
The goal of ASOP is to provide every user with the chance to tweak their phones exactly how they like. At the same time, ASOP gives up and coming devs a place to learn how to get their hands dirty and add mods the old fashioned way.
Background
android.policy.jar is a framework file that controls a lot of things. The three mods that will be covered today include the Advanced Power Menu, Volume Rocker Mod (to skip tracks) and Long-press Back to Kill. These mods were created a long time ago and have been used on many devices. A big props does have to be given to mikmik user one_love_420 for bringing this to the HTC EVO 4G LTE's latest OTA.
Remember
This is for the HTC EVO 4G LTE running OTA 3.15, Android 4.1.1, Sense 4+ and nothing else. We are assuming you are starting with a stock android.policy.jar.
ADVANCED POWER MENU
The Mod
Long-press the Power button and be met with an advanced menu. Including, 4-in-1 Reboot Menu, sound profiles, airplane mode.
Decompile
You gotta figure this one out! Learn how to use apktool, baksmali or VTS. It is HIGHLY recommended that if you are decompiling with apktool or baksmali to add "-b" modifier. If using VTS, uncheck the smali debug code. This will make your smali code MUCH smaller - less system space = MORE RAM.
What Needs to Be Added
This mod requires two smali files that do not exist in the stock android.policy.jar you will find them attached at the bottom of this post.
GlobalActions$5$1.smali
GlobalActions$5$2.smali
They go in \com\android\internal\policy\impl\
What needs to Be Changed [The long part]
Using Notepad++ or a similar text editor (ie not Notepad) navigate to \com\android\internal\policy\impl\GlobalActions.smali
SEARCH FOR:
Code:
.method private changeAirplaneModeSystemSetting(Z)V
AFTER THIS METHOD ENDS, ADD THE FOLLOWING METHODS IN GREEN
Code:
.end method
[COLOR="SeaGreen"].method private createDialog()Lcom/htc/widget/HtcAlertDialog;
.locals 24
move-object/from16 v0, p0
iget-boolean v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mHasVibrator:Z
if-nez v3, :cond_14c
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$SilentModeToggleAction;
move-object/from16 v0, p0
invoke-direct {v3, v0}, Lcom/android/internal/policy/impl/GlobalActions$SilentModeToggleAction;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$Action;
:goto_11
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$1;
const v5, 0x402002a
const v6, 0x402002a
const v7, 0x104013e
const v8, 0x104013f
const v9, 0x1040140
const/4 v10, 0x0
move-object/from16 v4, p0
invoke-direct/range {v3 .. v10}, Lcom/android/internal/policy/impl/GlobalActions$1;-><init>(Lcom/android/internal/policy/impl/GlobalActions;IIIIIZ)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->onAirplaneModeChanged()V
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$2;
const v5, 0x402003f
const v6, 0x402003f
const v7, 0x4070029
const v8, 0x4070028
const v9, 0x4070027
const/4 v10, 0x1
move-object/from16 v4, p0
invoke-direct/range {v3 .. v10}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;IIIIIZ)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mVibrationModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$3;
const v5, 0x402003d
const v6, 0x402003d
const v7, 0x407002a
const v8, 0x407002c
const v9, 0x407002b
const/4 v10, 0x1
move-object/from16 v4, p0
invoke-direct/range {v3 .. v10}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;IIIIIZ)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mMobileNetworkModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
new-instance v3, Ljava/util/ArrayList;
invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->isSense2Mode()Z
move-result v3
if-eqz v3, :cond_163
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const-string v4, "powerOptions_power_off_status"
const-string v5, "string"
const-string v6, "com.htc.framework"
invoke-virtual {v3, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v17
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const-string v4, "powerOptions_restart"
const-string v5, "string"
const-string v6, "com.htc.framework"
invoke-virtual {v3, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v20
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const-string v4, "powerOptions_restart_status"
const-string v5, "string"
const-string v6, "com.htc.framework"
invoke-virtual {v3, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v19
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$4;
const v5, 0x402003e
const v6, 0x104013a
move-object/from16 v0, p0
move/from16 v1, v17
invoke-direct {v4, v0, v5, v6, v1}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$5;
const v5, 0x4020044
move-object/from16 v0, p0
move/from16 v1, v20
move/from16 v2, v19
invoke-direct {v4, v0, v5, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$5;-><init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
:goto_e0
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v3
invoke-virtual {v3}, Landroid/content/pm/PackageManager;->getUsers()Ljava/util/List;
move-result-object v23
invoke-interface/range {v23 .. v23}, Ljava/util/List;->size()I
move-result v3
const/4 v4, 0x1
if-le v3, v4, :cond_1fd
:try_start_f3
invoke-static {}, Landroid/app/ActivityManagerNative;->getDefault()Landroid/app/IActivityManager;
move-result-object v3
invoke-interface {v3}, Landroid/app/IActivityManager;->getCurrentUser()Landroid/content/pm/UserInfo;
:try_end_fa
.catch Landroid/os/RemoteException; {:try_start_f3 .. :try_end_fa} :catch_1dd
move-result-object v12
:goto_fb
invoke-interface/range {v23 .. v23}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v14
:goto_ff
invoke-interface {v14}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-eqz v3, :cond_1fd
invoke-interface {v14}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v22
check-cast v22, Landroid/content/pm/UserInfo;
if-nez v12, :cond_1e5
move-object/from16 v0, v22
iget v3, v0, Landroid/content/pm/UserInfo;->id:I
if-nez v3, :cond_1e1
const/16 v16, 0x1
:goto_115
new-instance v21, Lcom/android/internal/policy/impl/GlobalActions$8;
const v4, 0x108031d
new-instance v5, Ljava/lang/StringBuilder;
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
move-object/from16 v0, v22
iget-object v3, v0, Landroid/content/pm/UserInfo;->name:Ljava/lang/String;
if-eqz v3, :cond_1f5
move-object/from16 v0, v22
iget-object v3, v0, Landroid/content/pm/UserInfo;->name:Ljava/lang/String;
:goto_129
invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v5
if-eqz v16, :cond_1f9
const-string v3, " \u2714"
:goto_131
invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
move-object/from16 v0, v21
move-object/from16 v1, p0
move-object/from16 v2, v22
invoke-direct {v0, v1, v4, v3, v2}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;ILjava/lang/CharSequence;Landroid/content/pm/UserInfo;)V
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, v21
invoke-virtual {v3, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto :goto_ff
:cond_14c
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$SilentModeTriStateAction;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAudioManager:Landroid/media/AudioManager;
move-object/from16 v0, p0
iget-object v6, v0, Lcom/android/internal/policy/impl/GlobalActions;->mHandler:Landroid/os/Handler;
invoke-direct {v3, v4, v5, v6}, Lcom/android/internal/policy/impl/GlobalActions$SilentModeTriStateAction;-><init>(Landroid/content/Context;Landroid/media/AudioManager;Landroid/os/Handler;)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$Action;
goto/16 :goto_11
:cond_163
sget-short v3, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_DEVICE_flag:S
const/16 v4, 0x9
if-ne v3, v4, :cond_1a6
sget-short v3, Lcom/htc/htcjavaflag/HtcBuildFlag;->Htc_PROJECT_flag:S
const/16 v4, 0xd1
if-ne v3, v4, :cond_1a6
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$6;
const v5, 0x402003d
const v6, 0x104013a
move-object/from16 v0, p0
invoke-direct {v4, v0, v5, v6}, Lcom/android/internal/policy/impl/GlobalActions$6;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$Action;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mVibrationModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mMobileNetworkModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :goto_e0
:cond_1a6
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$7;
const v5, 0x402003d
const v6, 0x104013a
move-object/from16 v0, p0
invoke-direct {v4, v0, v5, v6}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeAction:Lcom/android/internal/policy/impl/GlobalActions$Action;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mVibrationModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v3, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :goto_e0
:catch_1dd
move-exception v18
const/4 v12, 0x0
goto/16 :goto_fb
:cond_1e1
const/16 v16, 0x0
goto/16 :goto_115
:cond_1e5
iget v3, v12, Landroid/content/pm/UserInfo;->id:I
move-object/from16 v0, v22
iget v4, v0, Landroid/content/pm/UserInfo;->id:I
if-ne v3, v4, :cond_1f1
const/16 v16, 0x1
goto/16 :goto_115
:cond_1f1
const/16 v16, 0x0
goto/16 :goto_115
:cond_1f5
const-string v3, "Primary"
goto/16 :goto_129
:cond_1f9
const-string v3, ""
goto/16 :goto_131
:cond_1fd
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
const/4 v4, 0x0
move-object/from16 v0, p0
invoke-direct {v3, v0, v4}, Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;-><init>(Lcom/android/internal/policy/impl/GlobalActions;Lcom/android/internal/policy/impl/GlobalActions$1;)V
move-object/from16 v0, p0
iput-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAdapter:Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
new-instance v11, Lcom/htc/widget/HtcAlertDialog$Builder;
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-direct {v11, v3}, Lcom/htc/widget/HtcAlertDialog$Builder;-><init>(Landroid/content/Context;)V
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->isSense2Mode()Z
move-result v3
if-eqz v3, :cond_278
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const-string v4, "global_actions"
const-string v5, "string"
const-string v6, "android"
invoke-virtual {v3, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v15
:goto_22a
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mAdapter:Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
move-object/from16 v0, p0
invoke-virtual {v11, v3, v0}, Lcom/htc/widget/HtcAlertDialog$Builder;->setAdapter(Landroid/widget/ListAdapter;Landroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v3
const/4 v4, 0x1
invoke-virtual {v3, v4}, Lcom/htc/widget/HtcAlertDialog$Builder;->setInverseBackgroundForced(Z)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v3
invoke-virtual {v3, v15}, Lcom/htc/widget/HtcAlertDialog$Builder;->setTitle(I)Lcom/htc/widget/HtcAlertDialog$Builder;
invoke-virtual {v11}, Lcom/htc/widget/HtcAlertDialog$Builder;->create()Lcom/htc/widget/HtcAlertDialog;
move-result-object v13
invoke-virtual {v13}, Lcom/htc/widget/HtcAlertDialog;->getListView()Landroid/widget/ListView;
move-result-object v3
const/4 v4, 0x1
invoke-virtual {v3, v4}, Landroid/widget/ListView;->setItemsCanFocus(Z)V
invoke-virtual {v13}, Lcom/htc/widget/HtcAlertDialog;->getListView()Landroid/widget/ListView;
move-result-object v3
const/4 v4, 0x1
invoke-virtual {v3, v4}, Landroid/widget/ListView;->setLongClickable(Z)V
invoke-virtual {v13}, Lcom/htc/widget/HtcAlertDialog;->getListView()Landroid/widget/ListView;
move-result-object v3
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$9;
move-object/from16 v0, p0
invoke-direct {v4, v0}, Lcom/android/internal/policy/impl/GlobalActions$9;-><init>(Lcom/android/internal/policy/impl/GlobalActions;)V
invoke-virtual {v3, v4}, Landroid/widget/ListView;->setOnItemLongClickListener(Landroid/widget/AdapterView$OnItemLongClickListener;)V
invoke-virtual {v13}, Lcom/htc/widget/HtcAlertDialog;->getWindow()Landroid/view/Window;
move-result-object v3
const/16 v4, 0x7d8
invoke-virtual {v3, v4}, Landroid/view/Window;->setType(I)V
move-object/from16 v0, p0
invoke-virtual {v13, v0}, Lcom/htc/widget/HtcAlertDialog;->setOnDismissListener(Landroid/content/DialogInterface$OnDismissListener;)V
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->isSense2Mode()Z
move-result v3
if-eqz v3, :cond_277
move-object/from16 v0, p0
invoke-virtual {v13, v0}, Lcom/htc/widget/HtcAlertDialog;->setOnKeyListener(Landroid/content/DialogInterface$OnKeyListener;)V
:cond_277
return-object v13
:cond_278
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const-string v4, "global_actions"
const-string v5, "string"
const-string v6, "android"
invoke-virtual {v3, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v15
goto :goto_22a
.end method[/COLOR]
.method private getWindowManager()Landroid/view/IWindowManager;
Navigate to \com\android\internal\policy\impl\GlobalActions$5.smali
SEARCH FOR:
Code:
.method public onPress()V
AFTER REPLACE THE REST OF THE FILE WITH
Code:
.locals 6
const/4 v5, 0x4
new-instance v1, Lcom/htc/widget/HtcAlertDialog$Builder;
iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions$5;->this$0:Lcom/android/internal/policy/impl/GlobalActions;
#getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v2}, Lcom/android/internal/policy/impl/GlobalActions;->access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
move-result-object v2
invoke-direct {v1, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;-><init>(Landroid/content/Context;)V
const v2, 0x1080027
invoke-virtual {v1, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;->setIcon(I)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v1
const v2, 0x20400cd
invoke-virtual {v1, v2}, Lcom/htc/widget/HtcAlertDialog$Builder;->setTitle(I)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v1
sget-object v2, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
const/4 v3, 0x0
new-instance v4, Lcom/android/internal/policy/impl/GlobalActions$5$2;
invoke-direct {v4, p0}, Lcom/android/internal/policy/impl/GlobalActions$5$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions$5;)V
invoke-virtual {v1, v2, v3, v4}, Lcom/htc/widget/HtcAlertDialog$Builder;->setSingleChoiceItems([Ljava/lang/CharSequence;ILandroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v1
const v2, 0x2040151
new-instance v3, Lcom/android/internal/policy/impl/GlobalActions$5$1;
invoke-direct {v3, p0}, Lcom/android/internal/policy/impl/GlobalActions$5$1;-><init>(Lcom/android/internal/policy/impl/GlobalActions$5;)V
invoke-virtual {v1, v2, v3}, Lcom/htc/widget/HtcAlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v1
const/high16 v2, 0x104
const/4 v3, 0x0
invoke-virtual {v1, v2, v3}, Lcom/htc/widget/HtcAlertDialog$Builder;->setNegativeButton(ILandroid/content/DialogInterface$OnClickListener;)Lcom/htc/widget/HtcAlertDialog$Builder;
move-result-object v1
invoke-virtual {v1}, Lcom/htc/widget/HtcAlertDialog$Builder;->create()Lcom/htc/widget/HtcAlertDialog;
move-result-object v0
invoke-virtual {v0}, Lcom/htc/widget/HtcAlertDialog;->getWindow()Landroid/view/Window;
move-result-object v1
const/16 v2, 0x7d8
invoke-virtual {v1, v2}, Landroid/view/Window;->setType(I)V
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions$5;->this$0:Lcom/android/internal/policy/impl/GlobalActions;
#getter for: Lcom/android/internal/policy/impl/GlobalActions;->mContext:Landroid/content/Context;
invoke-static {v1}, Lcom/android/internal/policy/impl/GlobalActions;->access$200(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/content/Context;
move-result-object v1
invoke-virtual {v1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v1
const v2, 0x1110009
invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getBoolean(I)Z
move-result v1
if-nez v1, :cond_60
invoke-virtual {v0}, Lcom/htc/widget/HtcAlertDialog;->getWindow()Landroid/view/Window;
move-result-object v1
invoke-virtual {v1, v5, v5}, Landroid/view/Window;->setFlags(II)V
:cond_60
invoke-virtual {v0}, Lcom/htc/widget/HtcAlertDialog;->show()V
return-void
.end method
.method public showBeforeProvisioning()Z
.locals 1
const/4 v0, 0x1
return v0
.end method
.method public showDuringKeyguard()Z
.locals 1
const/4 v0, 0x1
return v0
.end method
Navigate to \com\android\internal\policy\impl\GlobalActions$6.smali
REPLACE
Code:
.method constructor <init>(Lcom/android/internal/policy/impl/GlobalActions;[COLOR="Red"]II[/COLOR])V
WITH
Code:
.method constructor <init>(Lcom/android/internal/policy/impl/GlobalActions;[COLOR="red"]III[/COLOR])V
REPLACE
Code:
invoke-direct {[COLOR="red"]p0, p2, p3[/COLOR]}, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;-><init>([COLOR="red"]II[/COLOR])V
WITH
Code:
invoke-direct {[COLOR="red"]p0, p2, p3, p4[/COLOR]}, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;-><init>([COLOR="red"]III[/COLOR])V
REPLACE
Code:
const/4 v1, 0x[COLOR="red"]1[/COLOR]
invoke-static {v0, v1}, Lcom/htc/app/HtcShutdownThread;->[COLOR="red"]shutdown[/COLOR](Landroid/content/Context;Z)V
WITH
Code:
const/4 v1, 0x[COLOR="red"]0[/COLOR]
invoke-static {v0, v1}, Lcom/htc/app/HtcShutdownThread;->[COLOR="red"]hibernate[/COLOR](Landroid/content/Context;Z)V
Navigate to \com\android\internal\policy\impl\GlobalActions$SinglePressAction.smali
ADD GREEN TEXT
Code:
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/GlobalActions;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x40a
name = "SinglePressAction"
.end annotation
[COLOR="SeaGreen"]# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;[/COLOR]
# instance fields
.field private final mIconResId:I
.field private final mMessage:Ljava/lang/CharSequence;
.field private final mMessageResId:I
.field private final mStatusResId:I
SEARCH FOR
Code:
# direct methods
ADD AFTER
Code:
.method static constructor <clinit>()V
.locals 3
const/4 v0, 0x4
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Normal"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Hot restart"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Bootloader"
aput-object v2, v0, v1
const/4 v1, 0x3
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
The Final Step
Now that all the smali files have been edited, recompile your .jar, rename your file to android.policy.jar and push to /system/framework/android.policy.jar. Smali files are stored in classes.dex inside of .apks and .jars, I have uploaded some classes.dexs that include the other mods listed here as well as modified/unmodified smalis. Enjoy!
EXTRA FILES
GlobalActions$5$1.smali
GlobalActions$5$2.smali
STOCK FILES
GlobalActions.smali
GlobalActions$5.smali
GlobalActions$6.smali
GlobalActions$SinglePressAction.smali
classes.dex
android.policy.jar
APM FILES
GlobalActions.smali
GlobalActions$5.smali
GlobalActions$6.smali
GlobalActions$SinglePressAction.smali
classes.dex
android.policy.jar
APM + VOL-TRACK + BACK-KILL FILES
classes.dex
android.policy.jar
#ASOP
VOLUME ROCKER MOD
The Mod
When listening to music, with the screen off, long-press the VOL+ key to change tracks forward and long-press the VOL- key to change tracks backwards.
Decompile
You gotta figure this one out! Learn how to use apktool, baksmali or VTS. It is HIGHLY recommended that if you are decompiling with apktool or baksmali to add "-b" modifier. If using VTS, uncheck the smali debug code. This will make your smali code MUCH smaller - less system space = MORE RAM.
What Needs to Be Added
This mod requires two smali files that do not exist in the stock android.policy.jar you will find them attached at the bottom of this post.
PhoneWindowManager$VolumeLongPressF.smali
PhoneWindowManager$VolumeLongPressR.smali
They go in \com\android\internal\policy\impl\
What needs to Be Changed [The long part]
Using Notepad++ or a similar text editor (ie not Notepad) navigate to \com\android\internal\policy\impl\PhoneWindowManager.smali
SEARCH FOR
Code:
.field mIsGuestMode:Z
ADD TEXT IN GREEN
Code:
.field mIsGuestMode:Z
.field mIsHtcDockScreenAsHome:Z
[COLOR="SeaGreen"].field mIsLongPress:Z[/COLOR]
.field mKeyEventsBlocked:Z
.field mKeyboardTapVibePattern:[J
SEARCH FOR
Code:
.field private mVolumeDownKeyTime:J
ADD TEXT IN GREEN
Code:
.field private mVolumeDownKeyTime:J
.field private mVolumeDownKeyTriggered:Z
[COLOR="SeaGreen"].field mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR]
.field private mVolumeUpKeyTriggered:Z
[COLOR="SeaGreen"].field mVolumeUpLongPress:Ljava/lang/Runnable;
.field mWakeAcquired:Z[/COLOR]
.field mWindowManager:Landroid/view/IWindowManager;
.field mWindowManagerFuncs:Landroid/view/WindowManagerPolicy$WindowManagerFuncs;
SEARCH FOR:
.method public constructor <init>()V
NOW SCROLL UNTIL YOU FIND THIS TEXT, ADD TEXT IN GREEN
Code:
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$27;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$27;-><init> Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSetLastUserActivity:Ljava/lang/Runnable;
[COLOR="SeaGreen"]new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressF;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressF;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressR;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$VolumeLongPressR;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR]
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$28;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$28;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mPowerLongPress_Toast:Ljava/lang/Runnable;
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$29;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$29;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mEndCallLongPress:Ljava/lang/Runnable;
return-void
.end method
SEARCH FOR
Code:
.method handleVolumeKey(II)V
SCROLL TO THE END OF THIS METHOD AND ADD NEW METHODS IN GREEN
Code:
.end method
[COLOR="SeaGreen"].method handleVolumeLongPress(I)V
.locals 4
const/16 v1, 0x18
if-ne p1, v1, :cond_11
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
:goto_6
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
invoke-static {}, Landroid/view/ViewConfiguration;->getLongPressTimeout()I
move-result v2
int-to-long v2, v2
invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
:cond_11
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
goto :goto_6
.end method
.method handleVolumeLongPressAbort()V
.locals 2
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
return-void
.end method[/COLOR]
.method public hasNavigationBar()Z
SEARCH FOR
Code:
sparse-switch v13, :sswitch_data_6[COLOR="red"]82[/COLOR]
CHANGE TO
Code:
sparse-switch v13, :sswitch_data_6[COLOR="Red"]c4[/COLOR]
SEARCH FOR
Code:
:sswitch_274
BELOW THIS, YOU WILL NEED TO REPLACE EVERYTHING UNTIL AND INCLUDING
Code:
:sswitch_data_6c4
.sparse-switch
0x5 -> :sswitch_699
0x6 -> :sswitch_38a
0x18 -> :sswitch_274
0x19 -> :sswitch_274
0x1a -> :sswitch_49b
0x4f -> :sswitch_65c
0x55 -> :sswitch_64e
0x56 -> :sswitch_65c
0x57 -> :sswitch_65c
0x58 -> :sswitch_65c
0x59 -> :sswitch_65c
0x5a -> :sswitch_65c
0x5b -> :sswitch_65c
0x7e -> :sswitch_64e
0x7f -> :sswitch_64e
0x82 -> :sswitch_65c
0xa4 -> :sswitch_274
.end sparse-switch
.end method
THE CODE TO ADD CAN BE FOUND HERE:
http://goo.gl/1SfRm
IT'S TOO BIG FOR XDA
SEARCH FOR
Code:
.method sendEvent(IIIJ)V
SCROLL TO THE END OF THIS METHOD AND ADD NEW METHOD IN GREEN
Code:
.end method
[COLOR="SeaGreen"].method protected sendMediaButtonEvent(I)V
.locals 13
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
new-instance v11, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v11, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v0, Landroid/view/KeyEvent;
const/4 v5, 0x0
const/4 v7, 0x0
move-wide v3, v1
move v6, p1
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;-><init>(JJIII)V
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v11, v4, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v11, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
new-instance v12, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v12, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
new-instance v3, Landroid/view/KeyEvent;
const/4 v8, 0x1
const/4 v10, 0x0
move-wide v4, v1
move-wide v6, v1
move v9, p1
invoke-direct/range {v3 .. v10}, Landroid/view/KeyEvent;-><init>(JJIII)V
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v12, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v12, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
return-void
.end method[/COLOR]
.method setAttachedWindowFrames(Landroid/view/WindowManagerPolicy$WindowState;IILandroid/view/WindowManagerPolicy$WindowState;ZLandroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;Landroid/graphics/Rect;)V
The Final Step
Now that all the smali files have been edited, recompile your .jar, rename your file to android.policy.jar and push to /system/framework/android.policy.jar. Smali files are stored in classes.dex inside of .apks and .jars, I have uploaded some classes.dexs that include the other mods listed here as well as modified/unmodified smalis. Enjoy!
EXTRA FILES
PhoneWindowManager$VolumeLongPressF.smali
PhoneWindowManager$VolumeLongPressR.smali
STOCK FILES
PhoneWindowManager.smali
classes.dex
android.policy.jar
VOL-TRACK FILES
PhoneWindowManager.smali
classes.dex
android.policy.jar
APM + VOL-TRACK FILES
classes.dex
android.policy.jar
APM + VOL-TRACK + BACK-KILL FILES
classes.dex
android.policy.jar
#ASOP
LONG-PRESS BACK TO KILL THIRD-PARTY APPS
The Mod
By long-pressing the Back capacitive button, any third-party app will be killed. This is very handy for when apps become unresponsive.
Decompile
You gotta figure this one out! Learn how to use apktool, baksmali or VTS. It is HIGHLY recommended that if you are decompiling with apktool or baksmali to add "-b" modifier. If using VTS, uncheck the smali debug code. This will make your smali code MUCH smaller - less system space = MORE RAM.
What needs to Be Changed [The long part]
Using Notepad++ or a similar text editor (ie not Notepad) navigate to \com\android\internal\policy\impl\PhoneWindowManager.smali
SEARCH FOR
Code:
.field mAutoMotiveReceiver:Landroid/content/BroadcastReceiver;
ADD TEXT IN GREEN
Code:
.field mAutoMotiveReceiver:Landroid/content/BroadcastReceiver;
[COLOR="SeaGreen"].field mBackKeyLongPressed:Z[/COLOR]
.field mBootCompleted:Z
SEARCH FOR
Code:
.method private launchAssistLongPressAction()V
SCROLL TO THE END OF THIS METHOD AND ADD NEW METHOD IN GREEN
Code:
.end method
[COLOR="SeaGreen"].method private launchBackLongPressAction()V
.locals 18
:try_start_0
invoke-static {}, Landroid/app/ActivityManagerNative;->getDefault()Landroid/app/IActivityManager;
move-result-object v9
invoke-interface {v9}, Landroid/app/IActivityManager;->getRunningAppProcesses()Ljava/util/List;
move-result-object v5
move-object/from16 v0, p0
iget-object v14, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const-string v15, "activity"
invoke-virtual {v14, v15}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/app/ActivityManager;
const/4 v14, 0x1
invoke-virtual {v2, v14}, Landroid/app/ActivityManager;->getRunningTasks(I)Ljava/util/List;
move-result-object v12
const/4 v14, 0x0
invoke-interface {v12, v14}, Ljava/util/List;->get(I)Ljava/lang/Object;
move-result-object v14
check-cast v14, Landroid/app/ActivityManager$RunningTaskInfo;
iget-object v6, v14, Landroid/app/ActivityManager$RunningTaskInfo;->topActivity:Landroid/content/ComponentName;
invoke-interface {v5}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v14
:cond_26
:goto_26
invoke-interface {v14}, Ljava/util/Iterator;->hasNext()Z
move-result v15
if-nez v15, :cond_2d
:cond_2c
:goto_2c
return-void
:cond_2d
invoke-interface {v14}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
check-cast v3, Landroid/app/ActivityManager$RunningAppProcessInfo;
iget v13, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->uid:I
const/16 v15, 0x2710
if-lt v13, v15, :cond_26
const v15, 0x1869f
if-gt v13, v15, :cond_26
iget v15, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->importance:I
const/16 v16, 0x64
move/from16 v0, v16
if-ne v15, v0, :cond_26
iget-object v15, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->pkgList:[Ljava/lang/String;
if-eqz v15, :cond_26
invoke-interface {v5}, Ljava/util/List;->size()I
move-result v15
if-lez v15, :cond_26
iget-object v15, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->processName:Ljava/lang/String;
invoke-virtual {v6}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;
move-result-object v16
invoke-virtual/range {v15 .. v16}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v15
if-eqz v15, :cond_26
new-instance v8, Landroid/content/Intent;
const-string v15, "android.intent.action.MAIN"
invoke-direct {v8, v15}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
const-string v15, "android.intent.category.HOME"
invoke-virtual {v8, v15}, Landroid/content/Intent;->addCategory(Ljava/lang/String;)Landroid/content/Intent;
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
move-result-object v15
const/16 v16, 0x0
move/from16 v0, v16
invoke-virtual {v15, v8, v0}, Landroid/content/pm/PackageManager;->resolveActivity(Landroid/content/Intent;I)Landroid/content/pm/ResolveInfo;
move-result-object v11
iget-object v15, v11, Landroid/content/pm/ResolveInfo;->activityInfo:Landroid/content/pm/ActivityInfo;
iget-object v15, v15, Landroid/content/pm/ActivityInfo;->processName:Ljava/lang/String;
iget-object v0, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->processName:Ljava/lang/String;
move-object/from16 v16, v0
invoke-virtual/range {v15 .. v16}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v15
if-nez v15, :cond_2c
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
invoke-virtual {v15}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
:try_end_8d
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_8d} :catch_d8
move-result-object v10
:try_start_8e
invoke-virtual {v6}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;
move-result-object v15
const/16 v16, 0x0
move/from16 v0, v16
invoke-virtual {v10, v15, v0}, Landroid/content/pm/PackageManager;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;
:try_end_99
.catch Ljava/lang/Exception; {:try_start_8e .. :try_end_99} :catch_db
move-result-object v1
:goto_9a
if-eqz v1, :cond_de
:try_start_9c
invoke-virtual {v10, v1}, Landroid/content/pm/PackageManager;->getApplicationLabel(Landroid/content/pm/ApplicationInfo;)Ljava/lang/CharSequence;
move-result-object v4
:goto_a0
check-cast v4, Ljava/lang/String;
invoke-virtual {v6}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;
move-result-object v15
invoke-interface {v9, v15}, Landroid/app/IActivityManager;->forceStopPackage(Ljava/lang/String;)V
iget v15, v3, Landroid/app/ActivityManager$RunningAppProcessInfo;->pid:I
invoke-static {v15}, Landroid/os/Process;->killProcess(I)V
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
new-instance v16, Ljava/lang/StringBuilder;
invoke-static {v4}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v17
invoke-direct/range {v16 .. v17}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
const-string v17, " killed."
invoke-virtual/range {v16 .. v17}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v16
invoke-virtual/range {v16 .. v16}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v16
const-string v0, "lyapota"
move-object/from16 v2, v15
move-object/from16 v3, v16
invoke-static {v0, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
const/4 v4, 0x0
invoke-static {v2, v3, v4}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v15
invoke-virtual {v15}, Landroid/widget/Toast;->show()V
goto/16 :goto_26
:catch_d8
move-exception v14
goto/16 :goto_2c
:catch_db
move-exception v7
const/4 v1, 0x0
goto :goto_9a
:cond_de
const-string v4, "(unknown)"
:try_end_e0
.catch Ljava/lang/Exception; {:try_start_9c .. :try_end_e0} :catch_d8
goto :goto_a0
.end method[/COLOR]
.method static makeFnState(IIZIZ)V
(To make life easy) SEARCH FOR
Code:
const-string v40, "ignore handleLongPressOnHome when hasRingingCall or it\'s in GuestMode"
BELOW THIS, YOU WILL NEED TO REPLACE EVERYTHING UNTIL AND INCLUDING
Code:
:pswitch_data_8a4
.packed-switch 0x0
:pswitch_4bd
:pswitch_4c1
:pswitch_4bd
.end packed-switch
:pswitch_data_8ae
.packed-switch 0x1
:pswitch_527
:pswitch_545
.end packed-switch
.end method
NOTE: This last section WILL change with the new data.
THE CODE TO ADD CAN BE FOUND HERE:
http://goo.gl/NA8KI
IT'S TOO BIG FOR XDA
The Final Step
Now that all the smali files have been edited, recompile your .jar, rename your file to android.policy.jar and push to /system/framework/android.policy.jar. Smali files are stored in classes.dex inside of .apks and .jars, I have uploaded some classes.dexs that include the other mods listed here as well as modified/unmodified smalis. Enjoy!
STOCK FILES
PhoneWindowManager.smali
classes.dex
android.policy.jar
BACK-KILL FILES
PhoneWindowManager.smali
classes.dex
android.policy.jar
APM + BACK-KILL FILES
classes.dex
android.policy.jar
APM + VOL-TRACK + BACK-KILL FILES
classes.dex
android.policy.jar
#ASOP
Just in case there are more...
Awesome. /reserved
Sent from my EVO using Tapatalk 2
Reserved
Sent from my EVO using Xparent Red Tapatalk 2
can anyone see if this is updated? i cant seem to download the extra files.
Sup joe. It's not updated lol
Sent from my EVO using Tapatalk
Trying to dig around for those files
Sent from my EVO using Tapatalk now Free
ssojyeti2 said:
Sup joe. It's not updated lol
Sent from my EVO using Tapatalk
Click to expand...
Click to collapse
Sup bro! You been hiding around here?
Sent from my EVO using xda premium
tested and work perfectly in JB 4.1.2 xwms3 based
Before modding do a Nandroid Backup
To achieve you need:
SecSettings.apk
SecContacts.apk
tool for decompile and compile like apktool 1.5.2;
tool for text edit like notepad++:
Start with SecSettings.apk:
Decompile SecSettings.apk ,go in res/xml ,open with text editor display_settings.xml and add the red line
Code:
<CheckBoxPreference android:persistent="false" android:title="@string/display_saving" android:key="power_saving_mode" android:summary="@string/display_saving_mode_summary" />
<CheckBoxPreference android:persistent="false" android:title="@string/notification_pulse_title" android:key="notification_pulse" />[COLOR="Red"]
<PreferenceCategory android:title="@string/dialer_options">
<ListPreference android:persistent="false" android:entries="@array/dialer_bg_entries" android:title="@string/dialer_bg_chooser" android:key="dialer_chooser" android:summary="@string/dialer_bg_chooser_summary" android:entryValues="@array/dialer_bg_values" />
</PreferenceCategory>[/COLOR]
Go in res/value open with text editor arrays.xml and add at the end the red line
Code:
[COLOR="Red"]
<string-array name="dialer_bg_entries">
<item>Stock Dialer</item>
<item>Anastasia Dialer</item>
<item>BlackGlass Dialer</item>
<item>Chrome Dialer</item>
<item>Orange Dialer</item>
<item>Rainbow Dialer</item>
<item>White Dialer</item>
</string-array>
<string-array name="dialer_bg_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
</string-array>[/COLOR]
</resources>
Go in res/value open with text editor strings.xml and add at the end this line
Code:
[COLOR="Red"]
<string name="dialer_options">Options Dialer</string>
<string name="dialer_bg_chooser">Choose Dialer</string>
<string name="dialer_bg_chooser_summary">Select the background of dialer</string>[/COLOR]
</resources>
Go in smali\com\android\settings\DisplaySettings.smali file and add the following lines in RED
Code:
.field private final mCurConfig:Landroid/content/res/Configuration;
[COLOR="Red"]
.field private mDialerChooser:Landroid/preference/ListPreference;
[/COLOR]
.field private mDirect:I
.field mDirectUri:Landroid/net/Uri;
In the same file find .method public onCreate and add the following lines in RED
Code:
iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
.line 424
iget-object v12, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
invoke-virtual {v12, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[COLOR="Red"]
const-string v12, "dialer_chooser"
invoke-virtual {p0, v12}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v12
check-cast v12, Landroid/preference/ListPreference;
iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mDialerChooser:Landroid/preference/ListPreference;
const-string v12, "dialer_chooser"
const/4 v13, 0x0
invoke-static {v8, v12, v13}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mDialerChooser:Landroid/preference/ListPreference;
invoke-static {v12}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v12
invoke-virtual {v13, v12}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mDialerChooser:Landroid/preference/ListPreference;
invoke-virtual {v13, p0}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[/COLOR]
In the same file find .method public onPreferenceChange then find this code and add the red lines ,in blue line some explanation
Code:
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :[COLOR="Red"]cond_dialer_chooser[/COLOR] [COLOR="Blue"]change this from cond_2 to cond_dialer_chooser[/COLOR]
.line 1089
check-cast p2, Ljava/lang/Boolean;
invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z
move-result v0
if-eqz v0, :cond_e
in the same method find this code and add the red lines
Code:
.line 1100
const-string v1, "DisplaySettings"
const-string v3, "CONTEXTUALPAGE_SWITCH_CHANGED changed = false"
invoke-static {v1, v3}, Landroid/util/Log;->secD(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_7
:cond_11
move-wide v0, v4
goto/16 :goto_3
[COLOR="Red"]
:cond_dialer_chooser
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mDialerChooser:Landroid/preference/ListPreference;
if-ne p1, v1, :cond_2
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "dialer_chooser"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_4[/COLOR]
.end method
Save all changes and compile SecSettings
SecContacts.apk part
Decompile SecContacts.apk ,download this zip View attachment Dialer_Background.zip and put all the drawable pngs in SecContacts\res\drawable-sw320dp-hdpi
Compile SecContacts and decompile the new SecContacts.apk to obtain the new ids of the new pngs
So open SystemUI\res\value\public and leave it open to check the new ids
Go in SecContacts/smali/com/sec/android/app/dialertab/dialpad and open DialpadFragment.smali file and add the following red lines
Code:
.field private mAddContactsDialog:Landroid/app/AlertDialog;[COLOR="Red"]
.field private mAdditionalButtonBackground:I
.field private mAdditionalButtonBackgroundLand:I[/COLOR]
.field private mAudioManager:Landroid/media/AudioManager;
.field private mButtonAnimLeft:Landroid/view/animation/TranslateAnimation;
.
.
.
.field private mDialButtonSim1:Landroid/view/View;
.field private mDialButtonSim2:Landroid/view/View;[COLOR="Red"]
.field private mDialerBackground:I
.field private mDialerLandBackground:I[/COLOR]
.field private mDialpad:Landroid/view/View;
.field private mDialpadAdditionalButtons:Landroid/view/View;
then add at the end these 4 new methods,
in blue lines some explanation
Code:
.method set_dialer_background(Landroid/content/Context;)V
.locals 5
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "dialer_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v1, v2, :cond_0
const v2, 0x2
if-eq v1, v2, :cond_1
const v2, 0x3
if-eq v1, v2, :cond_2
const v2, 0x4
if-eq v1, v2, :cond_3
const v2, 0x5
if-eq v1, v2, :cond_4
const v2, 0x6
if-eq v1, v2, :cond_5
const v2, 0x7f02039e [COLOR="Blue"]check this id with dialer_bg_p_01 in your res/value[/COLOR]
goto :goto_0
:cond_0
const v2, 0x7f02064b [COLOR="Blue"]check this id with anastasia_dialer_bg_p_01 in your res/value[/COLOR]
goto :goto_0
:cond_1
const v2, 0x7f02064c [COLOR="Blue"]check this id with blackglass_dialer_bg_p_01 in your res/value[/COLOR]
goto :goto_0
:cond_2
const v2, 0x7f02064d [COLOR="Blue"]check this id with chrome_dialer_bg_p_01 in your res/value[/COLOR]
goto :goto_0
:cond_3
const v2, 0x7f02064a [COLOR="Blue"]check this id with orange_dialer_bg_p_01 in your res/value[/COLOR]
goto :goto_0
:cond_4
const v2, 0x7f02064e [COLOR="Blue"]check this id with rainbow_dialer_bg_p_01 in your res/value[/COLOR]
goto :goto_0
:cond_5
const v2, 0x7f02064f [COLOR="Blue"]check this id with white_dialer_bg_p_01 in your res/value[/COLOR]
:goto_0
iput v2, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialerBackground:I
return-void
.end method
.method set_dialerland_background(Landroid/content/Context;)V
.locals 5
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "dialer_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v1, v2, :cond_0
const v2, 0x2
if-eq v1, v2, :cond_1
const v2, 0x3
if-eq v1, v2, :cond_2
const v2, 0x4
if-eq v1, v2, :cond_3
const v2, 0x5
if-eq v1, v2, :cond_4
const v2, 0x6
if-eq v1, v2, :cond_5
const v2, 0x7f020395 [COLOR="Blue"]check this id with dialer_bg_h_01 in your res/value[/COLOR]
goto :goto_0
:cond_0
const v2, 0x7f020656 [COLOR="Blue"]check this id with anastasia_dialer_bg_h_01 in your res/value[/COLOR]
goto :goto_0
:cond_1
const v2, 0x7f020658 [COLOR="Blue"]check this id with blackglass_dialer_bg_h_01 in your res/value[/COLOR]
goto :goto_0
:cond_2
const v2, 0x7f02065a [COLOR="Blue"]check this id with chrome_dialer_bg_h_01 in your res/value[/COLOR]
goto :goto_0
:cond_3
const v2, 0x7f02065c [COLOR="Blue"]check this id with orange_dialer_bg_h_01 in your res/value[/COLOR]
goto :goto_0
:cond_4
const v2, 0x7f02065e [COLOR="Blue"]check this id with rainbow_dialer_bg_h_01 in your res/value[/COLOR]
goto :goto_0
:cond_5
const v2, 0x7f020660 [COLOR="Blue"]check this id with white_dialer_bg_h_01 in your res/value[/COLOR]
:goto_0
iput v2, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialerLandBackground:I
return-void
.end method
.method set_additional_button_background(Landroid/content/Context;)V
.locals 5
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "dialer_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v1, v2, :cond_0
const v2, 0x2
if-eq v1, v2, :cond_1
const v2, 0x3
if-eq v1, v2, :cond_2
const v2, 0x4
if-eq v1, v2, :cond_3
const v2, 0x5
if-eq v1, v2, :cond_4
const v2, 0x6
if-eq v1, v2, :cond_5
const v2, 0x7f02039f [COLOR="Blue"]check this id with dialer_bg_p_02 in your res/value[/COLOR]
goto :goto_0
:cond_0
const v2, 0x7f020650 [COLOR="Blue"]check this id with anastasia_dialer_bg_p_02 in your res/value[/COLOR]
goto :goto_0
:cond_1
const v2, 0x7f020651 [COLOR="Blue"]check this id with blackglass_dialer_bg_p_02 in your res/value[/COLOR]
goto :goto_0
:cond_2
const v2, 0x7f020652 [COLOR="Blue"]check this id with chrome_dialer_bg_p_02 in your res/value[/COLOR]
goto :goto_0
:cond_3
const v2, 0x7f020653 [COLOR="Blue"]check this id with orange_dialer_bg_p_02 in your res/value[/COLOR]
goto :goto_0
:cond_4
const v2, 0x7f020654 [COLOR="Blue"]check this id with rainbow_dialer_bg_p_02 in your res/value[/COLOR]
goto :goto_0
:cond_5
const v2, 0x7f020655 [COLOR="Blue"]check this id with white_dialer_bg_p_02 in your res/value[/COLOR]
:goto_0
iput v2, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mAdditionalButtonBackground:I
return-void
.end method
.method set_additional_button_background_land(Landroid/content/Context;)V
.locals 5
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "dialer_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v1, v2, :cond_0
const v2, 0x2
if-eq v1, v2, :cond_1
const v2, 0x3
if-eq v1, v2, :cond_2
const v2, 0x4
if-eq v1, v2, :cond_3
const v2, 0x5
if-eq v1, v2, :cond_4
const v2, 0x6
if-eq v1, v2, :cond_5
const v2, 0x7f020396 [COLOR="Blue"]check this id with dialer_bg_h_02 in your res/value[/COLOR]
goto :goto_0
:cond_0
const v2, 0x7f020657 [COLOR="Blue"]check this id with anastasia_dialer_bg_h_02 in your res/value[/COLOR]
goto :goto_0
:cond_1
const v2, 0x7f020659 [COLOR="Blue"]check this id with blackglass_dialer_bg_h_02 in your res/value[/COLOR]
goto :goto_0
:cond_2
const v2, 0x7f02065b [COLOR="Blue"]check this id with chrome_dialer_bg_h_02 in your res/value[/COLOR]
goto :goto_0
:cond_3
const v2, 0x7f02065d [COLOR="Blue"]check this id with orange_dialer_bg_h_02 in your res/value[/COLOR]
goto :goto_0
:cond_4
const v2, 0x7f02065f [COLOR="Blue"]check this id with rainbow_dialer_bg_h_02 in your res/value[/COLOR]
goto :goto_0
:cond_5
const v2, 0x7f020661 [COLOR="Blue"]check this id with white_dialer_bg_h_02 in your res/value[/COLOR]
:goto_0
iput v2, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mAdditionalButtonBackgroundLand:I
return-void
.end method
In the same file find .method private showDialpadChooser(Z)V and change at the beginning .locals 5 to .locals 6
In the same method find this code
Code:
iget-object v1, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpad:Landroid/view/View;
invoke-virtual {v1, v3}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v1, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpad:Landroid/view/View;
invoke-virtual {v1, v3}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v1, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpad:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v5
invoke-virtual {p0, v5}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_dialer_background(Landroid/content/Context;)V
iget v5, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialerBackground:I
invoke-virtual {v1, v5}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
then find this code
Code:
iget-object v1, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadLand:Landroid/view/View;
invoke-virtual {v1, v3}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v1, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadLand:Landroid/view/View;
invoke-virtual {v1, v3}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v1, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadLand:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v5
invoke-virtual {p0, v5}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_dialerland_background(Landroid/content/Context;)V
iget v5, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialerLandBackground:I
invoke-virtual {v1, v5}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
then find this code,pay attention this is twice
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtons:Landroid/view/View;
invoke-virtual {v0, v3}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtons:Landroid/view/View;
invoke-virtual {v0, v3}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtons:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v5
invoke-virtual {p0, v5}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_additional_button_background(Landroid/content/Context;)V
iget v5, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mAdditionalButtonBackground:I
invoke-virtual {v0, v5}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
then find this code,pay attention this is twice
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtonsLand:Landroid/view/View;
invoke-virtual {v0, v3}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtonsLand:Landroid/view/View;
invoke-virtual {v0, v3}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtonsLand:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v5
invoke-virtual {p0, v5}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_additional_button_background_land(Landroid/content/Context;)V
iget v5, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mAdditionalButtonBackgroundLand:I
invoke-virtual {v0, v5}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
Then find the .method public resetAllLayout()V and change at the beginning .locals 12 to .locals 13
then in the same method find this code, pay attention it appears more than once and you need to add for each
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpad:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpad:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpad:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v12
invoke-virtual {p0, v12}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_dialer_background(Landroid/content/Context;)V
iget v12, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialerBackground:I
invoke-virtual {v0, v12}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
find this code, pay attention it appears more than once and you need to add for each
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadLand:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadLand:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadLand:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v12
invoke-virtual {p0, v12}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_dialerland_background(Landroid/content/Context;)V
iget v12, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialerLandBackground:I
invoke-virtual {v0, v12}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
find this code, pay attention it appears more than once and you need to add for each
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtons:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtons:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtons:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v12
invoke-virtual {p0, v12}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_additional_button_background(Landroid/content/Context;)V
iget v12, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mAdditionalButtonBackground:I
invoke-virtual {v0, v12}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
find this code, pay attention it appears more than once and you need to add for each
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtonsLand:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtonsLand:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtonsLand:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v12
invoke-virtual {p0, v12}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_additional_button_background_land(Landroid/content/Context;)V
iget v12, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mAdditionalButtonBackgroundLand:I
invoke-virtual {v0, v12}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
Save all changes and compile SecContacts then put SecSettings.apk and SecContacts.apk in your device
reserved .
Nice work mate. Keep it up, hope some more guides to come soon from your hard coded mind. ✌?
Sent from my GT-I9100 using Tapatalk 2
remuntada78 said:
tested and work perfectly in JB 4.1.2 xwms3 based
Save all changes and compile SecContacts then put SecSettings.apk and SecContacts.apk in your device
Click to expand...
Click to collapse
Do we have to sign the apk files?
avirk said:
Nice work mate. Keep it up, hope some more guides to come soon from your hard coded mind. ✌?
Sent from my GT-I9100 using Tapatalk 2
Click to expand...
Click to collapse
Thanks mate
homeboy1956 said:
Do we have to sign the apk files?
Click to expand...
Click to collapse
No need to sign
remuntada78 said:
Thanks mate
No need to sign
Click to expand...
Click to collapse
Thanks mate, will try asap.
Good job man
Sent from my SM-G900F using Tapatalk
Goldie said:
Good job man
Sent from my SM-G900F using Tapatalk
Click to expand...
Click to collapse
Thanks to you and for your guide
Inviato dal mio GT-I9100 utilizzando Tapatalk
remuntada78 said:
Thanks mate
No need to sign
Click to expand...
Click to collapse
Nice doing, great work.
I love it. Is there a way to change the color of the number?
homeboy1956 said:
Nice doing, great work.
I love it. Is there a way to change the color of the number?
Click to expand...
Click to collapse
The easiest way to change the color of the number is to edit the pngs in drawables-sw320dp-hdpi, they are call_dial_btn_xx and call_dial_btn_xx_h, you can use a tool for image editor like paint.net or gimp
Inviato dal mio GT-I9100 utilizzando Tapatalk
Well done. I will add to my ROM with your permission.
phenomarc said:
Well done. I will add to my ROM with your permission.
Click to expand...
Click to collapse
Thanks mate , you are free to add
inviato dal mio galaxy s2 con tapatalk
remuntada78 said:
Thanks mate , you are free to add
inviato dal mio galaxy s2 con tapatalk
Click to expand...
Click to collapse
Did you succes with List View Animations in XWMS3?
phenomarc said:
Did you succes with List View Animations in XWMS3?
Click to expand...
Click to collapse
Yes it's all working fine now
inviato dal mio galaxy s2 con tapatalk
I've find your Guide mate! [emoji1]
This is a Great work! You are a Genius! Really! Congratulation 4 Your big work and Your great capacity. [emoji1]
Of course... will try the Mod. [emoji5]
glowerita said:
I've find your Guide mate! [emoji1]
This is a Great work! You are a Genius! Really! Congratulation 4 Your big work and Your great capacity. [emoji1]
Of course... will try the Mod. [emoji5]
Click to expand...
Click to collapse
Thanks mate , trying to learning
Inviato dal mio GT-I9100 utilizzando Tapatalk
remuntada78 said:
Thanks mate , trying to learning
Inviato dal mio GT-I9100 utilizzando Tapatalk
Click to expand...
Click to collapse
I think You have to teach.
The learning time is finish 4 you. [emoji1]
glowerita said:
I think You have to teach.
The learning time is finish 4 you. [emoji1]
Click to expand...
Click to collapse
[emoji23] [emoji23] [emoji23]
Inviato dal mio GT-I9100 utilizzando Tapatalk
remuntada78 said:
[emoji23] [emoji23] [emoji23]
Inviato dal mio GT-I9100 utilizzando Tapatalk
Click to expand...
Click to collapse
Don't cry! Be happy to be a Great and Good Android's Teacher. [emoji1]
Congratulation again mate! [emoji1]
About Kk
Great job man
But the question is I can't do in a ROM KK 4.4.2 . Sorry my bad English.
Avanti Italia y la Roma. Salute di Argentina.
Hey guys,
I have modded 2-3 Android Apps for Root check and I was able to use them without problem on my rooted device. However this app is giving me a lot of issues. I believe I have found the 2 smali files that have the root check. Does anyone know what needs to be modded or how it needs to be modded on these 2 smali files to bypass the root detection or to make the app believe the device is not rooted?
AppStartMeasurement.smali
Code:
.class public Lcom/comscore/applications/AppStartMeasurement;
.super Lcom/comscore/applications/ApplicationMeasurement;
# direct methods
.method protected constructor <init>(Lcom/comscore/analytics/Core;Lcom/comscore/applications/EventType;Ljava/lang/String;Z)V
.locals 5
const/4 v4, 0x0
invoke-direct {p0, p1, p2, p3, p4}, Lcom/comscore/applications/ApplicationMeasurement;-><init>(Lcom/comscore/analytics/Core;Lcom/comscore/applications/EventType;Ljava/lang/String;Z)V
new-instance v0, Lcom/comscore/measurement/Label;
const-string v1, "ns_ap_gs"
invoke-virtual {p1}, Lcom/comscore/analytics/Core;->getFirstInstallId()J
move-result-wide v2
invoke-static {v2, v3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
move-result-object v2
invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v3
invoke-direct {v0, v1, v2, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V
invoke-virtual {p0, v0}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V
new-instance v0, Lcom/comscore/measurement/Label;
const-string v1, "ns_ap_install"
invoke-virtual {p1}, Lcom/comscore/analytics/Core;->getInstallId()J
move-result-wide v2
invoke-static {v2, v3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
move-result-object v2
invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v3
invoke-direct {v0, v1, v2, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V
invoke-virtual {p0, v0}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V
new-instance v0, Lcom/comscore/measurement/Label;
const-string v1, "ns_ap_runs"
invoke-virtual {p1}, Lcom/comscore/analytics/Core;->getRunsCount()I
move-result v2
invoke-static {v2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v2
invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v3
invoke-direct {v0, v1, v2, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V
invoke-virtual {p0, v0}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V
if-eqz p4, :cond_0
new-instance v0, Lcom/comscore/measurement/Label;
const-string v1, "ns_ap_csf"
const-string v2, "1"
invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v3
invoke-direct {v0, v1, v2, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V
invoke-virtual {p0, v0}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V
:cond_0
const-string v0, "0"
invoke-static {}, Lcom/comscore/utils/RootDetector;->isDeviceRooted()Z
move-result v1
if-eqz v1, :cond_1
const-string v0, "1"
:cond_1
new-instance v1, Lcom/comscore/measurement/Label;
const-string v2, "ns_ap_jb"
invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v3
invoke-direct {v1, v2, v0, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V
invoke-virtual {p0, v1}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V
new-instance v0, Lcom/comscore/measurement/Label;
const-string v1, "ns_ap_lastrun"
invoke-virtual {p1}, Lcom/comscore/analytics/Core;->getPreviousGenesis()J
move-result-wide v2
invoke-static {v2, v3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
move-result-object v2
invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v3
invoke-direct {v0, v1, v2, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V
invoke-virtual {p0, v0}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V
invoke-virtual {p1}, Lcom/comscore/analytics/Core;->getPreviousVersion()Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_2
invoke-virtual {v0}, Ljava/lang/String;->length()I
move-result v1
if-lez v1, :cond_2
new-instance v1, Lcom/comscore/measurement/Label;
const-string v2, "ns_ap_updated"
invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object v3
invoke-direct {v1, v2, v0, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V
invoke-virtual {p0, v1}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V
:cond_2
return-void
.end method
RootDetector.smali
Code:
.class public Lcom/comscore/utils/RootDetector;
.super Ljava/lang/Object;
# direct methods
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method private static a()Z
.locals 2
sget-object v0, Landroid/os/Build;->TAGS:Ljava/lang/String;
if-eqz v0, :cond_0
const-string v1, "test-keys"
invoke-virtual {v0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v0
if-eqz v0, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method private static b()Z
.locals 2
:try_start_0
new-instance v0, Ljava/io/File;
const-string v1, "/system/app/Superuser.apk"
invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
invoke-virtual {v0}, Ljava/io/File;->exists()Z
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
move-result v0
if-eqz v0, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:catch_0
move-exception v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method public static isDeviceRooted()Z
.locals 2
const/4 v0, 0x1
invoke-static {}, Lcom/comscore/utils/RootDetector;->a()Z
move-result v1
if-eqz v1, :cond_1
:cond_0
:goto_0
return v0
:cond_1
invoke-static {}, Lcom/comscore/utils/RootDetector;->b()Z
move-result v1
if-nez v1, :cond_0
const/4 v0, 0x0
goto :goto_0
.end method
just change this line:
const-string v1, "/system/app/Superuser.apk"
to this:
const-string v1, "/system/app/GTFOSTUPIDASS.apk"
saulin78 said:
Hey guys,
I have modded 2-3 Android Apps for Root check and I was able to use them without problem on my rooted device. However this app is giving me a lot of issues. I believe I have found the 2 smali files that have the root check. Does anyone know what needs to be modded or how it needs to be modded on these 2 smali files to bypass the root detection or to make the app believe the device is not rooted?
.end method
[/CODE]
Click to expand...
Click to collapse
I'm in the same boat. Narrowed it down to those two files. I've tried several methods but this app keeps detecting root. I'm still trying so I'll let you know if I have any success, did you ever find a solution?