[MOD - LG L9-II] Adv Power menu, Back Long Press Kill app, Trans status - LG Optimus L9 P760, P765, P768, P769

This is some mods for LG L9-II Stock ROM.
{
"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"
}
Required ROOT
Advanced Power Menu
Reboot - Hot Boot - Download - Recovery - Shutdown
Got the idea from this thread
Long Press back key -> kill app
Long pressing the Back key will kill the foreground app
Idea from here
Transparent status bar ready
I mean, edits made to android.policy.jar, so a user can change the status bar as will:
1. Open yours LGSystemUI.apk with 7zip and replace (drag & drop) the \res\drawable\xhdpi\stat_sys_indi_bg.png with any png image you want as status bar (rename it first to stat_sys_indi_bg.png).
2. Put back the LGSystemUI.apk to /system/app folder.
How to install (ONLY for stock ODEX version)
Download file(s) from this post and put to sd card.
Install it with CWM from Varcain (install zip from sdcard)
More edits to come...

Thanks mate, but there's no \res\drawable\xhdpi\stat_sys_indi_bg.png location, just \res\drawable-hdpi\stat_sys_indi_bg.png so i am missing something??

Is your phone LG L9-II?

Very useful mod
thanks

UserXP_ said:
This is some mods for LG L9-II Stock ROM.
Required ROOT
Advanced Power Menu
Reboot - Hot Boot - Download - Recovery - Shutdown
Got the idea from this thread
Long Press back key -> kill app
Long pressing the Back key will kill the foreground app
Idea from here
Transparent status bar ready
I mean, edits made to android.policy.jar, so a user can change the status bar as will:
1. Open yours LGSystemUI.apk with 7zip and replace (drag & drop) the \res\drawable\xhdpi\stat_sys_indi_bg.png with any png image you want as status bar (rename it first to stat_sys_indi_bg.png).
2. Put back the LGSystemUI.apk to /system/app folder.
How to install (ONLY for stock ODEX version)
Download file(s) from this post and put to sd card.
Install it with CWM from Varcain (install zip from sdcard)
More edits to come...
Click to expand...
Click to collapse
hi, what did you modified in the android.policy i am tring for weeks to make a transparent status bar for l5 II without succes. thanks sorry for the english

Transparent StatusBar ready (how to)
After many attempts with no luck, solution was easy:
At folder smali\com\android\internal\policy\impl open the PhoneWindowManager.smali
There you will find (search for something similar in your system) this method:
.method public getSystemDecorRectLw
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
.locals 1
.parameter "systemRect"
.prologue
.line 3549
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I
iput v0, p1, Landroid/graphics/Rect;->left:I
.line 3550
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I
iput v0, p1, Landroid/graphics/Rect;->top:I
.line 3551
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I
iput v0, p1, Landroid/graphics/Rect;->right:I
.line 3552
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I
.line 3553
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
[COLOR="Red"]goto :cond_1[/COLOR]
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
.line 3555
:goto_0
return v0
.line 3554
:cond_0
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_1
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
goto :goto_0
.line 3555
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
So, inside I just add the
goto :cond_1
to jump the getSurfaceLayer
That's all.
Now, you can change the background by changing the \res\drawable\xhdpi\stat_sys_indi_bg.png
NOTE for LGHome (if this is your launcher)
In order to change the status bar with LGHome we must edit/change the LGHome.apk also.
for LGHome v. 3.0 can be done with some trick,
but BETTER
use LGHome v 4.0 (edited from LG G2) from here (has 5 columns also)

UserXP_ said:
Transparent StatusBar ready (how to)
After many attempts with no luck, solution was easy:
At folder smali\com\android\internal\policy\impl open the PhoneWindowManager.smali
There you will find (search for something similar in your system) this method:
.method public getSystemDecorRectLw
Code:
.method public getSystemDecorRectLw(Landroid/graphics/Rect;)I
.locals 1
.parameter "systemRect"
.prologue
.line 3549
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I
iput v0, p1, Landroid/graphics/Rect;->left:I
.line 3550
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I
iput v0, p1, Landroid/graphics/Rect;->top:I
.line 3551
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I
iput v0, p1, Landroid/graphics/Rect;->right:I
.line 3552
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I
.line 3553
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
[COLOR="Red"]goto :cond_1[/COLOR]
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
.line 3555
:goto_0
return v0
.line 3554
:cond_0
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_1
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
goto :goto_0
.line 3555
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
So, inside I just add the
goto :cond_1
to jump the getSurfaceLayer
That's all.
Now, you can change the background by changing the \res\drawable\xhdpi\stat_sys_indi_bg.png
NOTE for LGHome (if this is your launcher)
In order to change the status bar with LGHome we must edit/change the LGHome.apk also.
for LGHome v. 3.0 can be done with some trick,
but BETTER
use LGHome v 4.0 (edited from LG G2) from here (has 5 columns also)
Click to expand...
Click to collapse
thanks for the help but i cant recompoile the android.policy i get smali error that cond_1 not defined

