Related
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:
Hello friends today I want to share with you this little mod on how to integrate a button to switch 3G/2G in lidroidbar......:laugh:
We need to change 4 packages which include: lidroid-res.apk, the Secphone.apk, the quikpanel.apk and SystemUI.apk
First we have to add the receivers at Secphone.Apk and register them at runtime throug phone app startup..
Download this zip and paste into SecPhone.apk classes
1- Decompile Secphone.apk classes with apktool or simply extract the classes.dex and decompile with smali utility
Find the class PhoneApp.smali ( \com\android\phone ) and add this values : .
field private final mModeReceiver:Landroid/content/BroadcastReceiver; *
Code:
.field private mLastNumber:Ljava/lang/String;
.field private mLastPhoneState:Lcom/android/internal/telephony/Phone$State;
.field private mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
.field private final mMediaButtonReceiver:Landroid/content/BroadcastReceiver;
[COLOR=DarkRed].field private final mModeReceiver:Landroid/content/BroadcastReceiver;[/COLOR] *
.field public mMmiInitMsg:Landroid/os/AsyncResult;
Search for new-instance v0, Lcom/android/phone/PhoneApp$PhoneAppBroadcastReceiver;
And after this line add this :
Code:
new-instance v0, Lcom/android/phone/NetworkModeReceiver;
invoke-direct {v0}, Lcom/android/phone/NetworkModeReceiver;-><init>()V
iput-object v0, p0, Lcom/android/phone/PhoneApp;->mModeReceiver:Landroid/content/BroadcastReceiver;
Now search this line iget-object v1, p0, Lcom/android/phone/PhoneApp;->mReceiver:Landroid/content/BroadcastReceiver;
and after invoke-virtual {p0, v1, v0}, Lcom/android/phone/PhoneApp;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilterLandroid/content/Intent;
Add this code :
Code:
new-instance v0, Landroid/content/IntentFilter;
const-string v1, "com.android.phone.CHANGE_NETWORK_MODE"
invoke-direct {v0, v1}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
iget-object v1, p0, Lcom/android/phone/PhoneApp;->mModeReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {p0, v1, v0}, Lcom/android/phone/PhoneApp;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
Thats all for Secphone.apk and you can recompile them.....
2- Now we need to add the button values to lidroid-res.apk ( easy part )
Decompile the lidroid framework and add this values to string : <string name="quickpanel_networkmode_text">2G/3G/Auto</string>
After we need to add to drawable-hdmi 3 png image and renaming in stat_gsm_on stat_gsm_off stat_gsm_auto, search for your favorite icon araund the web. Thats all for lidroid framework recompile.
After compiling lidroid-res.apk you need to decompile again and copy the corresponding values from the public file : Example in my case the string
quickpanel_networkmode_text have this value 0x050b0063 ( 0x50b0063 in systemui ), do this even for images that you have added ....We will need these values when we're going to add the button to lidroidbar within the systemui.
3- Add button to lidroid values inside the systemui:
Decompile your SystemUI classes.dex ( where the lidroidbar setting are ) and copy this file inside \com\lidroid\systemui\quickpanel
Search the power button.smali and add this values
Code:
[COLOR=DarkRed]sget-object v0, Lcom/lidroid/systemui/quickpanel/PowerButton;->BUTTONS:Ljava/util/HashMap;
const-string v1, "toggleNetworkMode"
const-class v2, Lcom/lidroid/systemui/quickpanel/NetworkModeButton;
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;[/COLOR]
.line 71
new-instance v0, Ljava/util/HashMap;
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
sput-object v0, Lcom/lidroid/systemui/quickpanel/PowerButton;->BUTTONS_LOADED:Ljava/util/HashMap;
.line 80
sput-object v3, Lcom/lidroid/systemui/quickpanel/PowerButton;->GLOBAL_ON_CLICK_LISTENER:Landroid/view/View$OnClickListener;
.line 83
sput-object v3, Lcom/lidroid/systemui/quickpanel/PowerButton;->GLOBAL_ON_LONG_CLICK_LISTENER:Landroid/view/View$OnLongClickListener;
return-void
.end method
In case adjust for your directory...
Now enter to com/lidroid/constants/ and open statusbar.smali and add this line:
.field public static final BUTTON_NETWORKMODE:Ljava/lang/String; = "toggleNetworkMode"
Now open out/lidroid and search for R$drawable.smali open and add this values:
Code:
.field public static final stat_gsm_on:I = 0x50200ff
.field public static final stat_gsm_off:I = 0x50200fe
.field public static final stat_gsm_auto:I = 0x5020100
adjusted values with those of your lidroid framework.....
Now open R$string.smali and add this line:
.field public static final quickpanel_networkmode_text:I = 0x50b0063
Also adjusted again values with those of your lidroid framework.....
Finally open the file we added before: the "NetworkModeButton.smali"
We have to adjust the values for the image and string take from the lidroid framework....
Thats all for SystemUI you can recompile.....:laugh:
4- Final part...Add toggle in the quikpanel.apk
Decompile the quikpanel.apk and insert this value to string.xml ( inside values/string )
<string name="title_toggle_NetworkMode">Toggle 2G/3G</string>
Compile and after decompile again, We need the string value that we added, take this value...
Now search into smali files the PowerWidjetUtil.smali and add another button like this:
Code:
const-string v1, "toggleNetworkMode"
new-instance v2, Lcom/goatrip/statusbar/PowerWidgetUtil$ButtonInfo;
const-string v3, "toggleNetworkMode"
const v4, 0x7f080049
const-string v5, "goatrip:drawable/stat_gsm_on"
invoke-direct {v2, v3, v4, v5}, Lcom/goatrip/statusbar/PowerWidgetUtil$ButtonInfo;-><init>(Ljava/lang/String;ILjava/lang/String;)V
invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
The button structure may be different than mine simply copy and paste a your existing button source.
Now adjust the string value with the one obtained first
Thats all Enjoy
If you like this mod simply give me a thanks!!!!!!
{
"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"
}
Added Modded Lidroid Framework......:laugh:
Hey, first of all, many thanks for your work.
But, I can´t make it work. I do all changes in SecPhone.apk, but any time I reboot the phone, all I get is SecPhone has sttoped. Any ideas to fix it.
The first point said: Download this zip and paste into SecPhone.apk classes
I decompiled SecPhone.apk first and copy the files later into \com\android\phone, I guess this the right order, isn´t it?.
If I replace the SecPhone.apk with the original one, there are not any fc, but this toggle does not appear anywhere. I can´t see it into the lidroidSettings.
ROM. LS8
Kernel: Jeboo
Thanks in advance, any help would be appreciated.
Josehg said:
Hey, first of all, many thanks for your work.
But, I can´t make it work. I do all changes in SecPhone.apk, but any time I reboot the phone, all I get is SecPhone has sttoped. Any ideas to fix it.
The first point said: Download this zip and paste into SecPhone.apk classes
I decompiled SecPhone.apk first and copy the files later into \com\android\phone, I guess this the right order, isn´t it?.
If I replace the SecPhone.apk with the original one, there are not any fc, but this toggle does not appear anywhere. I can´t see it into the lidroidSettings.
ROM. LS8
Kernel: Jeboo
Thanks in advance, any help would be appreciated.
Click to expand...
Click to collapse
+1
Does the toggle switch between 2G & 3G bands?
hi Neme77
Can you tell me how I can add 23 Toggles in In this SystemUI here
I want to add lidroid-res - LidroidSettings
Please,
Someone made work this mod on LSD or LSE?
Enviado desde mi GT-I9100 usando Tapatalk 2
Devil_1210 said:
Someone made work this mod on LSD or LSE?
Enviado desde mi GT-I9100 usando Tapatalk 2
Click to expand...
Click to collapse
+1
that would be awesome
anyone?
Josehg said:
Hey, first of all, many thanks for your work.
But, I can´t make it work. I do all changes in SecPhone.apk, but any time I reboot the phone, all I get is SecPhone has sttoped. Any ideas to fix it.
The first point said: Download this zip and paste into SecPhone.apk classes
I decompiled SecPhone.apk first and copy the files later into \com\android\phone, I guess this the right order, isn´t it?.
If I replace the SecPhone.apk with the original one, there are not any fc, but this toggle does not appear anywhere. I can´t see it into the lidroidSettings.
ROM. LS8
Kernel: Jeboo
Thanks in advance, any help would be appreciated.
Click to expand...
Click to collapse
in SecPhone, after all the changes, delete this string in the AndroidManifest.xml:
Code:
<uses-permission android:name="android.permission.DUMP" />
Recompile and Sign apk
Troy.main said:
hi Neme77
Can you tell me how I can add 23 Toggles in In this SystemUI here
I want to add lidroid-res - LidroidSettings
Please,
Click to expand...
Click to collapse
In LidroidSetting.apk\smali\com\lidroid\settings\statusbar\ PowerWidgetUtil.smali add this command to the end of the following method:
.method public static getButtons(Landroid/content/ContextLjava/util/HashMap;
Add the RED lines
Code:
const-string v6, "lidroid:drawable/stat_multiwindow_on"
invoke-direct {v3, v4, v5, v6}, Lcom/lidroid/settings/statusbar/PowerWidgetUtil$ButtonInfo;-><init>(Ljava/lang/String;ILjava/lang/String;)V
invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 189
:cond_18
[COLOR="DarkRed"] const-string v1, "toggleNetworkMode"
invoke-virtual {v0, v1, v7}, Lcom/lidroid/settings/Features;->has(Ljava/lang/String;Z)Z
move-result v1
if-eqz v1, :cond_mak
.line 186
sget-object v1, Lcom/lidroid/settings/statusbar/PowerWidgetUtil;->BUTTONS:Ljava/util/HashMap;
const-string v2, "toggleNetworkMode"
new-instance v3, Lcom/lidroid/settings/statusbar/PowerWidgetUtil$ButtonInfo;
const-string v4, "toggleNetworkMode"
const v5, 0x7f09009f
const-string v6, "lidroid:drawable/stat_gsm_on"
invoke-direct {v3, v4, v5, v6}, Lcom/lidroid/settings/statusbar/PowerWidgetUtil$ButtonInfo;-><init>(Ljava/lang/String;ILjava/lang/String;)V
invoke-virtual {v1, v2, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 190
:cond_mak[/COLOR]
sget-object v1, Lcom/lidroid/settings/statusbar/PowerWidgetUtil;->BUTTONS:Ljava/util/HashMap;
goto/16 :goto_0
.end method
If you have the lidroid of wanam, edit the smali NetworkModeButton.smali, replacing all the words "lidroid" with "wanam"
example:
Code:
Before:
.class public Lcom/lidroid/systemui/quickpanel/NetworkModeButton;
.super Lcom/lidroid/systemui/quickpanel/PowerButton;
Later:
.class public Lcom/wanam/systemui/quickpanel/NetworkModeButton;
.super Lcom/wanam/systemui/quickpanel/PowerButton;
hi please help
i can't do this changes to my rom
here is files you need
LGTeleService.apk
View attachment 4269150
the network toggle is here but don't work ( it can't change network )
i spend a lot of time , i hope some one can fix it
actually can't understand what should i do with lgteleservice.apk ( how to add toggles to this apk?) how to add this codes to lgteleservice?
sorry for my bad english
How to change jb lockscreen to this?
{
"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"
}
1. I want to remove white bounding box.
2. I want to move up the clock over widget boundary.
In ICS, there is a way to move clock upside.
By modifying keyguard_screen_unlock_portrait.xml file in framework-res.apk.
But in JB this method doesn't work well.
ps. I don't want to do this by 3rd party app like widget locker.
I may found a clue
I found a code about keyguard widget frame.
Code:
KeyguardWidgetFrame.java
public KeyguardWidgetFrame(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mLongPressHelper = new CheckLongPressHelper(this);
Resources res = context.getResources();
// TODO: this padding should really correspond to the padding embedded in the background
// drawable (ie. outlines).
float density = res.getDisplayMetrics().density;
int padding = (int) (res.getDisplayMetrics().density * 8);
setPadding(padding, padding, padding, padding);
mFrameStrokeAdjustment = 2 + (int) (2 * density);
// This will be overriden on phones based on the current security mode, however on tablets
// we need to specify a height.
mSmallWidgetHeight =
res.getDimensionPixelSize(com.android.internal.R.dimen.kg_small_widget_height);
mBackgroundDrawable = res.getDrawable(R.drawable.kg_widget_bg_padded);
mGradientColor = res.getColor(com.android.internal.R.color.kg_widget_pager_gradient);
mGradientPaint.setXfermode(sAddBlendMode);
}
If I can change following line or remove it. It will solve my problem.
setPadding(padding, padding, padding, padding);
I also decompiled android.policy.jar.
And found corresponding line.
Code:
.line 110
.local v1, padding:I
invoke-virtual {p0, v1, v1, v1, v1}, Lcom/android/internal/policy/impl/keyguard/KeyguardWidgetFrame;->setPadding(IIII)V
But I don't have knowledge of smali.
So how to manage that line?
Is is safe to remove or change to this?
invoke-virtual {p0, 0, 0, 0, 0}
I finally solved problem!
It took some hours to solve this.
So I put these information for someone who want to change JB lockscreen like me.
1. Increase widget maximum size.
Decompile framework-res.apk
In \res\layout-port\
Modify keyguard_widget_pager.xml
Change left, right, top padding and pageSpacing as follows.
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.internal.policy.impl.keyguard.KeyguardWidgetPager
android:id="@id/app_widget_container" android:paddingLeft="[COLOR="red"]0dip[/COLOR]"
android:paddingTop="[COLOR="red"]0dip[/COLOR]" android:paddingRight="[COLOR="Red"]0dip[/COLOR]"
android:paddingBottom="@dimen/kg_widget_pager_bottom_padding"
android:clipToPadding="false" android:pageSpacing="[COLOR="red"]0dip[/COLOR]"/>
2. Disable initial page hint
Decompile android.policy.jar
in com\android\internal\policy\impl\keyguard\KeyguardViewStateManager.smali
Remove following red string.
Code:
.method public showUsabilityHints()V
...
.line 307
iget-object v0, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardViewStateManager;->mKeyguardWidgetPager:Lcom/android/internal/policy/impl/keyguard/KeyguardWidgetPager;
[COLOR="Red"]invoke-virtual {v0}, Lcom/android/internal/policy/impl/keyguard/KeyguardWidgetPager;->showInitialPageHints()V[/COLOR]
...
.end method
3. Disable white box while scrolling
Decompile android.policy.jar
in com\android\internal\policy\impl\keyguard\
Modify KeyguardWidgetPager.smali
Change red string to green one as follows
Code:
.method animateOutlinesAndSidePages(ZI)V
...
.line 708
[COLOR="Red"].local v7, finalOutlineAlpha:F[/COLOR]
:goto_4e
invoke-virtual {v3, p0, p1, v7, p2}, Lcom/android/internal/policy/impl/keyguard/KeyguardWidgetFrame;->fadeFrame(Ljava/lang/Object;ZFI)V
...
.end method
Code:
.method animateOutlinesAndSidePages(ZI)V
...
.line 708
[COLOR="Lime"]const/4 v7, 0x0[/COLOR]
:goto_4e
invoke-virtual {v3, p0, p1, v7, p2}, Lcom/android/internal/policy/impl/keyguard/KeyguardWidgetFrame;->fadeFrame(Ljava/lang/Object;ZFI)V
...
.end method
4. Disable page hint when dragging beyond first or last page
Decompile android.policy.jar
in com\android\internal\policy\impl\keyguard\
Modify KeyguardWidgetPager.smali
Remove red string in the follwing.
Code:
.method protected screenScrolled(I)V
...
.line 533
invoke-static {v5}, Ljava/lang/Math;->abs(F)F
move-result v9
cmpg-float v7, v5, v10
if-gez v7, :cond_61
const/4 v7, 0x1
:goto_51
[COLOR="Red"]invoke-virtual {v6, v9, v7}, Lcom/android/internal/policy/impl/keyguard/KeyguardWidgetFrame;->setOverScrollAmount(FZ)V[/COLOR]
...
.end method
5. (similar to 4 but) Only disable white gradiant
Decompile android.policy.jar
in com\android\internal\policy\impl\keyguard\
Modify KeyguardWidgetFrame.smali
Change red string to green one.
Code:
.method setOverScrollAmount(FZ)V
...
.line 497
const/high16 v1, 0x3f00
mul-float/2addr v1, p1
const/high16 v2, 0x437f
mul-float/2addr v1, v2
[COLOR="Red"] invoke-static {v1}, Ljava/lang/Math;->round(F)I
move-result v1[/COLOR]
iput v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardWidgetFrame;->mForegroundAlpha:I
...
.end method
Code:
.method setOverScrollAmount(FZ)V
...
.line 497
const/high16 v1, 0x3f00
mul-float/2addr v1, p1
const/high16 v2, 0x437f
mul-float/2addr v1, v2
[COLOR="Lime"]const/4 v1, 0x0[/COLOR]
iput v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardWidgetFrame;->mForegroundAlpha:I
...
.end method
6. Only show bounding box boarder
In framework-res.apk
Modify kg_bouncer_bg_white.9.png as follows
xd123456ye said:
How to change jb lockscreen to this?
View attachment 1886054
1. I want to remove white bounding box.
2. I want to move up the clock over widget boundary.
In ICS, there is a way to move clock upside.
By modifying keyguard_screen_unlock_portrait.xml file in framework-res.apk.
But in JB this method doesn't work well.
ps. I don't want to do this by 3rd party app like widget locker.
Click to expand...
Click to collapse
hey bro nice job but one thing the clock icon , how can i make it small , mine is too big , i fllowed ur way and succesful but the lock ring icon get little in right sight of screen , is their any way to do ??
To arnabgharay
arnabgharay said:
hey bro nice job but one thing the clock icon , how can i make it small , mine is too big , i fllowed ur way and succesful but the lock ring icon get little in right sight of screen , is their any way to do ??
Click to expand...
Click to collapse
To arnabgharay
I'm not doing these things anymore.
And currently my phone is not jelly bean, I went back to ginger bread long time ago.
And I got a job, don't have time to do this, and I have no plan to do this.
Sorry.
Just in Case!!
These are smali edits I found or had help finding while converting my ASU theme to Android 4.3. I will be constantly updating this OP and hope that other folks will give me there smali finds to add to this guide. Please PM me with anything you would like to add. Feel free to use anything in this OP. You don't have to ask!!!
Please don't forget to thank Gunthermic, Naddict, Rompnit and Strongsteve for all there help as well!!!
SystemUI
1. Brightness slider color animation.
Go to SystemUI\smali\com\android\systemui\statusbar\Anim atedBrightnessIconView.smali
{
"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"
}
Look for:
.line 73
iget-object v0, p0, Lcom/android/systemui/statusbar/AnimatedBrightnessIconView;->mPaint:Landroid/graphics/Paint;
const v1, -0x3a1f17
Change -0x3a1f17 to your desired smali color code!!!!
SecMms Messaging
1. Changing text color when searching for a contact in SecMms Messaging
Go To: SecMms\smali\com\android\mms\ui\RecipientsAdapter.smali
Look For:
.line 342
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xff852e and change it to your desired smali color code.
Look For:
.line 359
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xff852e and change it to your desired smali color code.
Look For:
.line 373
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xff852e and change it to your desired smali color code.
Look For:
.line 344
.restart local v22 # "span":Landroid/text/Spannable;
:cond_d
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xcc4a16 and change it to your desired smali color code.
Look For:
.line 361
.restart local v22 # "span":Landroid/text/Spannable;
:cond_10
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xcc4a16 and change it to your desired smali color code.
Look For:
.line 375
.restart local v23 # "spanNameText":Landroid/text/Spannable;
.restart local v24 # "spanNumberText":Landroid/text/Spannable;
:cond_12
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xcc4a16 and change it to your desired smali color code.
Gmail 4.7.2 smali finds
Gmail send email to text color:
Go to:
Gmail-4.7.2\smali\com\android\ex\chips\RecipientEditTextView.smali
Find:
move-result-object v3
const v4, 0x106000c
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
invoke-virtual {v7, v3}, Landroid/text/TextPaint;->setColor(I)V
Insert: const v3, -0x4cf0 Of coarse changing -0x4cf0 to your smali text color code
move-result-object v3
const v4, 0x106000c
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
INSERT HERE
invoke-virtual {v7, v3}, Landroid/text/TextPaint;->setColor(I)V
So the finished product looks like this
move-result-object v3
const v4, 0x106000c
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
const v3, -0x4cf0
invoke-virtual {v7, v3}, Landroid/text/TextPaint;->setColor(I)V
Gmail list view email contents first line step one:
Go to:
Gmail-4.7.2-stock\smali\com\android\mail\browse\ConversationItemView.smali
Look for:
.line 421
new-instance v0, Landroid/text/style/ForegroundColorSpan;
const v3, 0x7f080029
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
invoke-direct {v0, v3}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
Insert this:
const v3, -0x66FFCD Changing -0x66ffcd to your favorite smali code
.line 421
new-instance v0, Landroid/text/style/ForegroundColorSpan;
const v3, 0x7f080029
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
INSERT HERE
invoke-direct {v0, v3}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
So the finished product looks like this
.line 421
new-instance v0, Landroid/text/style/ForegroundColorSpan;
const v3, 0x7f080029
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
const v3, -0x66FFCD
invoke-direct {v0, v3}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
Gmail list view email contents first line step two:
Go to
Gmail\smali\com\android\mail\browse\ConversationItemView.smali
Look for:
.line 1404
sget-object v0, Lcom/android/mail/browse/ConversationItemView;->aOX:Landroid/text/TextPaint;
iget-object v1, p0, Lcom/android/mail/browse/ConversationItemView;->aPi:Lcom/android/mail/browse/K;
iget-object v1, v1, Lcom/android/mail/browse/K;->GO:Lcom/android/mail/providers/Conversation;
iget v1, v1, Lcom/android/mail/providers/Conversation;->color:I
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V
.line 1405
Insert this:
const v0, -0x66ffcd Changing -0x66ffcd to your favorite smali code
.line 1404
sget-object v0, Lcom/android/mail/browse/ConversationItemView;->aOX:Landroid/text/TextPaint;
iget-object v1, p0, Lcom/android/mail/browse/ConversationItemView;->aPi:Lcom/android/mail/browse/K;
iget-object v1, v1, Lcom/android/mail/browse/K;->GO:Lcom/android/mail/providers/Conversation;
iget v1, v1, Lcom/android/mail/providers/Conversation;->color:I
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V
INSERT HERE
.line 1405
So the finished product looks like this:
.line 1404
sget-object v0, Lcom/android/mail/browse/ConversationItemView;->aOX:Landroid/text/TextPaint;
iget-object v1, p0, Lcom/android/mail/browse/ConversationItemView;->aPi:Lcom/android/mail/browse/K;
iget-object v1, v1, Lcom/android/mail/browse/K;->GO:Lcom/android/mail/providers/Conversation;
iget v1, v1, Lcom/android/mail/providers/Conversation;->color:I
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V
const v0, -0x66FFCD
.line 1405
Gmail open email inbox background and text color
Go to:
Gmail\smali\com\google\android\gm\utils\b.smali
Look for:
.line 82
new-array v0, v4, [Ljava/lang/String;
const-string v1, "#dddddd" This is the background color
aput-object v1, v0, v5
const-string v1, "#777777" This is the text color
aput-object v1, v0, v6
Change hex color codes to your favorite color.
SamsungIME Keyboard Swipe Color:
Please see Gunthermic's thread http://forum.xda-developers.com/showthread.php?t=2569480
Calendar Year Tab horizontal line under month
Go to:
\Calendar\smali\com\android\calendar\month\YearView.smali
Look for:
.line 1021
const v1, -0xb4b4b5
invoke-virtual {v6, v1}, Landroid/graphics/Paint;->setColor(I)V
and
.line 1027
:cond_b
const v1, -0xb4b4b5
invoke-virtual {v6, v1}, Landroid/graphics/Paint;->setColor(I)V
Change -0xb4b4b5 to your favorite smali color code
Change text color in day and week events Calendar
Go to:
Calendar\smali\com\android\calendar\timeline\DayLayout$DayEventAdapter$2.smali
Look for:
.line 962
.end local v0 # "paintFlag":I
:cond_2
iget-object v3, p0, Lcom/android/calendar/timeline/DayLayout$DayEventAdapter$2;->val$holder:Lcom/android/calendar/timeline/DayLayout$ViewHolder;
iget-object v3, v3, Lcom/android/calendar/timeline/DayLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v5, -0x1000000
invoke-virtual {v3, v5}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v5, -0x1000000 to const v3, -0x1000000 then change -0x1000000 to your favorite smali color code.
Go to:
Calendar\smali\com\android\calendar\timeline\DayLayout$DayEventAdapter.smali
Look for:
.line 1007
iget-object v6, p2, Lcom/android/calendar/timeline/DayLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v7, -0x1000000
invoke-virtual {v6, v7}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v7, -0x1000000 to const v7, -0x1000000 then change -0x1000000 to your favorite smali color code
Look for:
.line 940
:cond_8
iget-object v3, p2, Lcom/android/calendar/timeline/DayLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v4, -0x1000000
invoke-virtual {v3, v4}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v4, -0x1000000 to const v4, -0x1000000 then change -0x1000000 to your favorite smali color code
Go to:
Calendar\smali\com\android\calendar\timeline\EventListWithStartTime.smali
Look for:
.line 107
iget-object v1, p0, Lcom/android/calendar/timeline/EventListWithStartTime;->mListView:Landroid/widget/ListView;
new-instance v2, Landroid/graphics/drawable/ColorDrawable;
const/high16 v3, -0x1000000
invoke-direct {v2, v3}, Landroid/graphics/drawable/ColorDrawable;-><init>(I)V
Change const/high16 v3, -0x1000000 to const v3, -0x1000000 then change -0x100000 to your favorite smali color code
Go to:
Calendar\smali\com\android\calendar\timeline\WeekLayout$WeekEventAdapter.smali
Look for:
.line 1342
iget-object v6, p2, Lcom/android/calendar/timeline/WeekLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v7, -0x1000000
invoke-virtual {v6, v7}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v7, -0x1000000 to const v7, -0x1000000 then change -0x1000000 to your favorite smali color code
Look for:
.line 1299
:goto_4
iget-object v2, p2, Lcom/android/calendar/timeline/WeekLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v3, -0x1000000
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v3, -0x1000000 to const v3, -0x1000000 then change -0x1000000 to your favorite smali color code
Mine
Nice finds bud, very neat
I need one too!! Nice EMS! :highfive:
Nice to see someone take time to put it together.
I see a lot of smali edits I have been using for a while. Just never have time to write it all down,...
Reserved, cuz I do a ton of smali edits....
There goes all my trade secrets..lol
strongsteve said:
There goes all my trade secrets..lol
Click to expand...
Click to collapse
Yup... once released in an apk.. all free game.. hahaha.
You have no stinking secrets... I am Robocop.. put down your smali...
thanks
EMSpilot said:
These are smali edits I found or had help finding while converting my ASU theme to Android 4.3. I will be constantly updating this OP and hope that other folks will give me there smali finds to add to this guide. Please PM me with anything you would like to add. Feel free to use anything in this OP. You don't have to ask!!!
Please don't forget to thank Gunthermic, Naddict, Rompnit and Strongsteve for all there help as well!!!
SystemUI
1. Brightness slider color animation.
Go to SystemUI\smali\com\android\systemui\statusbar\Anim atedBrightnessIconView.smali
Look for:
.line 73
iget-object v0, p0, Lcom/android/systemui/statusbar/AnimatedBrightnessIconView;->mPaint:Landroid/graphics/Paint;
const v1, -0x3a1f17
Change -0x3a1f17 to your desired smali color code!!!!
SecMms Messaging
1. Changing text color when searching for a contact in SecMms Messaging
Go To: SecMms\smali\com\android\mms\ui\RecipientsAdapter.smali
Look For:
.line 342
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xff852e and change it to your desired smali color code.
Look For:
.line 359
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xff852e and change it to your desired smali color code.
Look For:
.line 373
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xff852e and change it to your desired smali color code.
Look For:
.line 344
.restart local v22 # "span":Landroid/text/Spannable;
:cond_d
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xcc4a16 and change it to your desired smali color code.
Look For:
.line 361
.restart local v22 # "span":Landroid/text/Spannable;
:cond_10
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xcc4a16 and change it to your desired smali color code.
Look For:
.line 375
.restart local v23 # "spanNameText":Landroid/text/Spannable;
.restart local v24 # "spanNumberText":Landroid/text/Spannable;
:cond_12
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xcc4a16 and change it to your desired smali color code.
Gmail 4.7.2 smali finds
Gmail send email to text color:
Go to:
Gmail-4.7.2\smali\com\android\ex\chips\RecipientEditTextView.smali
Find:
move-result-object v3
const v4, 0x106000c
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
invoke-virtual {v7, v3}, Landroid/text/TextPaint;->setColor(I)V
Insert: const v3, -0x4cf0 Of coarse changing -0x4cf0 to your smali text color code
move-result-object v3
const v4, 0x106000c
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
INSERT HERE
invoke-virtual {v7, v3}, Landroid/text/TextPaint;->setColor(I)V
So the finished product looks like this
move-result-object v3
const v4, 0x106000c
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
const v3, -0x4cf0
invoke-virtual {v7, v3}, Landroid/text/TextPaint;->setColor(I)V
Gmail list view email contents first line step one:
Go to:
Gmail-4.7.2-stock\smali\com\android\mail\browse\ConversationItemView.smali
Look for:
.line 421
new-instance v0, Landroid/text/style/ForegroundColorSpan;
const v3, 0x7f080029
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
invoke-direct {v0, v3}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
Insert this:
const v3, -0x66FFCD Changing -0x66ffcd to your favorite smali code
.line 421
new-instance v0, Landroid/text/style/ForegroundColorSpan;
const v3, 0x7f080029
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
INSERT HERE
invoke-direct {v0, v3}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
So the finished product looks like this
.line 421
new-instance v0, Landroid/text/style/ForegroundColorSpan;
const v3, 0x7f080029
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
const v3, -0x66FFCD
invoke-direct {v0, v3}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
Gmail list view email contents first line step two:
Go to
Gmail\smali\com\android\mail\browse\ConversationItemView.smali
Look for:
.line 1404
sget-object v0, Lcom/android/mail/browse/ConversationItemView;->aOX:Landroid/text/TextPaint;
iget-object v1, p0, Lcom/android/mail/browse/ConversationItemView;->aPi:Lcom/android/mail/browse/K;
iget-object v1, v1, Lcom/android/mail/browse/K;->GO:Lcom/android/mail/providers/Conversation;
iget v1, v1, Lcom/android/mail/providers/Conversation;->color:I
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V
.line 1405
Insert this:
const v0, -0x66ffcd Changing -0x66ffcd to your favorite smali code
.line 1404
sget-object v0, Lcom/android/mail/browse/ConversationItemView;->aOX:Landroid/text/TextPaint;
iget-object v1, p0, Lcom/android/mail/browse/ConversationItemView;->aPi:Lcom/android/mail/browse/K;
iget-object v1, v1, Lcom/android/mail/browse/K;->GO:Lcom/android/mail/providers/Conversation;
iget v1, v1, Lcom/android/mail/providers/Conversation;->color:I
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V
INSERT HERE
.line 1405
So the finished product looks like this:
.line 1404
sget-object v0, Lcom/android/mail/browse/ConversationItemView;->aOX:Landroid/text/TextPaint;
iget-object v1, p0, Lcom/android/mail/browse/ConversationItemView;->aPi:Lcom/android/mail/browse/K;
iget-object v1, v1, Lcom/android/mail/browse/K;->GO:Lcom/android/mail/providers/Conversation;
iget v1, v1, Lcom/android/mail/providers/Conversation;->color:I
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V
const v0, -0x66FFCD
.line 1405
Gmail open email inbox background and text color
Go to:
Gmail\smali\com\google\android\gm\utils\b.smali
Look for:
.line 82
new-array v0, v4, [Ljava/lang/String;
const-string v1, "#dddddd" This is the background color
aput-object v1, v0, v5
const-string v1, "#777777" This is the text color
aput-object v1, v0, v6
Change hex color codes to your favorite color.
SamsungIME Keyboard Swipe Color:
Please see Gunthermic's thread http://forum.xda-developers.com/showthread.php?t=2569480
Calendar Year Tab horizontal line under month
Go to:
\Calendar\smali\com\android\calendar\month\YearView.smali
Look for:
.line 1021
const v1, -0xb4b4b5
invoke-virtual {v6, v1}, Landroid/graphics/Paint;->setColor(I)V
and
.line 1027
:cond_b
const v1, -0xb4b4b5
invoke-virtual {v6, v1}, Landroid/graphics/Paint;->setColor(I)V
Change -0xb4b4b5 to your favorite smali color code
Change text color in day and week events Calendar
Go to:
Calendar\smali\com\android\calendar\timeline\DayLayout$DayEventAdapter$2.smali
Look for:
.line 962
.end local v0 # "paintFlag":I
:cond_2
iget-object v3, p0, Lcom/android/calendar/timeline/DayLayout$DayEventAdapter$2;->val$holder:Lcom/android/calendar/timeline/DayLayout$ViewHolder;
iget-object v3, v3, Lcom/android/calendar/timeline/DayLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v5, -0x1000000
invoke-virtual {v3, v5}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v5, -0x1000000 to const v3, -0x1000000 then change -0x1000000 to your favorite smali color code.
Go to:
Calendar\smali\com\android\calendar\timeline\DayLayout$DayEventAdapter.smali
Look for:
.line 1007
iget-object v6, p2, Lcom/android/calendar/timeline/DayLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v7, -0x1000000
invoke-virtual {v6, v7}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v7, -0x1000000 to const v7, -0x1000000 then change -0x1000000 to your favorite smali color code
Look for:
.line 940
:cond_8
iget-object v3, p2, Lcom/android/calendar/timeline/DayLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v4, -0x1000000
invoke-virtual {v3, v4}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v4, -0x1000000 to const v4, -0x1000000 then change -0x1000000 to your favorite smali color code
Go to:
Calendar\smali\com\android\calendar\timeline\EventListWithStartTime.smali
Look for:
.line 107
iget-object v1, p0, Lcom/android/calendar/timeline/EventListWithStartTime;->mListView:Landroid/widget/ListView;
new-instance v2, Landroid/graphics/drawable/ColorDrawable;
const/high16 v3, -0x1000000
invoke-direct {v2, v3}, Landroid/graphics/drawable/ColorDrawable;-><init>(I)V
Change const/high16 v3, -0x1000000 to const v3, -0x1000000 then change -0x100000 to your favorite smali color code
Go to:
Calendar\smali\com\android\calendar\timeline\WeekLayout$WeekEventAdapter.smali
Look for:
.line 1342
iget-object v6, p2, Lcom/android/calendar/timeline/WeekLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v7, -0x1000000
invoke-virtual {v6, v7}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v7, -0x1000000 to const v7, -0x1000000 then change -0x1000000 to your favorite smali color code
Look for:
.line 1299
:goto_4
iget-object v2, p2, Lcom/android/calendar/timeline/WeekLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v3, -0x1000000
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v3, -0x1000000 to const v3, -0x1000000 then change -0x1000000 to your favorite smali color code
Click to expand...
Click to collapse
please help me sir
kahvitahra said:
Samsung JB roms
What you need to do is:
-Decompile android.policy.jar of your rom
-Copy attached JB folder to yours (POST 1)
-In file "GlobalActions$99.smali" there is id 0x1110008, you might want to check that this id is same in you roms puplic.xml ( config_sf_slowBlur ).
( check also that ids 0x104000a = "ok" -string and 0x104 = "cancel" -string matches in your framework. )
-Open GlobalActions.smali
-Search line "new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$5;" ( some roms might have different number on reboot button. You find right one by for example tracking mRestart. See example below. )
-Change number 5 to 99 ( two of them )
Before
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$5;
const v1, 0x1080640
const v2, 0x1040165
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$5;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
After
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$99;
const v1, 0x1080640
const v2, 0x1040165
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$99;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
-Open GlobalActions$SinglePressAction.smali
-Before line "# instance fields"
paste following code
Code:
# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;
-Then after line "# direct methods"
paste following code
Code:
.method static constructor <clinit>()V
.registers 3
const/4 v0, 0x4
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Reboot"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x3
const-string v2, "Recovery"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method
-So your file should look something like this after those changes
Code:
.class abstract Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.super Ljava/lang/Object;
.source "GlobalActions.java"
# interfaces
.implements Lcom/android/internal/policy/impl/GlobalActions$Action;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/GlobalActions;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x40a
name = "SinglePressAction"
.end annotation
# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;
# instance fields
.field private final mIconResId:I
.field private final mMessageResId:I
# direct methods
.method static constructor <clinit>()V
.registers 3
const/4 v0, 0x4
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Reboot"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x3
const-string v2, "Recovery"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method
.method protected constructor <init>(II)V
.registers 3
.parameter "iconResId"
.........
.........
-Compile .jar and your done.
{
"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"
}
Click to expand...
Click to collapse
Note : This is not my work..I'm just sharing the work of the XDA Member kahvitahra :
Original Thread - http://forum.xda-developers.com/showpost.php?p=38379872&postcount=184
Batt. %
ImBJ said:
original thread - http://forum.xda-developers.com/show...&postcount=184 Samsung JB roms
What you need to do is:
-Decompile android.policy.jar of your rom
-Copy attached JB folder to yours (POST 1)
-In file "GlobalActions$99.smali" there is id 0x1110008, you might want to check that this id is same in you roms puplic.xml ( config_sf_slowBlur ).
( check also that ids 0x104000a = "ok" -string and 0x104 = "cancel" -string matches in your framework. )
-Open GlobalActions.smali
-Search line "new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$5;" ( some roms might have different number on reboot button. You find right one by for example tracking mRestart. See example below. )
-Change number 5 to 99 ( two of them )
Before
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$5;
const v1, 0x1080640
const v2, 0x1040165
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$5;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
After
Code:
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$99;
const v1, 0x1080640
const v2, 0x1040165
invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$99;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mRestart:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
-Open GlobalActions$SinglePressAction.smali
-Before line "# instance fields"
paste following code
Code:
# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;
-Then after line "# direct methods"
paste following code
Code:
.method static constructor <clinit>()V
.registers 3
const/4 v0, 0x4
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Reboot"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x3
const-string v2, "Recovery"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method
-So your file should look something like this after those changes
Code:
.class abstract Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;
.super Ljava/lang/Object;
.source "GlobalActions.java"
# interfaces
.implements Lcom/android/internal/policy/impl/GlobalActions$Action;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/GlobalActions;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x40a
name = "SinglePressAction"
.end annotation
# static fields
.field protected static rebootMode:I
.field protected static final rebootOptions:[Ljava/lang/String;
# instance fields
.field private final mIconResId:I
.field private final mMessageResId:I
# direct methods
.method static constructor <clinit>()V
.registers 3
const/4 v0, 0x4
new-array v0, v0, [Ljava/lang/String;
const/4 v1, 0x0
const-string v2, "Reboot"
aput-object v2, v0, v1
const/4 v1, 0x1
const-string v2, "Hot Boot"
aput-object v2, v0, v1
const/4 v1, 0x2
const-string v2, "Download"
aput-object v2, v0, v1
const/4 v1, 0x3
const-string v2, "Recovery"
aput-object v2, v0, v1
sput-object v0, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
return-void
.end method
.method protected constructor <init>(II)V
.registers 3
.parameter "iconResId"
.........
.........
-Compile .jar and your done.
Click to expand...
Click to collapse
[/QUOTE]
Are the screen shots of sg star??? If yes how did u enabled battery percentage????
deleted
Are the screen shots of sg star??? If yes how did u enabled battery percentage????[/QUOTE]
its galaxy young !! i'll post the tutorial for battery percentage later..
U can also do this using xposed module xblast tools
Sent from my GT-S5282 using Tapatalk
T3snake said:
U can also do this using xposed module xblast tools
Sent from my GT-S5282 using Tapatalk
Click to expand...
Click to collapse
i agree !! but this is for custom roms !! so people can have it without xblast tool !!
nice tut thank bro for this mod
Are the screen shots of sg star??? If yes how did u enabled battery percentage????[/QUOTE]
charging lol