[Guide] Remove Mobile Data Toggle off Warning Dialogue - Galaxy Note GT-N7000 Themes and Apps

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 ?

Related

[MOD] [GUIDE] AOSP LockScreen with Toggle

Okay, since it seems like I only get about 3 people who actually want to download and use my ROM (actually its more like 4....LOL) I will just try to contribute by releasing some more "How-Too's" for those DEVs who want to use them.
As always feel free to use these MODs with your ROM but since it took a few days to get this coded correctly just give me some thanks and some credit in your thread please.
[Q] What does this MOD do?
[A] It allows you to toggle between TW lock screen or AOSP lock screen.
*****EDIT******
If you experience your lock screen freezing when you turn it to landscape mode, just go to lockscreen options and make sure all settings are UNTICKED......except for AOSP lockscreen that is .
Thanks to jdub251 for the feedback.
Here are the goodies.....
We will be working in two files.
-SecSettings
-android.policy
As always, I will assume you know how to compile/decompile so I will not be providing information how to do that.
Lets begin with the easiest file, Android.policy.jar
Navigate to smali/com/android/internal/policy/imp/LockPatternKeyguardView
Find the following code
Code:
.method createLockScreen()Landroid/view/View;
We are going to replace the whole method with the following code.
Code:
.method createLockScreen()Landroid/view/View;
.locals 6
.prologue
.line 1268
const/4 v0, 0x0
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v4, "enable_aosp_lock"
invoke-static {v5, v4, v0}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
if-nez v5, :cond_0
.line 1044
new-instance v0, Lcom/android/internal/policy/impl/sec/CircleLockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/sec/CircleLockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
.line 1274
.local v0, lockView:Landroid/view/View;
:goto_0
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V
.line 1275
return-object v0
:cond_0
new-instance v0, Lcom/android/internal/policy/impl/LockScreen;
iget-object v1, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
iget-object v2, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mConfiguration:Landroid/content/res/Configuration;
iget-object v3, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
iget-object v4, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
iget-object v5, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mKeyguardScreenCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
invoke-direct/range {v0 .. v5}, Lcom/android/internal/policy/impl/LockScreen;-><init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallback;)V
.line 1274
goto :goto_0
.end method
Thats it for android.policy.jar. Recompile and push to /system/app. If you want to Diff out the exact changes feel free.
Now for SecSettings.
Navigate to res/values/strings
Add the following lines somewhere in this file. In the middle or end, it doesnt matter.
Code:
<string name="enable_aosp_lock">Enable AOSP lockscreen</string>
<string name="enable_aosp_lock_text">Enable AOSP lockscreen in place of circle lockscreen</string>
Navigate to res/xml/Lockscreen_Settings.xml
Add the following line below in RED.
Code:
<PreferenceCategory android:title="@string/display_settings" />
[COLOR="red"]<CheckBoxPreference android:title="@string/enable_aosp_lock" android:key="enable_aosp_lock" android:summary="@string/enable_aosp_lock_text" />
[/COLOR] <SwitchPreferenceScreen android:title="@string/lock_screen_shortcut_title" android:key="lock_screen_shortcut" android:summary="@string/lock_screen_shortcut_summary">
Now lets hit some smali.....
Still in SecSettings, lets navigate to smali/com/android/settings/LockScreenSettings
Find the following code
Code:
.field private mWeather:Landroid/preference/SwitchPreferenceScreen;
Add this line below it
Code:
.field private mAospLock:Landroid/preference/CheckBoxPreference;
Find the following code and add the parts in RED
Code:
.method private updateState()V
.locals 9
.prologue
const/4 v5, 0x1
const/4 v6, 0x0
.line 263
[COLOR="Red"]iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v8, "enable_aosp_lock"
invoke-static {v4, v8, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-eqz v4, :cond_7
move v4, v5
invoke-virtual {v7, v4}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 265
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
[/COLOR]
iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mClock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v8, "show_clock"
Find the following code and add the parts in RED
Code:
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mClock:Landroid/preference/CheckBoxPreference;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
[COLOR="red"]const-string v9, "enable_aosp_lock"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
check-cast v9, Landroid/preference/CheckBoxPreference;
iput-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
.line 159
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
const/4 v10, 0x0
invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
[/COLOR]
.line 161
const-string v9, "weather"
invoke-virtual {p0, v9}, Lcom/android/settings/LockScreenSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v9
Find the following code and add the parts in RED
Code:
:cond_9
iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, [COLOR="red"]:cond_b
[/COLOR]
.line 338
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "wake_up_lock_screen"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_a
Find the following code and add the parts in RED
Code:
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1
:cond_a
move v2, v3
goto :goto_5
[COLOR="red"]:cond_b
iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_0
.line 313
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "enable_aosp_lock"
iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_c
:goto_6
invoke-static {v4, v5, v2}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 314
invoke-direct {p0}, Lcom/android/settings/LockScreenSettings;->updateState()V
.line 340
invoke-super {p0, p1, p2}, Lcom/android/settings/SettingsPreferenceFragment;->onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
move-result v2
return v2
:cond_c
move v2, v3
.line 313
goto :goto_6
[/COLOR]
.line 337
.end method
.method public onResume()V
.locals 0
.prologue
.line 257
invoke-super {p0}, Lcom/android/settings/SettingsPreferenceFragment;->onResume()V
.line 258
invoke-direct {p0}, Lcom/android/settings/LockScreenSettings;->updateState()V
Thats it! Recompile and push to /system/app
You will find your new toggle in lockscreen options.
Enjoy!
The newest version for BLK3 has a few other mods included in it as well. See the installer screen when installing for specifics. This is meant for Stock Deodexed RoMs.If your using a custom ROM this will break the theme and maybe other stuff. Enjoy.
BLK3 AOSP Lockscreen ZIP
Thanks Button!
Awesome work as always bud!!!
Seriously... always a pleasure working with you...
Sent from my SPH-L900 using Xparent ICS Tapatalk 2
Argh I thought this was the answer to my prayers, a zip file. I appreciate the tutorial but it looks Chinese to a dunce like myself. No zip file? I desperately want to keep touch wiz but want aosp lock screen to afraid I'm going to screw my phone up.
dukins said:
Argh I thought this was the answer to my prayers, a zip file. I appreciate the tutorial but it looks Chinese to a dunce like myself. No zip file? I desperately want to keep touch wiz but want aosp lock screen to afraid I'm going to screw my phone up.
Click to expand...
Click to collapse
I also wonder if it's possible to have something more semi-automatic...
Seems very complicated, especially since I flash new ROM's every few days.... Thank you so much for putting the time into such a great tutorial though!! I will definitely try it out soon, because I love the ASOP lockscreen.
Edit: one request - can you post a picture of the ASOP lockscreen we would have? Thank you!
Nightwind Hawk said:
I also wonder if it's possible to have something more semi-automatic...
Seems very complicated, especially since I flash new ROM's every few days.... Thank you so much for putting the time into such a great tutorial though!! I will definitely try it out soon, because I love the ASOP lockscreen.
Edit: one request - can you post a picture of the ASOP lockscreen we would have? Thank you!
Click to expand...
Click to collapse
This would give you AOSP lock with two extra shortcuts......Camera and Google. I am going to post up a tutorial on how to add more shortcuts soon.
Due to popular demand I am going to throw a flashable zip in the opening post. To be honest I didnt test it so nandroid first. This is my upgraded lockscreen with extra shortcuts. Let me know if this installs okay (it should). There may be some misc. other things included because I pulled this right out of my ROM. Enjoy!
Thanks Button!!
I'm gonna give it a shot.
Shh! maybe I'm just paranoid, but I think people are listening....
Just checked out your ROM. I missed it but will be giving it a shot when classes are over tomorrow for break lol
Sent from my SCH-I535 using xda app-developers app
tu3218 said:
Just checked out your ROM. I missed it but will be giving it a shot when classes are over tomorrow for break lol
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
Thanks. I will release another soon with this MOD included.
I just flashed on clean ROM 3.5 an not seeing it in lock screen options.
Sent from my SCH-I535 using xda app-developers app
Didact74 said:
Let me know if this installs okay (it should).
Click to expand...
Click to collapse
Nothing on the flash. No option to enable
Sorry guys, it was my error. I packed the zip wrong. Thats what i get for rushing it.
Should be good now. Let me know.
Didact74 said:
Sorry guys, it was my error. I packed the zip wrong. Thats what i get for rushing it.
Should be good now. Let me know.
Click to expand...
Click to collapse
Fuggin saweeet!
EDIT:
Works perfectly on CleanROM 4.5.
Does it matter base of the ROM and if is deodexed or odexed? I'm in new leak and want to use this zip. When fixed is out of course
Sent from my SCH-I535 using xda premium
The revised zip file worked great on synergy r118. Frackin beautiful! Thanks.
Shh! maybe I'm just paranoid, but I think people are listening....
Works on Jelly Beans Build 3, but de-themes everything. Nandroid'd back, i gotta have my AOSP looks!
Works fine now. CR 4.5
dawiseguy77 said:
Does it matter base of the ROM and if is deodexed or odexed? I'm in new leak and want to use this zip. When fixed is out of course
Sent from my SCH-I535 using xda premium
Click to expand...
Click to collapse
Just needs to be a deodexed rom.
charlieg90 said:
Works on Jelly Beans Build 3, but de-themes everything. Nandroid'd back, i gotta have my AOSP looks!
Click to expand...
Click to collapse
Sorry, maybe your rom dev will pick up the mod so you can retain themes.
If you experience your lock screen freezing when you turn it to landscape mode, just go to lockscreen options and make sure all settings are UNTICKED......except for AOSP lockscreen that is .
Thanks to jdub251 for the feedback.
Glad you guys like it.
Didact74 said:
If you experience your lock screen freezing when you turn it to landscape mode, just go to lockscreen options and make sure all settings are UNTICKED......except for AOSP lockscreen that is .
Thanks to jdub251 for the feedback.
Glad you guys like it.
Click to expand...
Click to collapse
Thanks much appreciated. I havent tested it yet im in the process. If calendar events aren't included on the lockscreen is this something you could incorporate on the lock screen like cm10?
dukins said:
Thanks much appreciated. I havent tested it yet im in the process. If calendar events aren't included on the lockscreen is this something you could incorporate on the lock screen like cm10?
Click to expand...
Click to collapse
Currently working on adding calander and weather options. I will post up when I get it worked out.
Thanks

[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

[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..

[PORT]Kitkat Easter Egg for 4.x

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"
}

[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