Post the
.method public getSystemDecorRectLw(Landroid/graphics/RectI
here

UserXP_ said:
Post the
.method public getSystemDecorRectLw(Landroid/graphics/RectI
here
Click to expand...
Click to collapse
.method public getSystemDecorRectLw(Landroid/graphics/RectI
.registers 3
.parameter "systemRect"
.prologue
.line 3213
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemLeft:I
iput v0, p1, Landroid/graphics/Rect;->left:I
.line 3214
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemTop:I
iput v0, p1, Landroid/graphics/Rect;->top:I
.line 3215
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemRight:I
iput v0, p1, Landroid/graphics/Rect;->right:I
.line 3216
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSystemBottom:I
iput v0, p1, Landroid/graphics/Rect;->bottom:I
.line 3217
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mStatusBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
.line 3219
:goto_1a
return v0
.line 3218
:cond_1b
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
if-eqz v0, :cond_26
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mNavigationBar:Landroid/view/WindowManagerPolicy$WindowState;
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowState;->getSurfaceLayer()I
move-result v0
goto :goto_1a
.line 3219
:cond_26
const/4 v0, 0x0
goto :goto_1a
.end method
---------- Post added at 08:43 AM ---------- Previous post was at 08:37 AM ----------
and did you used smali and baksmali to modify the odex file?

For you the correct command is
goto :cond_26
before the command
if-eqz v0, :cond_1b
If you have an ODEX rom, you can NOT simply change the odex file at /system/framework.
You must Re-Odex the jar file, using your phone.
I use xdaAutoDEOTool v1.0.3 for De-Odex jar files.
After, I use apktool for decompiling/compiling and Notepad++ for editing.
At end I use a script for Re-Odex the edited jar file, inside phone (required root and busybox)
[There are scripts for this (carefull with bootclasspath). I use my own]
In case something goes wrong with Re-Odex, you must have a way to restore system (a .zip file with original .jar and .odex file to install with CWM?)

UserXP_ said:
For you the correct command is
goto :cond_26
before the command
if-eqz v0, :cond_1b
If you have an ODEX rom, you can NOT simply change the odex file at /system/framework.
You must Re-Odex the jar file, using your phone.
I use xdaAutoDEOTool v1.0.3 for De-Odex jar files.
After, I use apktool for decompiling/compiling and Notepad++ for editing.
At end I use a script for Re-Odex the edited jar file, inside phone (required root and busybox)
[There are scripts for this (carefull with bootclasspath). I use my own]
In case something goes wrong with Re-Odex, you must have a way to restore system (a .zip file with original .jar and .odex file to install with CWM?)
Click to expand...
Click to collapse
thanks man, it seems that this piece of crap phone doesn't wan't to boot if i modify the android.policy.

wooooo such a nice look for LG L9 II

UserXP_ said:
This is some mods for LG L9-II Stock ROM.
Click to expand...
Click to collapse
How did you write your name on the status bar?
Thank you.

Related

[MOD][GUIDE] TouchWiz change default screen to center screen on XXLPH

Hi all,
Do you use stock touchwiz launcher then this might be for you!
I don't know if such a guide already has been posted but here it goes:
1) Decompile TouchWiz30Launcher.apk
2) Edit the file QuickViewWorkspace.smali
3) Change the code in close() method around line 4054 from
sget v3, Lcom/sec/android/app/twlauncher/Launcher;->DEFAULT_SCREEN:I
if-lt v3, v0, :cond_31
.line 569
sput v0, Lcom/sec/android/app/twlauncher/Launcher;->DEFAULT_SCREEN:I
.line 587
:goto_30
return-void
To:
sget v3, Lcom/sec/android/app/twlauncher/Launcher;->DEFAULT_SCREEN:I
# if-lt v3, v0, :cond_31
.line 569
const/4 v3, 0x2
div-int v0, v0, v3
sput v0, Lcom/sec/android/app/twlauncher/Launcher;->DEFAULT_SCREEN:I
.line 587
:goto_30
return-void
The change is in bold. One line has been removed and 2 lines were added.
4) Edit the file Launcher.smali
5) Change the code in setupViews() method around line 8910 from
sget v1, Lcom/sec/android/app/twlauncher/Launcher;->DEFAULT_SCREEN:I
if-lt v1, v0, :cond_be
.line 1913
add-int/lit8 v0, v0, -0x1
sput v0, Lcom/sec/android/app/twlauncher/Launcher;->DEFAULT_SCREEN:I
to
sget v1, Lcom/sec/android/app/twlauncher/Launcher;->DEFAULT_SCREEN:I
# if-lt v1, v0, :cond_be
.line 1913
add-int/lit8 v0, v0, -0x1
const/4 v1, 0x2
div-int v0, v0, v1
sput v0, Lcom/sec/android/app/twlauncher/Launcher;->DEFAULT_SCREEN:I
The change is in bold. One line has been removed and 2 lines were added.
What this change does is it divides (number of screens -1) by 2 and set that as the default screen.
The first change is for when a change in number of screens was made and the second change is for when the app starts.
6) Compile back and you are done.
I have included both odex and deodexed CWM version of mod and original files.
Note: Stock odexed users can also use the deodexed version if they like.
If you have problems then use restore file and clear dalvik-cache.
Have fun...
Thanks for sharing, man
you are the best JKAY keep the good work
Good job bro, that's a good work.
great. thanks _JKay_
any for XXLPQ?
‬1‬ said:
any for XXLPQ?
Click to expand...
Click to collapse
+1
Thanks
can anyone please make a fix for the LPD version?

