[PORT]Kitkat Easter Egg for 4.x - Android Apps and Games

Hi guys!
You all may have come across the latest version of Android "Kitkat"..
There are so many things a developer would like to port from it to earlier versions of Android! And here I am, after porting the Kitkat Easter Egg(or PlatLogo) to ICS+ devices.. For those who haven't heard of this before, it is the animation that appears when tapped multiple times on "Android Version" in "About Phone" menu of Settings! It is different for different versions of Android
If you want to Integrate it into your About Phone Menu, check this post by enricocid
Check this Video out on getting a brief Idea about it (Thanks to Android Central):
Downloads:
Kitkat Easter Egg
Click to expand...
Click to collapse
Source Code:
Github
Click to expand...
Click to collapse

Yeah! 1st one...
BTW:
Just Amazing Gonna Try and report ASAP!

It's Works on 4.2
Inviato dal mio VOW V5 utilizzando Tapatalk

great job :good: tested on 4.2.1 and it works
thanks adhi..

Can u make this for gingerbread..?

Apparently it is not working on my 4.3 slimbean gnex.
Sent from my Galaxy Nexus using Tapatalk 2

@Adhi1419 first of all..thank you..I just love your work man its working..any idea to implement this directly to settings>about phone>android version instead of apps? I'm sure many people will love this..thnks again

how am i suppose to install it?

a4apple said:
how am i suppose to install it?
Click to expand...
Click to collapse
install like a normal apk?

zamzameir said:
install like a normal apk?
Click to expand...
Click to collapse
thanks!

Hey dev,can you update this to the latest 4.4.2 animation?greatly appreciated

Wtf... I did it a full month ahead and for no recognition... http://forum.xda-developers.com/showthread.php?t=2511147
Taptalked u see ... əəs n pəʞlɐʇdɐʇ

I found a way to integrate this directly in settings info... but i forked your repo because i wanna try to build for all android versions and to build a system app

How I integrate in Settings info (replacing the stock 4.3 easter egg):
1) Decompile Settings.apk
2) Open C:\apktool\Settings\smali\com\android\settings\DeviceInfoSettings.smali
3) Search for "Plat"
Delete red code
Code:
.line 167
new-instance v0, Landroid/content/Intent;
const-string v1, "android.intent.action.MAIN"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
[COLOR="Red"] .line 168
const-string v1, "android"
const-class v2, Lcom/android/internal/app/PlatLogoActivity;
invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v2
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;[/COLOR]
.line 171
:try_start_0
invoke-virtual {p0, v0}, Lcom/android/settings/DeviceInfoSettings;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
and replace with blue code:
Code:
.line 167
new-instance v0, Landroid/content/Intent;
const-string v1, "android.intent.action.MAIN"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
[COLOR="Blue"] .line 168
new-instance v1, Landroid/content/Intent;
const-string v2, "android.intent.action.MAIN"
invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 169
.local v1, intent:Landroid/content/Intent;
new-instance v2, Landroid/content/ComponentName;
const-string v3, "com.adhi.kitkat.easteregg"
const-string v4, "com.adhi.kitkat.easteregg.PlatLogoActivity"
invoke-direct {v2, v3, v4}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V
invoke-virtual {v1, v2}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;[/COLOR]
.line 171
:try_start_0
invoke-virtual {p0, v0}, Lcom/android/settings/DeviceInfoSettings;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
4) Recompile back
5) Install this EasterEgg app (modded to remove the launcher) as user app (install as a normal apk) and You're done!
View attachment Kitkat-EasterEgg.apk
@jetx2x I added the Easter Egg this way... Just replacing the platlogo activity with the app one...
but ..just a question .. can I leave line .167 and delete the 169? like this:
Code:
.line 167
new-instance v0, Landroid/content/Intent;
const-string v1, "android.intent.action.MAIN"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
[COLOR="Blue"] .line 168
.local v1, intent:Landroid/content/Intent;
new-instance v1, Landroid/content/ComponentName;
const-string v2, "com.adhi.kitkat.easteregg"
const-string v3, "com.adhi.kitkat.easteregg.PlatLogoActivity"
invoke-direct {v1, v2, v3}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V
invoke-virtual {v0, v1}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;[/COLOR]
.line 171
:try_start_0
invoke-virtual {p0, v0}, Lcom/android/settings/DeviceInfoSettings;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