[HOW TO] [LSJ] Toggle to choose AOSP lockscreen **11DEC**

For TouchWiz Jelly Bean Roms (LSJ)
This is a noob proof guide, very easy to do, and made to involve less :cond_ possible.
Is not a clean guide for developers, infact i will use existing parts of code (not used) to make the toggle.
Obviously, if u are a developer and have a little experience with smali code language and patience with cond you can figure this out easily
requirements:
-apktool use (i won t teach u how to use apktool, i assume u can use it)
-attention
this tutorial is made on 2 parts:
-create a switch to change circle lockscreen with aosp lockscreen
-create a toggle to set the aosp lockscreen when checked
ready?
PART 1
We need to decompile android.policy.jar for first.
navigate: smali/com/android/internal/policy/impl/LockPatternKeyguardView.smali
look for .method createLockScreen()Landroid/view/View; and add the red lines
Code:
.method createLockScreen()Landroid/view/View;
.registers 7
.prologue
.line 1319
[COLOR="Red"]iget-object v0, p0, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "aosp_lock"
const/4 v2, 0x0
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-nez v0, :cond_mirko
[/COLOR]
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
[COLOR="Red"]goto :goto_ddd[/COLOR]
.line 1325
[COLOR="Red"]:cond_mirko
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
[/COLOR]
.local v0, lockView:Landroid/view/View;
[COLOR="Red"]:goto_ddd[/COLOR]
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockPatternKeyguardView;->initializeTransportControlView(Landroid/view/View;)V
first part is done
recompile and push it on /system/framework
PART 2
this is the not clean part, i have not created new codes for a toggle, but i used an unused code with the form i needed (checkbox preference).
I decompiled SecSettings.apk /smali/com/android/settings/LockscreenSettings.smali
the unused code i used is "mSayCommand" one, infact has the checkbox preference form i needed as we can see
Code:
.field private mSayCommand:Landroid/preference/CheckBoxPreference;
ok let s start second part, we need to change all "mSayCommand" to "mAospLock" and change the keyword from "wake_up_lock_screen" to "aosp_lock" in order to recall the first part of the mod we made in android.policy.jar
red part is what we add, and purple what we delete.
Code:
[COLOR="Red"].field private mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
.field private mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;
.field private mClock:Landroid/preference/CheckBoxPreference;
.field private mDualclock:Landroid/preference/SwitchPreferenceScreen;
.field private mHelpText:Landroid/preference/CheckBoxPreference;
.field private mInformationTicker:Landroid/preference/SwitchPreferenceScreen;
.field private mInkEffect:Landroid/preference/PreferenceScreen;
.field mInkEffectSummary:[I
.field private mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
.field private mLockScreenShortcut:Landroid/preference/SwitchPreferenceScreen;
.field private mMotionDialog:Landroid/app/AlertDialog;
.field private mRippleEffect:Landroid/preference/CheckBoxPreference;
[COLOR="DarkOrchid"].field private mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
...
Code:
.line 319
:cond_f8
[COLOR="DarkOrchid"] iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Red"]iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
if-eqz v4, :cond_10e
.line 320
[COLOR="DarkOrchid"]iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Red"]iget-object v7, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
[COLOR="DarkOrchid"]const-string v8, "wake_up_lock_screen"[/COLOR]
[COLOR="Red"]const-string v8, "aosp_lock"[/COLOR]
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_146
move v4, v5
:goto_10b
invoke-virtual {v7, v4}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
Code:
.line 225
const-string v9, "say_your_wakeup"
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;
[COLOR="DarkOrchid"] iput-object v9, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Red"]iput-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
.line 227
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getActivity()Landroid/app/Activity;
move-result-object v9
invoke-static {v9}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z
move-result v9
if-eqz v9, :cond_20d
.line 228
[COLOR="DarkOrchid"]iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Red"]iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getResources()Landroid/content/res/Resources;
move-result-object v10
const v11, 0x7f090d6f
invoke-virtual {v10, v11}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
move-result-object v10
invoke-virtual {v9, v10}, Landroid/preference/CheckBoxPreference;->setSummary(Ljava/lang/CharSequence;)V
as u can see I left untouched keyword "say_your_wakeup", it s not a wrong writing, i left it and i will use that keyword in future steps.
Code:
.line 254
[COLOR="DarkOrchid"]iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Red"]iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
if-eqz v9, :cond_26d
.line 255
[COLOR="DarkOrchid"]invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v9
iget-object v10, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;
invoke-virtual {v9, v10}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
[/COLOR]
we delete this part of code to make the option visible, infact i said we re using an unused part of code, and has been hidden from preference screen.
Code:
.line 259
:cond_276
const/4 v9, 0x0
invoke-static {v9}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z
move-result v9
if-nez v9, :cond_287
[COLOR="DarkOrchid"]iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Red"]iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
if-eqz v9, :cond_296
if-eqz v7, :cond_296
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;
if-nez v9, :cond_296
Code:
.line 262
:cond_296
iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mCameraShortCut:Landroid/preference/SwitchPreferenceScreen;
if-nez v9, :cond_2af
[COLOR="DarkOrchid"]iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Red"]iget-object v9, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
if-nez v9, :cond_2af
if-nez v7, :cond_2af
Code:
.line 356
:cond_b3
[COLOR="DarkOrchid"]iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Red"]iget-object v4, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
invoke-virtual {p2, v4}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_1e
.line 357
invoke-virtual {p0}, Lcom/android/settings/LockScreenSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
[COLOR="DarkOrchid"]const-string v5, "wake_up_lock_screen"[/COLOR]
[COLOR="Red"]const-string v5, "aosp_lock"[/COLOR]
[COLOR="DarkOrchid"]iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mSayCommand:Landroid/preference/CheckBoxPreference;[/COLOR]
[COLOR="Red"]iget-object v6, p0, Lcom/android/settings/LockScreenSettings;->mAospLock:Landroid/preference/CheckBoxPreference;[/COLOR]
invoke-virtual {v6}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v6
if-eqz v6, :cond_ce
smali part is done, and now the toggle is set and working
last part is to edit our unused part of the code in res/xml folder, lockscreen_settings.xml
Code:
[COLOR="DarkOrchid"]<CheckBoxPreference android:title="@string/samsung_unlock_option_say_your_wakeup_command_to_unlock_screen" android:key="say_your_wakeup" android:summary="@string/wakeup_in_lockscreen_summary" />
[/COLOR]
[COLOR="Red"]<CheckBoxPreference android:title="@string/your_string" android:key="say_your_wakeup" android:summary="@string/your_summary_string" />[/COLOR]
asu can see we have again the keyword i said before "say_your_wakeup" , if u want u can change it, but change it in the smali part too if not the toggle won t work.
Now simply add the strings in /res/values/strings.xml
Code:
<string name="your_string">AOSP Lockscreen</string>
<string name="your_summary_string">Original Jelly Bean Lockscreen</string>
that s it.
easy and noob proof
and this is the result
{
"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"
}
i take just in case
Nice guide... I like the way you reused some code.
shoman94 said:
Nice guide... I like the way you reused some code.
Click to expand...
Click to collapse
Thanks Jas!
Very useful tutorial:thumbup:
Inviato dal mio GT-N7000 con Tapatalk 2
How I can do this without the toggle? I just want the AOSP Lockscreen, does not interest me to Samsung xD
Thank you very much :laugh:

[MOD] Samsung KeyBoard Swipe Color Change Found! - Updated Instructions

Okay, alot of dev's/themers been looking for this one...
If you use, please give credit, I spent many hours finding this Mod... Dont take credit for someone else's work...
This Mod will allow you to change the Samsung KeyBoard Swipe Color..(SamsungIME.apk)
Look for:
smali\com\diotek\ime\framework\view\AbstractKeyBoardView.smali
Search for -> .method private setTracePaintOptionsWithSettings()V
Click to see Org Code
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, 0xff
const/4 v1, 0x1
const/4 v3, 0x0
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, 0xa5
const/16 v2, 0xf3
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
Click to see what to change:
Code:
.method private setTracePaintOptionsWithSettings()V
.locals 5
.prologue
const/16 v4, [B][U][COLOR="Blue"]0xff[/COLOR][/U][/B] [B][COLOR="seagreen"]Change for Alpha Value - "0xff" [/COLOR][/B]
const/4 v1, 0x1
const/4 v3, [B][U][COLOR="Blue"]0x0[/COLOR][/U][/B] [B][COLOR="seaGreen"] - Change for Red Value - "0x0"[/COLOR][/B]
.line 9829
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
if-nez v0, :cond_0
.line 9830
new-instance v0, Landroid/graphics/Paint;
invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V
iput-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
.line 9832
:cond_0
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
if-eqz v0, :cond_1
.line 9833
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePoint:Ljava/util/ArrayList;
invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V
.line 9835
:cond_1
iput-short v3, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePointCount:S
.line 9836
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setAntiAlias(Z)V
.line 9837
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
invoke-virtual {v0, v1}, Landroid/graphics/Paint;->setDither(Z)V
.line 9838
iget-object v0, p0, Lcom/diotek/ime/framework/view/AbstractKeyboardView;->mTracePaint:Landroid/graphics/Paint;
const/16 v1, [B][U][COLOR="Blue"]0xa5[/COLOR][/U][/B] [COLOR="seagreen"]- Change for Green Value - "0xa5"[/COLOR]
const/16 v2, [B][U][COLOR="Blue"]0xf3[/COLOR][/U][/B] [COLOR="seagreen"] - Change for Blue Value - "0xf3"[/COLOR]
invoke-static {v4, v3, v1, v2}, Landroid/graphics/Color;->argb(IIII)I
So what it boils down to is that the Swipe Color is what we call RGB color coding. I suggest a site like this to see values you can use:
Hex to RGB Color converter
Thats it folks.. swipe color squashed!!!!
Verified to work on N3 KeyBoards
A Little clarification on Instructions.
I was swamped with questions on how to edit and such.. So with @strongsteve help we dug more and here is an easier way to get your colors instead of trying to use RGB values..
change code:
Code:
const/16 v1, 0xa5
const/16 v2, 0xf3
to
Code:
const v3, 0x33
const v1, 0x66
const v2, 0xcc
Then just use any normal Hex Color code you would normally use!!!
In the above example I used 3366cc which is DarkHorse Blue..
I hope that helps
Thanks been looking for this myself. Great job!
Sent from my SCH-I545 using XDA Premium 4 mobile app
This has been long sought after....thanks for this and great work my friend! :highfive::good:
ALL Users must be reminded to give credit for this share, as, unless I am mistaken, it is not too many other places!
Sorry... can someone post what those lines should look like once they have been changed to a diff color? I'm not sure exactly what in those lines I should be changing (I do understand the color codes).
Sorry for the noobish question.
TheCelt said:
Sorry... can someone post what those lines should look like once they have been changed to a diff color? I'm not sure exactly what in those lines I should be changing (I do understand the color codes).
Sorry for the noobish question.
Click to expand...
Click to collapse
You would be changing the codes themselves.
i.e ff or a5, or whatever...
I will write up more in a bit..
Gunthermic said:
You would be changing the codes themselves.
i.e ff or a5, or whatever...
I will write up more in a bit..
Click to expand...
Click to collapse
Thanks for clarifying the coding changes.... one last (what I am sure if dumb) question. where does one find that file. I am rooted and searched the device for both "smali" and "diotek" using ES file Explorer and have not found the file referenced above.
TheCelt said:
Thanks for clarifying the coding changes.... one last (what I am sure if dumb) question. where does one find that file. I am rooted and searched the device for both "smali" and "diotek" using ES file Explorer and have not found the file referenced above.
Click to expand...
Click to collapse
Its contained inside the SamsungIME apk itself. It has to be decompiled and MODed
Gunthermic said:
Its contained inside the SamsungIME apk itself. It has to be decompiled and MODed
Click to expand...
Click to collapse
Got it. Thanks Gunthermic. Much appreciated.

added logcat command to .smali method brakes OPSystemUI.apk

Hello everyone, I have recently started doing modifications in the .smali world. I have already successfully modified my first application by converting the .apk to (almost) .java and then analyzing the method I needed to change. Then, going through the .smali code and modifying it there and compiling the .apk again.
This last one was a non-system apk, but I am currently working on a system apk, more explicitly OPSystemUI.apk.
Since it is odexed (.odex), I had to decompile this into a classes.dex and from there to (almost) .java to analyze the code.
Then, after decompiling the .dex to .smali, I found the function from the .java that I wanted to change.
Here is where the problem starts:
The function in .java I am modifying is (com\android\systemui\statusbar\policy\SignalController.class):
Code:
public int getCurrentIconId()
{
if (this.mCurrentState.connected) {
return getIcons().mSbIcons[this.mCurrentState.inetCondition][this.mCurrentState.level];
}
if (this.mCurrentState.enabled) {
return getIcons().mSbDiscState;
}
return getIcons().mSbNullState;
}
This same function in .smali is (SignalController.smali):
Code:
.method public getCurrentIconId()I
.registers 3
.prologue
.line 137
.local p0, "this":Lcom/android/systemui/statusbar/policy/SignalController;, "Lcom/android/systemui/statusbar/policy/SignalController<TT;TI;>;"
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/SignalController;->mCurrentState:Lcom/android/systemui/statusbar/policy/SignalController$State;
iget-boolean v0, v0, Lcom/android/systemui/statusbar/policy/SignalController$State;->connected:Z
if-eqz v0, :cond_19
.line 138
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/SignalController;->getIcons()Lcom/android/systemui/statusbar/policy/SignalController$IconGroup;
move-result-object v0
iget-object v0, v0, Lcom/android/systemui/statusbar/policy/SignalController$IconGroup;->mSbIcons:[[I
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/SignalController;->mCurrentState:Lcom/android/systemui/statusbar/policy/SignalController$State;
iget v1, v1, Lcom/android/systemui/statusbar/policy/SignalController$State;->inetCondition:I
aget-object v0, v0, v1
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/SignalController;->mCurrentState:Lcom/android/systemui/statusbar/policy/SignalController$State;
iget v1, v1, Lcom/android/systemui/statusbar/policy/SignalController$State;->level:I
aget v0, v0, v1
.line 142
:goto_18
return v0
.line 139
:cond_19
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/SignalController;->mCurrentState:Lcom/android/systemui/statusbar/policy/SignalController$State;
iget-boolean v0, v0, Lcom/android/systemui/statusbar/policy/SignalController$State;->enabled:Z
if-eqz v0, :cond_26
.line 140
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/SignalController;->getIcons()Lcom/android/systemui/statusbar/policy/SignalController$IconGroup;
move-result-object v0
iget v0, v0, Lcom/android/systemui/statusbar/policy/SignalController$IconGroup;->mSbDiscState:I
goto :goto_18
.line 142
:cond_26
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/SignalController;->getIcons()Lcom/android/systemui/statusbar/policy/SignalController$IconGroup;
move-result-object v0
iget v0, v0, Lcom/android/systemui/statusbar/policy/SignalController$IconGroup;->mSbNullState:I
goto :goto_18
.end method
and I modify it by adding a logcat command in the beginning to see when this is executed, so it looks like so:
Code:
.method public getCurrentIconId()I
.registers 3
.prologue
.line 137
.local p0, "this":Lcom/android/systemui/statusbar/policy/SignalController;, "Lcom/android/systemui/statusbar/policy/SignalController<TT;TI;>;"
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/SignalController;->mCurrentState:Lcom/android/systemui/statusbar/policy/SignalController$State;
iget-boolean v0, v0, Lcom/android/systemui/statusbar/policy/SignalController$State;->connected:Z
[COLOR="Red"] const-string v3, "getCurrentIconId SIM"
const-string v4, "Beginning of function SIM"
invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I[/COLOR]
if-eqz v0, :cond_19
. . .
- If I try to recompile the .apk from this .smali code, without the .odex, it works perfect (so recompiling should not be the problem)
-However, if I add the logcat command, my phone does not execute OPSystemUI properly (the logcat command is just to modify in some way the code and see its result, it shouldn't change the apk behavior, right?)
Is my added code for logcat wrong? Else, what could it be? I am out of ideas
Overall, the final goal is to remove an icon from the statusbar (the NoSIM icon), and this was a start.
Try changing the .registers 3 to .registers 5
ANIKETultimate said:
Try changing the .registers 3 to .registers 5
Click to expand...
Click to collapse
Thanks for the suggestion!
I tried changing it to 5 and it still failed by looping in the keyguard (first encryption after starting the phone)
rauleeros said:
Thanks for the suggestion!
I tried changing it to 5 and it still failed by looping in the keyguard (first encryption after starting the phone)
Click to expand...
Click to collapse
Hmm. Try moving the lines just before the .local p0 line

[Devs][Guide] Add Reboot Safestrap Recovery to power menu with toggle

Credits goes to @sagitt67 and @daxgirl .
Credits for toggle goes to @tdunham main guide is here and @asc1977 for the guide here big thanks to them.
In this Guide we'll modify framework-res.apk and services.jar
framework-res.apk:
Download framework-res.zip that is attached below, extract and copy it in your decompiled framework-res.apk folder
now open res/values/arrays.xml
find <string-array name="config_globalActionsList"> and add blue
Code:
<string-array name="config_globalActionsList">
<item>power</item>
<item>datamode</item>
<item>airplane</item>
<item>restart</item>
<item>lockdown</item>
<item>bugreport</item>
<item>users</item>
[COLOR="blue"]<item>rebootsafestrap</item>[/COLOR]
<item>emergencymode</item>
<item>subscreen</item>
</string-array>
now go to res/values/strings.xml at very end and add blue
Code:
<string name="wifi_extender_notification_title">Wi-Fi extender on</string>
<string name="wifi_extender_notification_message">Tap here to set up.</string>
<string name="config_tspstate_threshold" />
[COLOR="blue"]<string name="tw_ic_do_restart_safestrap">Reboot Safestrap</string>[/COLOR]
</resources>
done with framework-res.apk recompile
Services.jar:
download services.zip that is attached below, extract and copy it in your decompiled services.jar folder
open smali/com/android/server/policy/GlobalActions.smali
add blue line in # instance fields
Code:
.field private mRestart:Lcom/android/server/policy/GlobalActions$SinglePressAction;
[COLOR="blue"].field private mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;
[/COLOR]
.field mRestartIconResId:I
find .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog;
add blue
Code:
if-eqz v4, :cond_27b
const v4, 0x1080a58
.line 1642
:goto_11c
const v6, 0x104070e
.line 1639
move-object/from16 v0, p0
invoke-direct {v5, v0, v4, v6}, Lcom/android/server/policy/GlobalActions$21;-><init>(Lcom/android/server/policy/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v5, v0, Lcom/android/server/policy/GlobalActions;->mRestart:Lcom/android/server/policy/GlobalActions$SinglePressAction;
[COLOR="Blue"]new-instance v4, Lcom/android/server/policy/GlobalActions$99;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "tw_ic_do_restart_safestrap"
const-string v2, "drawable"
const-string v3, "android"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v5
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "tw_ic_do_restart_safestrap"
const-string v2, "string"
const-string v3, "android"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v6
move-object/from16 v0, p0
invoke-direct {v4, v0, v5, v6}, Lcom/android/server/policy/GlobalActions$99;-><init>(Lcom/android/server/policy/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v4, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;[/COLOR]
.line 1688
invoke-static {}, Lcom/samsung/android/feature/SemCscFeature;->getInstance()Lcom/samsung/android/feature/SemCscFeature;
move-result-object v4
const-string/jumbo v5, "CscFeature_Common_ConfigBikeMode"
invoke-virtual {v4, v5}, Lcom/samsung/android/feature/SemCscFeature;->getString(Ljava/lang/String;)Ljava/lang/String;
Now next part is tricky, add lines in blue and changes in green
Code:
const/4 v7, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
.line 1767
new-instance v4, Lcom/android/server/policy/GlobalActions$BugReportAction;
move-object/from16 v0, p0
invoke-direct {v4, v0}, Lcom/android/server/policy/GlobalActions$BugReportAction;-><init>(Lcom/android/server/policy/GlobalActions;)V
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;
[COLOR="blue"]const/16 v6, 0x100
const/4 v7, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;[/COLOR]
const/16 v6, [COLOR="Green"]0x200[/COLOR] [COLOR="Red"]#before was 0x100[/COLOR]
const/4 v7, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
now search for const-string/jumbo v4, "silent" and add blue line above it and green parts must match orange part
Code:
const-string/jumbo v4, "emergencymode"
invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_381
.line 1835
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mEmergency:Lcom/android/server/policy/GlobalActions$ToggleAction;
invoke-virtual {v4, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :[COLOR="orange"]goto_2d9[/COLOR] #look that green part match this
.line 1836
:cond_381
[COLOR="Blue"]const-string/jumbo v4, "rebootsafestrap"
invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_3da
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;
invoke-virtual {v4, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :[COLOR="Green"]goto_2d9 [/COLOR]
:cond_3da[/COLOR]
const-string/jumbo v4, "silent"
next part is missing in Android 7 services.jar so we need to readd it for mod
find .method private addCustomDialogItems(Landroid/graphics/drawable/BitmapDrawable;Ljava/lang/String;Landroid/content/Intent;ILjava/util/ArrayListZ
add this above method
Code:
[COLOR="Blue"].method static synthetic access$500(Lcom/android/server/policy/GlobalActions;)Landroid/content/Context;
.locals 1
iget-object v0, p0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
return-object v0
.end method[/COLOR]
thats it, recompile and push to phone
Note: For me one time i get after reboot a loop of phone restarts, only one time happens. If it happen i solved it with wipe dalvik-cache and cache
Credits goes to @TheDriller for this part in this guide
Note: no need to change the code in GlobalActions$99.smali already done
GlobalActions$99.smali:
find .method public onPress()V and replace blue lines with red one
Code:
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
[COLOR="Red"]const-string v1, "recovery"
invoke-virtual {v0, v1}, Landroid/os/PowerManager;->reboot(Ljava/lang/String;)V[/COLOR]
to
Code:
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
[COLOR="Blue"]const-string v1, "su -c echo 1 > /data/.recovery_mode && su -c reboot now"
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v2
invoke-virtual {v2, v1}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process;[/COLOR]
Wow thia makes things so much easier
Sent from my SM-G950U using Tapatalk
This is different on the Note 8 isn't it? I got as far as the services jar .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; I input the blue text that was mentioned but I'm curious why in your sample does it not have .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; before the blue text?
The Second batch of code with the green changes I had no idea where to input that and I couldn't find const/16 v6, 0x100 to change to 200 either
The step after that I was genuinely lost nothing matched what you had in your sample I felt like I was so close to getting it.
Thanks
SM-N950W
dillweedinc said:
This is different on the Note 8 isn't it? I got as far as the services jar .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; I input the blue text that was mentioned but I'm curious why in your sample does it not have .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; before the blue text?
The Second batch of code with the green changes I had no idea where to input that and I couldn't find const/16 v6, 0x100 to change to 200 either
The step after that I was genuinely lost nothing matched what you had in your sample I felt like I was so close to getting it.
Thanks
Click to expand...
Click to collapse
I will check them soon.
Maybe @JavixKGD can help you as he asked for the mod and he got it working on Note 8.
It is important to specify that this mod only applies to Nougat, it needs to be updated for Oreo.
I am using Nougat 7.1.1 on a note 8 sm-n950w with me's samfail firmware bl1 - I sent him a message thanks! I see it built into another firmware that is available but id rather build it into me's samfail firmy since there is some issues to be wrinkled out in the other custom firmwares.
This thread is more currently active than the Safestrap one. I'm just here looking for more information on how to flash ROMS while keeping your others. Like do I activate that slot then start flashing and do you know if it's possible to use Slick ROM as one of the slots? I'm rooted with Partcyborg on bootloader v2
xSl33p said:
This thread is more currently active than the Safestrap one. I'm just here looking for more information on how to flash ROMS while keeping your others. Like do I activate that slot then start flashing and do you know if it's possible to use Slick ROM as one of the slots? I'm rooted with Partcyborg on bootloader v2
Click to expand...
Click to collapse
Dont quote me on this but im pretty sure the slots arent 100% functional yet you can do backups and restore your system flash zips ect. , I know this thread is more active but you should really stick with the topic of the thread, your question would get answered there.
I got an answer from the guy you recommended afaneh92 thanks, it looks like I need to place the smalis in a different folder as they go over the limit, I dont have time right now but he also sent me his services .jar so I can see what the difference is I got some learning to do.
Thanks
Canadian Dilly.
dillweedinc said:
Dont quote me on this but im pretty sure the slots arent 100% functional yet you can do backups and restore your system flash zips ect. , I know this thread is more active but you should really stick with the topic of the thread, your question would get answered there.
I got an answer from the guy you recommended afaneh92 thanks, it looks like I need to place the smalis in a different folder as they go over the limit, I dont have time right now but he also sent me his services .jar so I can see what the difference is I got some learning to do.
Thanks
Canadian Dilly.
Click to expand...
Click to collapse
Im working on update and some fixes for the mod, then will rewrite this guide in the Note 8 section.

Categories

Resources