enricocid said:
How I integrate in Settings info (replacing the stock 4.3 easter egg):
1) Decompile Settings.apk
2) Open C:\apktool\Settings\smali\com\android\settings\DeviceInfoSettings.smali
3) Search for "Plat"
Delete red code
Code:
.line 167
new-instance v0, Landroid/content/Intent;
const-string v1, "android.intent.action.MAIN"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
[COLOR="Red"] .line 168
const-string v1, "android"
const-class v2, Lcom/android/internal/app/PlatLogoActivity;
invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;
move-result-object v2
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;[/COLOR]
.line 171
:try_start_0
invoke-virtual {p0, v0}, Lcom/android/settings/DeviceInfoSettings;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
and replace with blue code:
Code:
.line 167
new-instance v0, Landroid/content/Intent;
const-string v1, "android.intent.action.MAIN"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
[COLOR="Blue"] .line 168
new-instance v1, Landroid/content/Intent;
const-string v2, "android.intent.action.MAIN"
invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 169
.local v1, intent:Landroid/content/Intent;
new-instance v2, Landroid/content/ComponentName;
const-string v3, "com.adhi.kitkat.easteregg"
const-string v4, "com.adhi.kitkat.easteregg.PlatLogoActivity"
invoke-direct {v2, v3, v4}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V
invoke-virtual {v1, v2}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;[/COLOR]
.line 171
:try_start_0
invoke-virtual {p0, v0}, Lcom/android/settings/DeviceInfoSettings;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
4) Recompile back
5) Install this EasterEgg app (modded to remove the launcher) as user app (install as a normal apk) and You're done!
View attachment 2450908
@jetx2x I added the Easter Egg this way... Just replacing the platlogo activity with the app one...
but ..just a question .. can I leave line .167 and delete the 169? like this:
Code:
.line 167
new-instance v0, Landroid/content/Intent;
const-string v1, "android.intent.action.MAIN"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
[COLOR="Blue"] .line 168
.local v1, intent:Landroid/content/Intent;
new-instance v1, Landroid/content/ComponentName;
const-string v2, "com.adhi.kitkat.easteregg"
const-string v3, "com.adhi.kitkat.easteregg.PlatLogoActivity"
invoke-direct {v1, v2, v3}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V
invoke-virtual {v0, v1}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;[/COLOR]
.line 171
:try_start_0
invoke-virtual {p0, v0}, Lcom/android/settings/DeviceInfoSettings;->startActivity(Landroid/content/Intent;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
Click to expand...
Click to collapse
This is exactly what I did for my friend... I made both a jellybean and kitkat easter egg app... His ROM is using my jellybean one
Taptalked u see ... əəs n pəʞlɐʇdɐʇ

What is the sense of this? You're happier if seen a Kitkat thing in your nonkitkat rom? :facepalm:
haha just kidding..

Welcome. What can I do to easter egg from 4.4 to put in android 4.1.2?
"settings >> info ... system ver." ?
I use Xperia J with CyanogenMod 10.

I have error
Hi did all under the instruction, but when you click on the item "About phone" crash bug, if that here are my file View attachment DeviceInfoSettings.rar, what is the my error?
Android 4.2.1

userlight245 said:
Hi did all under the instruction, but when you click on the item "About phone" crash bug, if that here are my file View attachment 2494074, what is the my error?
Android 4.2.1
Click to expand...
Click to collapse
.line 169
.local v1, "intent":Landroid/content/Intent;
new-instance v2, Landroid/content/ComponentName;
Remove the brackets and try again
.line 169
.local v1, intent:Landroid/content/Intent;
new-instance v2, Landroid/content/ComponentName;
const-string v3, "com.adhi.kitkat.easteregg"
---------- Post added at 08:12 PM ---------- Previous post was at 08:11 PM ----------
XperiaJuser said:
Welcome. What can I do to easter egg from 4.4 to put in android 4.1.2?
"settings >> info ... system ver." ?
I use Xperia J with CyanogenMod 10.
Click to expand...
Click to collapse
can You post \Dev iceInfoSettings.smali ? I will add the mod and then You'll recompile yourself... sorry, i can't use other frameworks

enricocid said:
.line 169
.local v1, "intent":Landroid/content/Intent;
new-instance v2, Landroid/content/ComponentName;
Remove the brackets and try again
Click to expand...
Click to collapse
But now the error when assembling
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

Related

[GUIDE][ICS][Easiest][How TO]Add 3-Way Boot to your Power Menu|Easiest Guide

Hello guys im here to share my knowledge since alot off member ask for this mod i mean how to added this option to ur rom
First of all i would like to thanks Jimmy Lam for his framework and android.policy.jar from which i learnt by comparing
Requirements
Attached File
Notepad++
Backsmali Manager
Apktool
Patience
Brain Off cource
Click to expand...
Click to collapse
Ok i have divided this Guide in Two Parts to make it easy
In First Part we will edit framework and in second part we will edit android policy.jar
Part-1
Decompile Your framework-res.apk and move to
Code:
framework-res\res\values
Open Strings.xml with notepad++ or any other tool you use
paste the following lines in the end
Code:
<string name="global_action_reboot_now">Restart</string>
<string name="global_action_reboot_recovery">Recovery</string>
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Close it and recompile.
Then again decompile and move to
Code:
framework-res\res\values
and note the following ids (you may have different)
Here we end our First Part.
Part-2
Decompile your android.policy.jar using backsmali managaer or any other tool
vDownload and extract the attached file to
Code:
android.policy\com\android\internal\policy\impl
Then open GlobalActions.smali
And do how i say
Before
Code:
.line 165
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x104013c
invoke-direct {v1, p0, v12, v2}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 185
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
After
Just Add the Bold ( For A7/A5 Users just copy paste )
Code:
.line 165
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x104013a
invoke-direct {v1, p0, v12, v2}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[B].line 183
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$8;
const v2, [COLOR="Red"]0x104054d[/COLOR]
invoke-direct {v1, p0, v12, v2}, 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
.line 184
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$9;
const v2, [COLOR="Red"]0x104054e[/COLOR]
invoke-direct {v1, p0, v12, v2}, Lcom/android/internal/policy/impl/GlobalActions$9;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/B]
.line 185
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
Note: Note Ids must be same as you noted in part 1
Code:
[COLOR="Red"]Only Replace last 7 digits of IDS when renaming in the above step [/COLOR]
Recompile and replace the classes.dex using Z-zip
Yipeee You Now have 3 Way boot:victory:
This Guide is tested by me and is working Fine
I have uploaded the Modded files for A5/A7/A7+ users so they can download and enjoy
Device Tested for this MOD
Karbonn A5
Karbonn A7
Karbonn A7+
Spice Mi355
Walton Primo
......Report yours if it works for you
Click to expand...
Click to collapse
Screenshot
Hit thanks to show your appreciation, it encourages me
reserved
one more reserved just in case
Tried this on a110 didnt get success.
Will try again and let u know.
Its not for touchwiz ROMs right
but how to change the icons of the restart and recovery option?
ahmed.zunaid said:
but how to change the icons of the restart and recovery option?
Click to expand...
Click to collapse
Thats a drawback of this MOD that it uses the icon of power off only
ahmed.zunaid said:
but how to change the icons of the restart and recovery option?
Click to expand...
Click to collapse
Inside framework res APK......Res folder....Hdpi folder....add two PNG and rename them to above names....
Sent from my Micromax A116 using Tapatalk 2
Dark4Droid said:
Inside framework res APK......Res folder....Hdpi folder....add two PNG and rename them to above names....
Sent from my Micromax A116 using Tapatalk 2
Click to expand...
Click to collapse
No need as the MOD uses the png of power off only
Is it only for ICS??
Sent from my Karbonn A9..
Ok.. This guide sparked my interest in getting this to work again - thank you.
So, it is working.. kind of.. But I broke the "Power off" option somehow.
This is what I did (only want Reboot, so I removed the Recovery option lines):
Added the strings and drawables to framework-res.. compiled, decompiled.. got my new public ids.
Added GlobalActions$9.smali to android.policy, and edited my GlobalActions.smali:
Original:
Code:
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x1040142
invoke-direct {v1, v10, 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
iget-boolean v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->isDeepSleepSupported:Z
if-eqz v0, :cond_51
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$3;
const v2, 0x108060d
const v3, 0x1040567
const v4, 0x1040568
invoke-direct {v1, v10, v2, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
Modded:
Code:
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x1040142
invoke-direct {v1, v10, 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
[B]iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$9;
const v2, 0x108064b
const v3, 0x10406aa
invoke-direct {v1, v10, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$9;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/B]
iget-boolean v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->isDeepSleepSupported:Z
if-eqz v0, :cond_51
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$3;
const v2, 0x108060d
const v3, 0x1040567
const v4, 0x1040568
invoke-direct {v1, v10, v2, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
So, Reboot works with a new icon.. but it gives me the "Power off" prompts when I hit reboot (but reboots normally). And, the Power off option now gives no prompts and reboots the phone..
Any ideas for a simple fix?
EDIT: Got it working a little better now..
I cross-referenced this thread, and edited my ShutdownThread.smali, copied my existing GlobalActions$2.smali (the one with the Shutdown stuff in it), renamed it to GlobalActions$9 and added that "reboot" bit to it as suggested in the other guide.
Bro not working in jellybean will try and post if working in ICS later(now on jb )
Sent from my Micromax A120 Quadcore HD using xda premium
alteredlikeness said:
Ok.. This guide sparked my interest in getting this to work again - thank you.
So, it is working.. kind of.. But I broke the "Power off" option somehow.
This is what I did (only want Reboot, so I removed the Recovery option lines):
Added the strings and drawables to framework-res.. compiled, decompiled.. got my new public ids.
Added GlobalActions$9.smali to android.policy, and edited my GlobalActions.smali:
Original:
Code:
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x1040142
invoke-direct {v1, v10, 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
iget-boolean v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->isDeepSleepSupported:Z
if-eqz v0, :cond_51
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$3;
const v2, 0x108060d
const v3, 0x1040567
const v4, 0x1040568
invoke-direct {v1, v10, v2, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
Modded:
Code:
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x1040142
invoke-direct {v1, v10, 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
[B]iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$9;
const v2, 0x108064b
const v3, 0x10406aa
invoke-direct {v1, v10, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$9;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z[/B]
iget-boolean v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->isDeepSleepSupported:Z
if-eqz v0, :cond_51
iget-object v0, v10, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$3;
const v2, 0x108060d
const v3, 0x1040567
const v4, 0x1040568
invoke-direct {v1, v10, v2, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;III)V
So, Reboot works with a new icon.. but it gives me the "Power off" prompts when I hit reboot (but reboots normally). And, the Power off option now gives no prompts and reboots the phone..
Any ideas for a simple fix?
EDIT: Got it working a little better now..
I cross-referenced this thread, and edited my ShutdownThread.smali, copied my existing GlobalActions$2.smali (the one with the Shutdown stuff in it), renamed it to GlobalActions$9 and added that "reboot" bit to it as suggested in the other guide.
Click to expand...
Click to collapse
Yeah actually this MOD uses every resource of Power Off but functions differently like Recovery will also show you power off prompt but will take you to recovery
Coudnt get it working on a110.
If u want to take a look up android.policy.jar tell me
.salil. said:
Coudnt get it working on a110.
If u want to take a look up android.policy.jar tell me
Click to expand...
Click to collapse
i am going to start developing on A110 as my friend has it and he wants a ROM from me so rather making only for him i will release it here also :angel: and i will try if it works on A110
karbonn A18
Hello guneet,
i am closely watching your every step towards success with a5.
can i ask you a favour?
i need this mod for karbonn a18 which runs on stock android 4.0.4
Pritesh.mohan said:
Hello guneet,
i am closely watching your every step towards success with a5.
can i ask you a favour?
i need this mod for karbonn a18 which runs on stock android 4.0.4
Click to expand...
Click to collapse
You can try it out with A18 and report in the thread
I don't find any credits.
is this your own work without reference?
shahulakthar said:
I don't find any credits.
is this your own work without reference?
Click to expand...
Click to collapse
Yeah this is my Own work and i have given thanks aka credits to the person which deserves that
The Droid Master said:
Yeah this is my Own work and i have given thanks aka credits to the person which deserves that
Click to expand...
Click to collapse
I missed 2nd line of ur post. Is there any success with a110? Any method to add them in JB?
shahulakthar said:
I missed 2nd line of ur post. Is there any success with a110? Any method to add them in JB?
Click to expand...
Click to collapse
Hmm bro i have not started my work for A110 as my friend(who has that device) is out of station so i will have to wait for him till then we(my team) is working on our Smart apps

[Guide] Remove Mobile Data Toggle off Warning Dialogue

Hell xda-er,,
It is me again :silly:
I took my shovel and start digging where could I disable this annoying dialogue when I toggle off mobile data connection from quick toggle panel... see the pictures
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Now I can toggle off mobile data connection from quick toggle panel without seeing that dialogue anymore
Needed tools:
1) Baksmali tool from here.
2) Notepad++ from here.
The procedure:
- Baksmali SystemUI.apk.
- Go to classout/com/android/systemui/statusbar/policy/quicksetting folder and open MobileDataQuickSettingButton.smali
- Search for this method ".method private setMobileData(Z)V" and then go to its end and add this (goto) blue line:
Code:
.method private setMobileData(Z)V
.registers 6
.param p1, "on" # Z
.prologue
.line 248
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "quickpanel_mobiledata_checked"
const/4 v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
.line 250
.local v0, "mChecked":I
const-string v1, "STATUSBAR-MobileDataQuickSettingButton"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "Mobile data waring checked : "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static {v1, v2}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 252
[B][COLOR="Blue"]goto :cond_2d[/COLOR][/B]
if-nez p1, :cond_2d
if-nez v0, :cond_2d
.line 253
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataOffAlert()V
.line 257
:goto_2c
return-void
.line 255
[B][COLOR="Red"]:cond_2d[/COLOR][/B] [B][COLOR="Green"]<!-- Make sure the new blue goto command above has the same cond value as this one[/COLOR][/B]
invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V
goto :goto_2c
.end method
- Make sure of the blue :cond value in the new goto command to be the same as the red :cond value in the code. Here, the red value is :cond_2d so the blue will be :cond_2d as well.
Explanation:
By adding this goto command, we are telling the code to jump over the invoke alert dialogue command to the mobile data boolean directly then jump to void.
Click to expand...
Click to collapse
- Save changes.. smali (recompile).. push to phone.. fix permissions (644) and reboot.
Cheers
Thanks buddy! :good:
Your Guides are useful as always! Thanks for your digging!
Winterlove said:
Thanks buddy! :good:
Your Guides are useful as always! Thanks for your digging!
Click to expand...
Click to collapse
Thank you mate,,
Next time I will dig for gold
Let us know if u find some gold..
Sent from my GT-N7000 using xda premium
@majdinj
Why don't you make a ROM with all of your mods combined ?
M3TALLICA said:
@majdinj
Why don't you make a ROM with all of your mods combined ?
Click to expand...
Click to collapse
Even if was thinking same thing after seeing of your many new guides n mods.
It's time for Glory LTA
Sent from my GT-N7000 using xda premium
M3TALLICA said:
@majdinj
Why don't you make a ROM with all of your mods combined ?
Click to expand...
Click to collapse
That would be awesome!
M3TALLICA said:
@majdinj
Why don't you make a ROM with all of your mods combined ?
Click to expand...
Click to collapse
mjrifath said:
Even if was thinking same thing after seeing of your many new guides n mods.
It's time for Glory LTA
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
kmokhtar79 said:
That would be awesome!
Click to expand...
Click to collapse
Thanks guys for your warm feeling towards me,,, A lot of excellent ROMs are here in our forum, so I think you can stick to one of them since I myself like to discover more about source and resource coding, so I can give a good support to other ROMs.
majdinj said:
Thanks guys for your warm feeling towards me,,, A lot of excellent ROMs are here in our forum, so I think you can stick to one of them since I myself like to discover more about source and resource coding, so I can give a good support to other ROMs.
Click to expand...
Click to collapse
Agreed.. there is many plenty of TW base awesome roms available here. But it's hard to find a rom with complete mods. Example.. extended power menu, torch mod in lock screen, aosp lockscreen... maybe this is not required mods. But people need more customization with latest updates
Sent from my GT-N7000 using xda premium
I would like also to see a Rom with all your mods in. So in case you have enough time I would like to ask you to make one as many of the ROMS in the Android Development menu are out of date
Thank you for your mods.
mjrifath said:
Agreed.. there is many plenty of TW base awesome roms available here. But it's hard to find a rom with complete mods. Example.. extended power menu, torch mod in lock screen, aosp lockscreen... maybe this is not required mods. But people need more customization with latest updates
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
add spell checker and volume rocker to skip tracks.
what about i9305
I've tried this on i9305. It seem like I did all steps but no effect. Any idea? My corrected smalied and baksmalied again looks like this:
Code:
.method private setMobileData(Z)V
.locals 5
.param p1, "on" # Z
.prologue
.line 349
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "quickpanel_mobiledata_checked"
const/4 v3, 0x0
const/4 v4, -0x2
invoke-static {v1, v2, v3, v4}, Landroid/provider/Settings$Secure;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
.line 351
.local v0, "mChecked":I
const-string v1, "STATUSBAR-MobileDataQuickSettingButton"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "Mobile data waring checked : "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static {v1, v2}, Landroid/util/secutil/Log;->secD(Ljava/lang/String;Ljava/lang/String;)I
.line 353
goto :goto_39
if-nez p1, :cond_2f
if-nez v0, :cond_2f
.line 354
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataOffAlert()V
.line 363
:goto_2e
return-void
.line 356
:cond_2f
if-eqz p1, :cond_39
sget-boolean v1, Lcom/android/systemui/statusbar/Feature;->mUseDataOnConfirmPopup:Z
if-eqz v1, :cond_39
.line 357
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onORGDisplayMobileDataOnAlert()V
goto :goto_2e
.line 360
:cond_39
:goto_39
invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V
goto :goto_2e
.end method
does not work with dn4 mod 10
Fix is to make this change:
goto :cond_0 ====> this shud jump to line of setMobileDataEnabled
.line 375
if-nez p1, :cond_0
.line 376
if-nez v0, :cond_0
.line 377
invoke-direct {p0, v4}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataAlert(I)V
.line 384
:goto_0
return-void
.line 379
:cond_0
invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V
goto :goto_0
.line 381
:cond_1
const/4 v1, 0x1
invoke-direct {p0, v1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataAlert(I)V
goto :goto_0
.end method
Hi, I have a problem. I did all steps, changed everything like shown and smali into .apk
When I changed my oryginal systemUI.apk with new one it says that sysyemUI has stopped.
Can you tell me what could went wrong ? Maby my backsmali compiled apk with errors ? Any ideas, help how to fix that ?

[MOD][Guide] Power Menu Safe Mode Reboot Addon (Toggles guide added - 15/10/2013)

<< Power Menu Safe Mode Reboot Addon >>
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Hi xda mates,,
Have anyone of you heard about the android safe mode and for what it is used?
Well the safe mode does exist in android device to help you to uninstall any third party application that causes lag or trouble in your android OS or even boot loop that prevents you from uninstalling that app which causes the problem by the normal way.. This should be your first attempt to fix your phone before doing a full wipe..!!
To get into Safe Mode, you need to power off your phone then turn it on and then hold volume up and down until it boots completely,, You will find a little black babble in the left lower side of the phone that indicates that you are in safe mode.
To boot into safe mode using adb shell, you can try these commands:
Code:
setprop persist.sys.safemode 1
reboot
The following video will show how is the buttons combination done..
OK, I know the buttons combination could be like a pain in a$$, and because most of manufactures had disabled the long press way to boot into safe mode (thanks Samsung..!!!), so I thought of integrating it into power menu as in above screenshots using the shell commands as a source of my smali codes.. So here we go :laugh:
The Guide:
Needed Tools:
1) APK Tool. You can use APK Multi-Tool from here.
2) Baksmali Tool. You can use my manager from here.
3) Notepad++ for editing xml and smali from here.
4) And of course little amount of patience..!!!
The procedure:
The procedure will not be different from the usual integrating addons into power menu..!!
First of all, download the resources [View attachment PM_SafeMode_Resources.rar].
1) framework-res.apk
- Decompile framework-res.apk
- Go to res\drawable-xhdpi folder and put the image resources there [tw_ic_lock_safemode.png]
- Go to res\values folder and open strings.xml file and add the following line at the end before </resources> and save:
Code:
<string name="global_action_safemode_txt">Reboot to safe mode</string>
- Now Recompile your framework-res.apk to create new ids.. Now DECOMPILE the NEW framework-res.apk and go to res\values and open public.xml file and locate these 2 ids:
Code:
<public type="drawable" name="tw_ic_lock_safemode" id="0x01080a98" />
<public type="string" name="global_action_safemode_txt" id="0x01040785" />
N.B: You might have different id numbers, but don't wary, the principle will be the same..!!
Click to expand...
Click to collapse
Keep the public.xml file opened for the moment and let's go to the next step.
2) android.policy.jar
- Baksmali android.policy.jar
- Go to classout\com\android\internal\policy\impl folder and paste the smali resource there [GlobalActions$SafeMode.smali]
- Now in the same folder find GlobalActions.smali and open it.
- In GlobalActions.smali, find the instance fields section and go to its end and add the following blue line just after ".field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;":
Code:
.field private mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[B][COLOR="Blue"].field private mSafeMode:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR][/B]
.field private mRingerModeReceiver:Landroid/content/BroadcastReceiver;
- Now, Search for "[Lcom/android/internal/policy/impl/GlobalActions$Action;" for power menu arrays and increase the number of arrays (the line above it) to accommodate the total number of new arrays:
Code:
.line 418
const/4 v1, 0x[B][COLOR="Red"]5[/COLOR][/B] [B][COLOR="Green"]<!--- You need to increase the arrays number here[/COLOR][/B]
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
so it will be:
Code:
.line 418
const/4 v1, 0x[B][COLOR="Blue"]6[/COLOR][/B]
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
- Now, above the newly modified "const/4 v1, 0x6" add these action lines:
Code:
new-instance [B][COLOR="Red"]v1[/COLOR][/B], Lcom/android/internal/policy/impl/GlobalActions$99;
const [B][COLOR="Red"]v2[/COLOR][/B], 0x10808ad
const [B][COLOR="Red"]v3[/COLOR][/B], 0x1040193
move-object/from16 [B][COLOR="Red"]v0, p0[/COLOR][/B]
invoke-direct {[B][COLOR="Red"]v1, v0, v2, v3[/COLOR][/B]}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 [B][COLOR="Red"]v0, p0[/COLOR][/B]
iput-object [B][COLOR="Red"]v1, v0[/COLOR][/B], Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
[B][COLOR="Blue"]new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$SafeMode;
const v2, [COLOR="SeaGreen"]0x1080a98[/COLOR]
const v3, [COLOR="SeaGreen"]0x1040785[/COLOR]
move-object/from16 v0, p0
invoke-direct {v1, v0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$SafeMode;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v1, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSafeMode:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;[/COLOR][/B]
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/GlobalActions;->onAirplaneModeChanged()V
.line 418
const/4 v1, 0x6
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
Here, the ids above are obtained from public.xml file from framework-res.apk. The first id will represent the image resource and the second id will represent the string resource (don't forget to omit the first 0).
Also pay attention to variables and parameters, it should be matched (the red v and p)
- Now we will add new array to show in power menu. So bellow modified "const/4 v1, 0x6" add new arrays to show after the last array:
Code:
.line 418
const/4 v1, 0x6
new-array v1, v1, [Lcom/android/internal/policy/impl/GlobalActions$Action;
...
...
const/4 [B][COLOR="Red"]v2[/COLOR][/B], 0x4
move-object/from16 [B][COLOR="Red"]v0, p0[/COLOR][/B]
iget-object [B][COLOR="Red"]v3, v0[/COLOR][/B], Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object [B][COLOR="Red"]v3, v1, v2[/COLOR][/B]
[B][COLOR="Blue"]const/4 v2, 0x5
move-object/from16 v0, p0
iget-object v3, v0, Lcom/android/internal/policy/impl/GlobalActions;->mSafeMode:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
aput-object v3, v1, v2[/COLOR][/B]
Again, you should match all variables and parameters (v and p values)
- Save changes.. smali (recompile)
Now push the finished framework-res.apk and android.policy.jar to framework folder in your device, fix permissions to 644 and reboot and viola you made it,,,
Pre-made mod:
You don't have technical skills to do all these complicated things..!! Here you can download the mod and flash it in your GT-N7000 device..
The mod is based on LT9 firmware and I suppose it will work on any LTx firmware increment number.
I have included:
- PM ScreenShot mod
- PM Safe mode reboot mod
- PM Fixed Hot reboot mod
- Volume rocker mod
All in one flashable file,, so what you are waiting for,, backup your phone and give it a try
Download
(md5 sum: 8f764c74e8ec63fc6072015668811fac)
Any ROM's developer can include this mod in his/her ROM without asking for permission, although small credit in the OP will be nice.. :good:
N.B: For toggle on and off of Power Menu addons, see post #3
Cheers,,
This is great
Adding Setting Toggle For Power Menu Addons
<< Adding Setting Toggle For Power Menu Addons >>​​
Let's increase the heat little bit..!! Do you want to add toggle to switch on and off the extra power menu addons like these pictures bellow:
OK let's start this extra step tutorial.. :victory:
I will assume you already add Safe Mode and Screenshot extra power menu addons..
1) android.policy.jar:
- Baksmali android.policy.jar
- Go to classout\com\android\internal\policy\impl folder
- Now, the truth is I didn't invent any new codes here, I traced one toggle-able power menu addon which is "accessibility", the tracing will take you into GlobalActions$3.smali, I opened it and I found this code in ".method public showConditional()Z"
Code:
.method public showConditional()Z
.registers 5
const/4 v0, 0x1
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/[B][COLOR="Red"]GlobalActions$3[/COLOR][/B];->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-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "[B][COLOR="Red"]power_key_hold[/COLOR][/B]"
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-ne v2, v0, :cond_15
:goto_14
return v0
:cond_15
move v0, v1
goto :goto_14
.end method
- So what you need to do is to open GlobalActions$SafeMode.smali and GlobalActions$ScreenCap.smali and change the method ".method public showConditional()Z" to the previous method mentioned above.
Note:
Don't forget to change GlobalActions$3 to the name of smali you are using (i.e, GlobalActions$SafeMode.smali or GlobalActions$ScreenCap.smali).
You need to put new key for referral in your modified smali instead of "power_key_hold"
Click to expand...
Click to collapse
So by the end, GlobalActions$SafeMode.smali method will be:
Code:
.method public showConditional()Z
.registers 5
const/4 v0, 0x1
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/[B][COLOR="Blue"]GlobalActions$SafeMode[/COLOR][/B];->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-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, [B][COLOR="Blue"]"pm_safe_mode"[/COLOR][/B]
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-ne v2, v0, :cond_15
:goto_14
return v0
:cond_15
move v0, v1
goto :goto_14
.end method
.method public showDuringKeyguard()Z
.registers 2
.prologue
.line 389
const/4 v0, 0x1
return v0
.end method
And GlobalActions$ScreenCap.smali method will be:
Code:
.method public showConditional()Z
.registers 5
const/4 v0, 0x1
const/4 v1, 0x0
iget-object v2, p0, Lcom/android/internal/policy/impl/[B][COLOR="Blue"]GlobalActions$ScreenCap[/COLOR][/B];->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-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, [B][COLOR="Blue"]"pm_screenshot"[/COLOR][/B]
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-ne v2, v0, :cond_15
:goto_14
return v0
:cond_15
move v0, v1
goto :goto_14
.end method
- Save changes .. and that's for android.policy.jar
2) SecSettings.apk:
- Decompile SecSettings.apk
- Go to res\values folder and open strings.xml file and add these new resources at the end before </resources>:
Code:
<string name="PM_Glory_addons">GloryROM Power Menu Addons</string>
<string name="pm_safe_mode_title">Safe Mode Reboot</string>
<string name="pm_screenshot_title">Take Screenshot</string>
<string name="pm_on">Toggle is Enabled</string>
<string name="pm_off">Toggle is Disabled</string>
- Go to res\xml and open display_settings.xml and add these lines on the place you your addon to appear later on on the device:
Code:
<PreferenceCategory android:title="@string/PM_Glory_addons" android:key="PM_Glory_settings" />
<CheckBoxPreference android:title="@string/pm_safe_mode_title" android:key="pm_safe_mode" android:defaultValue="true" android:summaryOn="@string/pm_on" android:summaryOff="@string/pm_off" />
<CheckBoxPreference android:title="@string/pm_screenshot_title" android:key="pm_screenshot" android:defaultValue="true" android:summaryOn="@string/pm_on" android:summaryOff="@string/pm_off" />
- Now for the smali source, go to classout\com\android\settings folder and open DisplaySettings.smali.. Also here, I didn't invent new codes, I used mult-windows toggle codes as reference..!! I will use Blue color for Safe Mode toggle codes and Green color for Screenshot toggle codes. Add these lines to [# instance fields] section:
Code:
[B][COLOR="Blue"].field private mSafeModePref:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Green"].field private mScreenShotPref:Landroid/preference/CheckBoxPreference;[/COLOR][/B]
- Search for ""key_multi_window"" and add these lines:
Code:
.line 570
const-string v11, "key_multi_window"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
[B][COLOR="Blue"]const-string v11, "pm_safe_mode"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Green"]const-string v11, "pm_screenshot"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;[/COLOR][/B]
- Now search for the method ".method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z" and search for ""multi_window_enabled"" to locate this part at the end:
Code:
.line 1021
:cond_15c
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [B][COLOR="Red"]:cond_1c[/COLOR][/B]
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
if-eqz v0, :cond_177
:goto_172
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1c
:cond_177
move v1, v2
goto :goto_172
.end method
Add new codes before [.end method] in the previous section, so that section will be like this:
Code:
.line 1021
:cond_15c
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [B][COLOR="Blue"]:cond_SafeM[/COLOR][/B]
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
if-eqz v0, :cond_177
:goto_172
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1c
:cond_177
move v1, v2
goto :goto_172
[B][COLOR="Blue"]:cond_SafeM
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_ScSh
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "pm_safe_mode"
if-eqz v0, :cond_majdiSafe
:goto_njsafe
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1c
:cond_majdiSafe
move v1, v2
goto :goto_njsafe[/COLOR]
[B][COLOR="Green"]:cond_ScSh
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [COLOR="Red"]:cond_1c[/COLOR]
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "pm_screenshot"
if-eqz v0, :cond_majdiSS
:goto_njSS
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1c
:cond_majdiSS
move v1, v2
goto :goto_njSS[/COLOR][/B][/B]
.end method
- Pay attention to the red color condition..!!!
- Now go to the next method ".method public onResume()V" and search for ""multi_window_enabled"" and locate this part:
Code:
:cond_9d
sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z
if-eqz v0, [B][COLOR="Red"]:cond_c1[/COLOR][/B]
.line 847
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-ne v3, v1, :cond_de
:goto_af
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 848
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "multi_window_enabled"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;
invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
line 850
:cond_c1
return-void
:cond_c2
move v0, v2
And do this modification:
Code:
:cond_9d
sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z
if-eqz v0, [B][COLOR="Blue"]:cond_Safemajdi[/COLOR][/B]
.line 847
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-ne v3, v1, :cond_de
:goto_af
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 848
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "multi_window_enabled"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;
invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
[B][COLOR="Blue"].line 1000
:cond_Safemajdi
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
if-eqz v0, :cond_NewScSh
.line 1001
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mSafeModePref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "pm_safe_mode"
const/4 v1, 0x0
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-eqz v3, :cond_noSafe
const/4 v1, 0x1
goto :goto_yesSafe
:cond_noSafe
const/4 v1, 0x0
:goto_yesSafe
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR]
[COLOR="Green"].line 2000
:cond_NewScSh
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
if-eqz v0, [COLOR="Red"]:cond_c1[/COLOR]
.line 2001
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mScreenShotPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "pm_screenshot"
const/4 v1, 0x0
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-eqz v3, :cond_noShot
const/4 v1, 0x1
goto :goto_yesShot
:cond_noShot
const/4 v1, 0x0
:goto_yesShot
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR][/B]
.line 850
:cond_c1
return-void
:cond_c2
move v0, v2
- Also pay attention to the red color condition..!!!
- Save changes.. and that's all
For DisplaySettings.smali, I will attach the smali before and after, so you could use it to understand well
Also, I will attach the modified GlobalActions$SafeMode.smali and GlobalActions$ScreenCap.smali
Have fun,,, :good:
Another great mod from u brother.
Thanks for your efforr
Sent from my GT-N7000 using xda premium
Thank you!!!!!!!! Very very great Mod! Thanks bro!
mjrifath said:
Another great mod from u brother.
Thanks for your efforr
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
BVB-Fan said:
Thank you!!!!!!!! Very very great Mod! Thanks bro!
Click to expand...
Click to collapse
Thanks for testing mates
Now my phone sometimes reboot is that a bug ?
BVB-Fan said:
Now my phone sometimes reboot is that a bug ?
Click to expand...
Click to collapse
It is fine here,,,
could you tell me how it gets reboot? Is it after opening the power menu, or opening any other application, so I can reproduce it if it is a bug to fix it.
Try wiping cache and dalvik cache in the moment..
This comes when I opened an application then my Note freeze for a moment and it restarts. I wiped the Cache but the same problem.
Now I flashed my Rom (LTA) again and the problem is solved :thumbup:
BVB-Fan said:
This comes when I opened an application then my Note freeze for a moment and it restarts. I wiped the Cache but the same problem.
Now I flashed my Rom (LTA) again and the problem is solved :thumbup:
Click to expand...
Click to collapse
I think the mod is working fine isn't it??
Thanks God,, I didn't sleep well since last time,, you just save me bro,, :good:
thank you majdinj great job (as usual). on xxlta works fine
asmanao said:
thank you majdinj great job (as usual). on xxlta works fine
Click to expand...
Click to collapse
Thanks for testing bro
Toggle on and off of Power Menu addons, see post #3
Yeh! Now I feel bad about using up the 2nd post.
majdinj said:
Toggle on and off of Power Menu addons, see post #3
Click to expand...
Click to collapse
Great work thanks for tutorials. Just one idea, is it possible to get other toggles on power menu like wifi?
Sent from my GT-N7000 using Tapatalk 4
nokiamodeln91 said:
Yeh! Now I feel bad about using up the 2nd post.
Click to expand...
Click to collapse
No Problem mate,, It is good like this,, I have no complain about it since I already have post #3,, I hope it is clear guide (I spent the whole day to do it, a lot of bootloop happened but I got it to work at the end..!!!! and finally it is here :laugh
kmokhtar79 said:
Great work thanks for tutorials. Just one idea, is it possible to get other toggles on power menu like wifi?
Sent from my GT-N7000 using Tapatalk 4
Click to expand...
Click to collapse
If you have smali resource then yes,,, The good thing about safe mode smali is, it is made by shell commands and if you look at power off GlobalAction smali, you will see it is done by shell command too,,, So here is the trick that I used to create safe mode smali.
I don't think the wifi is going to be the same,, but we have already the quick toggle for that (on the moment..!!)... I will see if I can locate the wifi onClick / onPress method
Yes Perfect! as always.
Nice Mod!!!
Is it possible to create an icon on the home screen to invoke power menu instead of long press on power button?
Thank You
can it works backwards?
hi i'm actually stuck on safe mode on mi S3 (i know this isn't the right site for my model) but i think that this may be a solution, is anyway posible that we can disable the safe mode from de ROM itself?
EMSpilot said:
Is it possible to create an icon on the home screen to invoke power menu instead of long press on power button?
Thank You
Click to expand...
Click to collapse
There is a way to add the lock button to the status bar or the pull down menu.. Search for it..

[Guide] Add Switch On/Off For Battery, Data Disconnection and Keyboard Notifications

Ok, it seems that I am on toggles now
After this guide, you will be able to switch on or off the full battery notification after the device is being fully charged..
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
So here we go..
We will be working with two files, SystemUI.apk and SecSettings.apk
Setting The Toggle Switch >>>
1) SecSettings.apk
- Decompile SecSettings.apk
- Go to res\values folder and open strings.xml and add these new lines:
Code:
<string name="set_remove_bat">Full Battery Notification</string>
<string name="notif_on">Notification is Enabled</string>
<string name="notif_off">Notification is Disabled</string>
- Go to res\xml folder and open display_settings.xml and add these codes where you want to display the toggle check box:
Code:
<CheckBoxPreference android:title="@string/set_remove_bat" android:key="bat_sbar" android:summaryOn="@string/notif_on" android:summaryOff="@string/notif_off" />
- Now for the smali.. Go to classout\com\android\settings folder and open DisplaySettings.smali.
- Add this line to [# instance fields] section:
Code:
.field private mBatPref:Landroid/preference/CheckBoxPreference;
- On the method ".method public onCreate(Landroid/os/Bundle;)V", search for ""key_multi_window"" and add these lines:
Code:
.line 570
const-string v11, "key_multi_window"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
[B][COLOR="Blue"]const-string v11, "bat_sbar"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;[/COLOR][/B]
- Now in the method ".method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z", search for ""multi_window_enabled"" to locate this part at the end:
Code:
:cond_15c
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [B][COLOR="Red"]:cond_179[/COLOR][/B]
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
if-eqz v0, :cond_177
:goto_172
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 [B][COLOR="Lime"]:goto_1c[/COLOR][/B]
:cond_177
move v1, v2
goto :goto_172
.end method
Add new codes before [.end method] in the previous section. Pay attention to the red color condition and the green color condition..!!!, so that section will be like this:
Code:
:cond_15c
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [B][COLOR="Blue"]:cond_batteryToggle[/COLOR][/B]
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
if-eqz v0, :cond_177
:goto_172
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 [B][COLOR="Lime"]:goto_1c[/COLOR][/B]
:cond_177
move v1, v2
goto :goto_172
[B][COLOR="Blue"]:cond_batteryToggle
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, [COLOR="Red"]:cond_179[/COLOR]
.line 1022
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v0
.line 1023
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "bat_sbar"
if-eqz v0, :cond_majdiB
:goto_njB
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 [B][COLOR="Lime"]:goto_1c[/COLOR][/B]
:cond_majdiB
move v1, v2
goto :goto_njB[/COLOR][/B]
.end method
- Now in the method ".method public onResume()V", search for ""multi_window_enabled"" and locate this part, pay attention to the red color condition..!!!:
Code:
:cond_9d
sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z
if-eqz v0, [B][COLOR="Red"]:cond_c1[/COLOR][/B]
.line 847
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-ne v3, v1, :cond_de
:goto_af
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 848
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "multi_window_enabled"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;
invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
line 850
:cond_c1
return-void
:cond_c2
move v0, v2
And do these modification:
Code:
:cond_9d
sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z
if-eqz v0, [B][COLOR="Blue"]:cond_newBattery[/COLOR][/B]
.line 847
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "multi_window_enabled"
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-ne v3, v1, :cond_de
:goto_af
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 848
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "multi_window_enabled"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;
invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
[B][COLOR="Blue"]:cond_newBattery
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
if-eqz v0, [COLOR="Red"]:cond_c1[/COLOR]
.line 3001
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "bat_sbar"
const/4 v1, 0x0
invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-eqz v3, :cond_noShow
const/4 v1, 0x1
goto :goto_yesShow
:cond_noShow
const/4 v1, 0x0
:goto_yesShow
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR][/B]
line 850
:cond_c1
return-void
:cond_c2
move v0, v2
- Save all changes and compile and push to phone and prof working then continue to next step.
Setting The Referral Switch >>>
2) SystemUI.apk
- Baksmali SystemUI.apk.
- Go to classes/com/android/systemui/power/ folder and open PowerUI.smali.
- Search for this method ".method notifyFullBatteryNotification()V" and add the blue lines and delete or comment out the red line:
Code:
.method notifyFullBatteryNotification()V
.registers 12
.prologue
const/4 v10, 0x0
.line 827
iget-object v7, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
const-string v8, "notification"
invoke-virtual {v7, v8}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/app/NotificationManager;
.line 829
.local v2, "notificationManager":Landroid/app/NotificationManager;
[B][COLOR="Blue"]move-object v0, p0
iget-object v5, v0, Lcom/android/systemui/power/PowerUI;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v6, "bat_sbar"
const/4 v7, 0x1
invoke-static {v5, v6, v7}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
if-nez v5, :cond_15
[COLOR="Red"]#if-nez v2, :cond_15[/COLOR][/COLOR] [COLOR="Green"]<!--- Put the same condition value in the above new condition[/COLOR][/B]
.line 830
const-string v7, "PowerUI"
const-string v8, "notifyFullBatteryNotification : fail to get NotificationManager reference"
invoke-static {v7, v8}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 860
:goto_14
return-void
.line 834
:cond_15
iget-object v7, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
- Save changes and compile and push to phone...
For those who just want to disable full battery notification without having headache of adding toggle switch, please see this thread here,,,
A lot of toggle tutorials could be done easily if you just understand the main principle here.. and for giving more options to users, use TOGGLES,,,
Cheers
More referral switches
<< Here is some switch referral settings for some notifications >>​
★ For keyboard notification ★
- Baksmali services.jar
- Navigate to classout/com/android/server/InputMethodManagerService.smali
- Find ".method public setImeWindowStatus(Landroid/os/IBinder;II)V" and add the blue codes and delete the red line:
Code:
.method public setImeWindowStatus(Landroid/os/IBinder;II)V
.registers 23
.param p1, "token" # Landroid/os/IBinder;
.param p2, "vis" # I
.param p3, "backDisposition" # I
.prologue
.line 1640
invoke-static {}, Landroid/os/Binder;->getCallingUid()I
move-result v11
.line 1641
.local v11, "uid":I
invoke-static {}, Landroid/os/Binder;->clearCallingIdentity()J
move-result-wide v4
.line 1643
.local v4, "ident":J
if-eqz p1, :cond_12
:try_start_a
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/server/InputMethodManagerService;->mCurToken:Landroid/os/IBinder;
move-object/from16 v0, p1
[B][COLOR="Blue"].line 2000
move-object/from16 v0, p0
iget-object v12, v0, Lcom/android/server/InputMethodManagerService;->mContext:Landroid/content/Context;
invoke-virtual {v12}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v12
const-string v13, "ime_sbar"
const/4 v14, 0x1
invoke-static {v12, v13, v14}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
if-nez v12, :cond_3a[/COLOR]
[COLOR="Red"] #if-eq v12, v0, :cond_3a[/COLOR][/B]
.line 1644
:cond_12
const-string v12, "InputMethodManagerService"
new-instance v13, Ljava/lang/StringBuilder;
invoke-direct {v13}, Ljava/lang/StringBuilder;-><init>()V
const-string v14, "Ignoring setImeWindowStatus of uid "
★ For mobile data connection toggle off dialogue ★
- Baksmali SystemUI.apk
- Navigate to classout\com\android\systemui\statusbar\policy\quicksetting\MobileDataQuickSettingButton.smali
- Find ".method private setMobileData(Z)V" and add the blue codes and delete the red line:
Code:
.method private setMobileData(Z)V
.registers 6
.param p1, "on" # Z
.prologue
.line 248
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "quickpanel_mobiledata_checked"
const/4 v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
.line 250
.local v0, "mChecked":I
const-string v1, "STATUSBAR-MobileDataQuickSettingButton"
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "Mobile data waring checked : "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v2
invoke-static {v1, v2}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 252
[B][COLOR="Blue"]move-object v0, p0
iget-object v1, v0, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "quickpanel_mobiledata_dialogue"
const/4 v3, 0x1
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-eqz v1, :cond_2d[/COLOR][/B]
if-nez p1, :cond_2d
[B][COLOR="Red"]#if-nez v0, :cond_2d[/COLOR][/B]
.line 253
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->onDisplayMobileDataOffAlert()V
.line 257
:goto_2c
return-void
.line 255
:cond_2d
invoke-direct {p0, p1}, Lcom/android/systemui/statusbar/policy/quicksetting/MobileDataQuickSettingButton;->setMobileDataEnabled(Z)V
goto :goto_2c
.end method
★ For low battery notification ★
- Baksmali SystemUI.apk.
- Go to classes/com/android/systemui/power/ folder and open PowerUI.smali.
- Search for this method ".method showLowBatteryWarning()V" and add the blue lines:
Code:
.method showLowBatteryWarning()V
.registers 20
.prologue
.line 433
const-string v16, "PowerUI"
new-instance v17, Ljava/lang/StringBuilder;
invoke-direct/range {v17 .. v17}, Ljava/lang/StringBuilder;-><init>()V
move-object/from16 v0, p0
iget-object v15, v0, Lcom/android/systemui/power/PowerUI;->mBatteryLevelTextView:Landroid/widget/TextView;
if-nez v15, :cond_78
const-string v15, "showing"
:goto_f
move-object/from16 v0, v17
invoke-virtual {v0, v15}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v15
const-string v17, " low battery warning: level="
move-object/from16 v0, v17
invoke-virtual {v15, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v15
move-object/from16 v0, p0
[B][COLOR="Blue"]move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/systemui/power/PowerUI;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v6, "bat_low"
const/4 v7, 0x1
invoke-static {v5, v6, v7}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
if-eqz v5, :goto_77[/COLOR] [COLOR="Green"]#<!--- goto_77 will return-void (go down & see..!!)[/COLOR][/B]
iget v0, v0, Lcom/android/systemui/power/PowerUI;->mBatteryLevel:I
move/from16 v17, v0
move/from16 v0, v17
invoke-virtual {v15, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v15
const-string v17, " ["
move-object/from16 v0, v17
invoke-virtual {v15, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v15
move-object/from16 v0, p0
iget v0, v0, Lcom/android/systemui/power/PowerUI;->mBatteryLevel:I
move/from16 v17, v0
move-object/from16 v0, p0
move/from16 v1, v17
invoke-direct {v0, v1}, Lcom/android/systemui/power/PowerUI;->findBatteryLevelBucket(I)I
move-result v17
move/from16 v0, v17
invoke-virtual {v15, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v15
const-string v17, "]"
move-object/from16 v0, v17
invoke-virtual {v15, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v15
invoke-virtual {v15}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v15
move-object/from16 v0, v16
invoke-static {v0, v15}, Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
...
...
...
.line 539
[B][COLOR="Red"]:goto_77[/COLOR] [COLOR="Green"]<!--- You should put this defined goto value in the new if-eqz[/COLOR][/B]
return-void
You will need to add the switch toggle in SecSettings.apk using the same principle in post #1
CRT-OFF Animation Toggle
Here: http://forum.xda-developers.com/showthread.php?t=2194003
Working on Note.
:good:
@kmokhtar79
I'll try them all, so some android.policy.jar can be removed from my Aroma Installer.
@majdinj
How long do you keep your note?
I ask only because of your Pimp my Phone project.
I'm staying for now on Note 1.
- there is no big difference between Note 1 and Note 2 (I mean general use)
- Note 3 isn't good as Phone (it's too big for me as phone, or my fingers are too short)
It's just your opinion.
kmokhtar79 said:
CRT-OFF Animation Toggle
Here: http://forum.xda-developers.com/showthread.php?t=2194003
Working on Note.
Click to expand...
Click to collapse
Excellent,, it has the same principle to add toggle switch in SecSettings.apk.
So it is almost the same for all.. what is left to tackle is only switch referral codes (where to incorporate key code in other jar or apk other than SecSettings.apk) which needs several testings..
tkari4 said:
@majdinj
How long do you keep your note?
I ask only because of your Pimp my Phone project.
I'm staying for now on Note 1.
- there is no big difference between Note 1 and Note 2 (I mean general use)
- Note 3 isn't good as Phone (it's too big for me as phone, or my fingers are too short)
It's just your opinion.
Click to expand...
Click to collapse
Unless I hard brick it of whatever the reason, I will stay with Note 1
Although having a new phone is not bad idea
Guys! just to let you know that on LSA firmware, mentioned toggle switches in SystemUI are already enabled by default, the only thing I had to do was link them with their referral switches to Settings.
Thanks btw for this tutorial
Just love ua stuff
Ty
Sent from my GT-N7000 using xda app-developers app
nice:good:
Nice guide... work for me for full battery notification
Just little question
for add switch on/off
there are
Code:
.field private [COLOR="Red"]mBatPref[/COLOR]:Landroid/preference/CheckBoxPreference;
and this
Code:
const-string v11,[COLOR="Red"] "bat_sbar"[/COLOR]
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
and this
Code:
:cond_[COLOR="Red"]batteryToggle[/COLOR]
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_179
My question, to which is marked in red, I have to refer to where to make it?
because I am trying to make a toggle for mobile data and does not affect anything when i checked in setting.
thanks.
Sorry My Bad English
Click to expand...
Click to collapse
thank you so much for your guide i am trying to do this for my tab 4 running kitkat and i seem to be running into some issues with recompiling. Do you think you could help me out i really want this mod in my ROM. I attached a screenshot for the errror im recieving and i also attached the decompiled secsettings folder i modified
Thanks if you can help a bro out
Download here: https://drive.google.com/file/d/0B_Sw043dvZeoZkZHNkVPSnNtZnc/view?usp=sharing
View attachment 4248531
syaeful said:
Nice guide... work for me for full battery notification
Just little question
for add switch on/off
there are
Code:
.field private [COLOR="Red"]mBatPref[/COLOR]:Landroid/preference/CheckBoxPreference;
and this
Code:
const-string v11,[COLOR="Red"] "bat_sbar"[/COLOR]
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
and this
Code:
:cond_[COLOR="Red"]batteryToggle[/COLOR]
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatPref:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_179
My question, to which is marked in red, I have to refer to where to make it?
because I am trying to make a toggle for mobile data and does not affect anything when i checked in setting.
thanks.
Click to expand...
Click to collapse
Could you help me out bro if you could?

[Guide][Beginners] Bypass OEM's Device Check

This is a fast and easy tutorial to bypass device not compatible with your device check.
****NOTE I've seen some similar code in Samsung apps but I'm not sure, this guide may differ from device to device. and it isn't 100% that this method is working for all devices*******
I found out that some of the HTC apps were using this device check and I'm sure those who already ported some HTC apps might know how to bypass this issue.
Well this is a very easy way and there isn't "much" that you have to do.
You'll be needing.
Apktool or baksmali
Notepad++
Common smali knowledge.
And ofc java setup to get apktool working.
Now in this example ill only write a short info (this is due to no computer at hand) but it'll cover most of it.
Once you have everything above. you're good to go!
In this example i'm using HTC_IME.apk
Decompile your desired app with either apktool
Navigate to /smali/com/HTC/ and copy the path to the directory
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Open up notepad and press ctrl+f you'll get a popup window. now click on Find in files tab. And in search for window put isHTCdevice As seen in screenshot and in folder copy your copied path to your decompiled HTC location which I mentioned earlier.
Now you'll get probably several strings found with isHTCdevice like
http://forum.xda-developers.com/attachment.php?attachmentid=3237135&stc=1&d=1427751676
Which one would I take???
If your thinking straight. you want either the constructor to be it or a method.
The method should start with. .method
Code:
.method public static isHTCDevice()Z
.locals 9
.prologue
const/4 v1, 0x1
const/4 v2, 0x0
.line 255
sget v0, Lcom/htc/sense/ime/NonAndroidSDK$HtcAdded;->sIS_HTC_DEVICE:I
if-gez v0, :cond_0
.line 256
const-string v0, "ro.product.brand"
const-string v3, ""
invoke-static {v0, v3}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
.line 257
new-instance v0, Lcom/htc/sense/ime/NonAndroidSDK$HAAccUtil;
invoke-direct {v0}, Lcom/htc/sense/ime/NonAndroidSDK$HAAccUtil;-><init>()V
const-string v4, "sku_id"
const/4 v5, -0x1
invoke-virtual {v0, v4, v5}, Lcom/htc/sense/ime/NonAndroidSDK$HAAccUtil;->readInteger(Ljava/lang/String;I)I
move-result v4
.line 258
invoke-static {}, Lcom/htc/a/a;->b()Z
move-result v5
.line 261
sget v6, Landroid/os/Build$VERSION;->SDK_INT:I
.line 262
if-eqz v5, :cond_1
move v0, v1
:goto_0
sput v0, Lcom/htc/sense/ime/NonAndroidSDK$HtcAdded;->sIS_HTC_DEVICE:I
.line 264
new-instance v0, Ljava/lang/StringBuilder;
const-string v7, ", init time:"
invoke-direct {v0, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
sput-object v0, Lcom/htc/sense/ime/NonAndroidSDK$HtcAdded;->sINIT_LOG:Ljava/lang/StringBuilder;
.line 265
sget-object v0, Lcom/htc/sense/ime/NonAndroidSDK$HtcAdded;->sINIT_LOG:Ljava/lang/StringBuilder;
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v7
invoke-virtual {v0, v7, v8}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v0
const-string v7, ", systemProperty="
invoke-virtual {v0, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v3, ", accSku="
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v0
const-string v3, ", HDKLib0Util.isHTCDevice()="
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, v5}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;
move-result-object v0
const-string v3, ", sdkVer="
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
.line 268
const-string v0, "HtcAdded"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "In isHTCDevice(), current time:"
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v4
invoke-virtual {v3, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
move-result-object v3
sget-object v4, Lcom/htc/sense/ime/NonAndroidSDK$HtcAdded;->sINIT_LOG:Ljava/lang/StringBuilder;
invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v4
invoke-virtual {v3, v4}, 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
invoke-static {v0, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 270
:cond_0
sget v0, Lcom/htc/sense/ime/NonAndroidSDK$HtcAdded;->sIS_HTC_DEVICE:I
if-lez v0, :cond_2
:goto_1
return v1
:cond_1
move v0, v2
.line 262
goto :goto_0
:cond_2
move v1, v2
.line 270
goto :goto_1
.end method
So what do we do now?
Well by judging from a fast view, the v1 result and v0 result is moved to v2, which in our case is 0x0 = FALSE
by simply changing the number to 0x1 will tell us that the result of v2 is true
This is my first tutorial and i hope for beginners this is not too hard
Note if you have issues with it not working either force close or not shown. It might be your apktook.
Then
make a copy of your original file. Open it up with your desired zip manager.
Go to your Decompiled folder and Navigate to build/apk/ and copy the classes.dex file to your opened file and you're done!
Sent from my LG-D855 using Tapatalk
How to bypass this one? please
Code:
.class public Lcom/opera/tv/browser/sony/dia/DeviceChecker;
.super Ljava/lang/Object;
.source "DeviceChecker.java"
# direct methods
.method public constructor <init>()V
.registers 1
.prologue
.line 14
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static check()V
.registers 3
.prologue
.line 20
:try_start_0
const-string v1, "com.sony.dtv.remotetouchpad.gesture.UXGestureDetector"
invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
.line 21
const-string v1, "com.mediatek.MtkMediaPlayer"
invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
:try_end_a
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_a} :catch_24
.line 26
sget-object v1, Landroid/os/Build;->MANUFACTURER:Ljava/lang/String;
const-string v2, "Brandabc"
invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_1e
sget-object v1, Landroid/os/Build;->MODEL:Ljava/lang/String;
const-string v2, "Model123"
invoke-virtual {v1, v2}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z
move-result v1
if-nez v1, :cond_2b
.line 27
:cond_1e
new-instance v1, Ljava/lang/UnsupportedOperationException;
invoke-direct {v1}, Ljava/lang/UnsupportedOperationException;-><init>()V
throw v1
.line 22
:catch_24
move-exception v0
.line 23
.local v0, "e":Ljava/lang/ClassNotFoundException;
new-instance v1, Ljava/lang/UnsupportedOperationException;
invoke-direct {v1}, Ljava/lang/UnsupportedOperationException;-><init>()V
throw v1
.line 28
.end local v0 # "e":Ljava/lang/ClassNotFoundException;
:cond_2b
return-void
.end method
I have a device check problem for omnipod app.
The app is compatible with some Samsung phones but I can't find any Samsung string.
How can I remove device check ?

Categories

Resources