[GUIDE][CM11] How Change Theme Accent Color in XPERIA STOCK APP - Android Themes

*********RXS DEV TEAM Presents*********
Hello
We'll show you how to edit almost all applications Xperia, so to work with stock engine CM11 Theme
I'll show you how to change Xperia Theme accent color:
-somc_theme_accent_color_light
-somc_theme_accent_color_dark
-somc_accent_color_neutral
-semc_theme_accent_color
To stock CM11 theme engine colors:
-holo_blue_light
-holo_blue_dark
This Guide is for experienced themers !!!!
What we need:
-Apktool
-Notepad++
-Any file manager
-Xperia app running on your device With CM11 Rom
I use an application running on my ARC on LegacyXperia Cm11 build 906
Linki:
Z2 Home and widget: Z2 Home and Widget
Creadits RXS DEV TEAM
Here we go:
Decompile Z2 Home and Widget working on your Cm11
HOME.apk
-Find smili file : ThemeUtils.smali
smali\com\sonymobile\home\runtimeskinning\
-Open with Notepad++
Find this lines:
Code:
.line 36
.local v3, "themeColor":I
const-string v4, "somc_theme_accent_color_dark"
const-string v5, "color"
const-string v6, "com.sonyericsson.uxp"
invoke-virtual {v2, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v0
.line 38
.local v0, "colorId":I
if-nez v0, :cond_0
.line 40
const-string v4, "semc_theme_accent_color"
const-string v5, "color"
const-string v6, "com.sonyericsson.uxp"
invoke-virtual {v2, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v0
Change Code:
"somc_theme_accent_color_dark" to this "holo_blue_dark"
"semc_theme_accent_color" to this "holo_blue_dark"
"com.sonyericsson.uxp" to this "android"
SAVE FILE
CLOCK WIDGET
-Find file : Utils.smali
smali\com\sonyericsson\advancedwidget\clock\
-Open with Notepad++
-Find this lines:
Code:
.line 66
const-string v4, "somc_accent_color_neutral"
const-string v5, "color"
const-string v6, "com.sonyericsson.uxp"
invoke-virtual {p0, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v4
const-string v4, "somc_theme_accent_color_light"
const-string v5, "color"
const-string v6, "com.sonyericsson.uxp"
invoke-virtual {p0, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v4
Change Code:
"somc_accent_color_neutral" to this "holo_blue_light"
"somc_theme_accent_color_light" to this "holo_blue_light"
"com.sonyericsson.uxp" to this "android"
SAVE FILE
MUSIC WIDGET
Find file : Util.smali
smali\com\sonymobile\advancedwidget\util\
-Open with Notepad++
Find this lines:
Code:
.line 72
const-string v4, "somc_accent_color_neutral"
const-string v5, "color"
const-string v6, "com.sonyericsson.uxp"
invoke-virtual {p0, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v4
.line 78
const-string v4, "somc_theme_accent_color_light"
const-string v5, "color"
const-string v6, "com.sonyericsson.uxp"
invoke-virtual {p0, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v4
Change Code:
"somc_accent_color_neutral" to this "holo_blue_light"
"somc_theme_accent_color_light" to this "holo_blue_light"
"com.sonyericsson.uxp" to this "android"
SAVE FILE
TOP Contact WIDGET
Find file : TopContactsUtils.smali
smali\com\sonymobile\advancedwidget\topcontacts\
-Open with Notepad++
Find this lines:
Code:
.line 262
const-string v4, "somc_accent_color_neutral"
const-string v5, "color"
const-string v6, "com.sonyericsson.uxp"
invoke-virtual {p0, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v4
.line 268
const-string v4, "somc_theme_accent_color_light"
const-string v5, "color"
const-string v6, "com.sonyericsson.uxp"
invoke-virtual {p0, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v4
Change Code:
"somc_accent_color_neutral" to this "holo_blue_light"
"somc_theme_accent_color_light" to this "holo_blue_light"
"com.sonyericsson.uxp" to this "android"
SAVE FILE
World Clock WIDGET
Find file : ColorizeUtils.smali
\smali\com\sonymobile\advancedwidget\util\
-Open with Notepad++
Find this lines:
Code:
line 53
const-string v4, "somc_accent_color_neutral"
const-string v5, "color"
const-string v6, "com.sonyericsson.uxp"
invoke-virtual {p0, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v4
.line 59
const-string v4, "somc_theme_accent_color_light"
const-string v5, "color"
const-string v6, "com.sonyericsson.uxp"
invoke-virtual {p0, v4, v5, v6}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v4
Change Code:
"somc_accent_color_neutral" to this "holo_blue_light"
"somc_theme_accent_color_light" to this "holo_blue_light"
"com.sonyericsson.uxp" to this "android"
SAVE FILE
RECOMPILE ALL APPS
Copy applications in the right places and Done
You now have the Xperia apps changing accent color According holo_blue_light and holo_blue_dark
Of course, not all app can thus modify. Sometimes a person making the Port of APP to CM11 can delete these lines in smili files
The color codes and packages can be in different places, depending on the device and Rom
You should then find these lines in the files smili
const-string v4, "holo_blue_light" This line represents the value in the file color.xml
const-string v5, "color"
const-string v6, "android" This value is the name of the package that contains the file color.xml
"android" is the name of the package framework-res.apk
More Apps Soon Greetings RXS DEV TEAM
BEFORE:
{
"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"
}
AFTER:

1. Decompile Z3 Calendar working on your Cm11
SemcCalendar.apk
2. Find smili file : ThemeFinder.smali
smali\android\util\
3. Open with Notepad++
Find this lines:
Code:
.method public static getColor(Landroid/content/res/Resources;)I
.locals 6
.param p0, "res" # Landroid/content/res/Resources;
.prologue
.line 63
const-string v3, "somc_theme_accent_color_light"
const-string v4, "color"
const-string v5, "com.sonyericsson.uxp"
invoke-virtual {p0, v3, v4, v5}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v1
.line 67
.end local v0 # "accentColor":I
.end local v2 # "themeColors":[I
:cond_2
const-string v3, "semc_theme_accent_color"
const-string v4, "color"
const-string v5, "com.sonyericsson.uxp"
invoke-virtual {p0, v3, v4, v5}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v1
goto :goto_0
.end method
Change Code:
"somc_theme_accent_color_light" to this "holo_blue_light"
"semc_theme_accent_color" to this "holo_blue_light"
"com.sonyericsson.uxp" to this "android"
SAVE FILE
Recompile
Before:
After:

reserved

Related

[mod/source] show full kernel version & add "mod" version to settings

Hey again,
So after playing with the gingerbread leak, and seeing that samsung decided (so far, at least) to show the full kernel version in the "About Phone" menu in settings, I decided to fix it on normal vibrant froyo roms.
{
"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"
}
At the same time, I also added the CM style "mod version" string. Someone else (I forget who and when, and I sincerely apologize for that) attempted this before, but I don't know if they didn't finish, or if it just never took off, but regardless, I decided to add it too, lol. For developers, all you need to add to your build.prop is:
Code:
ro.modversion=Bionix-1.2.1
Obviously replace everything after the = with your personal mod version.
Anyway, to show the full kernel version string:
Decompile Settings.apk, open /smali/com/android/settings/DeviceInfoSettings.smali and replace the entire method "getFormattedKernelVersion" with the following code:
Code:
.method private getFormattedKernelVersion()Ljava/lang/String;
.locals 11
.prologue
const/4 v8, 0x4
const-string v6, "\n"
const-string v10, "Unavailable"
const-string v9, "DeviceInfoSettings"
:try_start_0
new-instance v5, Ljava/io/BufferedReader;
new-instance v6, Ljava/io/FileReader;
const-string v7, "/proc/version"
invoke-direct {v6, v7}, Ljava/io/FileReader;-><init>(Ljava/lang/String;)V
const/16 v7, 0x100
invoke-direct {v5, v6, v7}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;I)V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.local v5, reader:Ljava/io/BufferedReader;
:try_start_1
invoke-virtual {v5}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
move-result-object v4
.local v4, procVersionStr:Ljava/lang/String;
:try_start_2
invoke-virtual {v5}, Ljava/io/BufferedReader;->close()V
const-string v0, "\\w+\\s+\\w+\\s+([^\\s]+)\\s+\\(([^\\[email protected]]+(?:@[^\\s.]+)?)[^)]*\\)\\s+\\((?:[^(]*\\([^)]*\\))?[^)]*\\)\\s+([^\\s]+)\\s+(?:PREEMPT\\s+)?(.+)"
.local v0, PROC_VERSION_REGEX:Ljava/lang/String;
const-string v6, "\\w+\\s+\\w+\\s+([^\\s]+)\\s+\\(([^\\[email protected]]+(?:@[^\\s.]+)?)[^)]*\\)\\s+\\((?:[^(]*\\([^)]*\\))?[^)]*\\)\\s+([^\\s]+)\\s+(?:PREEMPT\\s+)?(.+)"
invoke-static {v6}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
move-result-object v3
.local v3, p:Ljava/util/regex/Pattern;
invoke-virtual {v3, v4}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
move-result-object v2
.local v2, m:Ljava/util/regex/Matcher;
invoke-virtual {v2}, Ljava/util/regex/Matcher;->matches()Z
move-result v6
if-nez v6, :cond_0
const-string v6, "DeviceInfoSettings"
new-instance v7, Ljava/lang/StringBuilder;
invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
const-string v8, "Regex did not match on /proc/version: "
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v7, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v7
invoke-static {v6, v7}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
const-string v6, "Unavailable"
move-object v6, v10
.end local v0 #PROC_VERSION_REGEX:Ljava/lang/String;
.end local v2 #m:Ljava/util/regex/Matcher;
.end local v3 #p:Ljava/util/regex/Pattern;
.end local v4 #procVersionStr:Ljava/lang/String;
.end local v5 #reader:Ljava/io/BufferedReader;
:goto_0
return-object v6
.restart local v5 #reader:Ljava/io/BufferedReader;
:catchall_0
move-exception v6
invoke-virtual {v5}, Ljava/io/BufferedReader;->close()V
throw v6
:try_end_2
.catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0
.end local v5 #reader:Ljava/io/BufferedReader;
:catch_0
move-exception v6
move-object v1, v6
.local v1, e:Ljava/io/IOException;
const-string v6, "DeviceInfoSettings"
const-string v6, "IO Exception when getting kernel version for Device Info screen"
invoke-static {v9, v6, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
const-string v6, "Unavailable"
move-object v6, v10
goto :goto_0
.end local v1 #e:Ljava/io/IOException;
.restart local v0 #PROC_VERSION_REGEX:Ljava/lang/String;
.restart local v2 #m:Ljava/util/regex/Matcher;
.restart local v3 #p:Ljava/util/regex/Pattern;
.restart local v4 #procVersionStr:Ljava/lang/String;
.restart local v5 #reader:Ljava/io/BufferedReader;
:cond_0
:try_start_3
invoke-virtual {v2}, Ljava/util/regex/Matcher;->groupCount()I
move-result v6
if-ge v6, v8, :cond_1
const-string v6, "DeviceInfoSettings"
new-instance v7, Ljava/lang/StringBuilder;
invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
const-string v8, "Regex match on /proc/version only returned "
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v2}, Ljava/util/regex/Matcher;->groupCount()I
move-result v8
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v7
const-string v8, " groups"
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v7
invoke-static {v6, v7}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
const-string v6, "Unavailable"
move-object v6, v10
goto :goto_0
:cond_1
new-instance v6, Ljava/lang/StringBuilder;
const/4 v7, 0x1
invoke-virtual {v2, v7}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
move-result-object v7
invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
const-string v7, "\n"
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const/4 v7, 0x2
invoke-virtual {v2, v7}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
move-result-object v7
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const-string v7, " "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const/4 v7, 0x3
invoke-virtual {v2, v7}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
move-result-object v7
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const-string v7, "\n"
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const/4 v7, 0x4
invoke-virtual {v2, v7}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
move-result-object v7
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
:try_end_3
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_0
move-result-object v6
goto :goto_0
.end method
Then to add "Mod version" further down in the file, search for the following lines:
Code:
.line 74
const-string v2, "kernel_version"
invoke-virtual {p0, v2}, Lcom/android/settings/DeviceInfoSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
invoke-direct {p0}, Lcom/android/settings/DeviceInfoSettings;->getFormattedKernelVersion()Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
.line 77
and before the .line 77 add the following:
Code:
const-string v2, "mod_version"
const-string v3, "ro.modversion"
invoke-direct {p0, v2, v3}, Lcom/android/settings/DeviceInfoSettings;->setValueSummary(Ljava/lang/String;Ljava/lang/String;)V
Then add or change the following to /res/xml/device_info_settings.xml
(I removed the "style="?androidreferenceInformationStyle" />" after Kernel version to ensure that it shows all three lines, since preferenceInformationStyle truncates at 2 lines by default)
Code:
<Preference android:title="@string/kernel_version" android:key="kernel_version" android:summary="@string/device_info_default" />
<Preference android:title="@string/mod_version" android:key="mod_version" android:summary="@string/mod_version_default" style="?android:preferenceInformationStyle" />
and for the mod version, add the following to /res/values/strings.xml
Code:
<string name="mod_version">Mod version</string>
<string name="mod_version_default">Unknown</string>
and finally, declare the strings in /res/values/public.xml
Code:
<public type="string" name="mod_version" id="0x7f090639" />
<public type="string" name="mod_version_default" id="0x7f09063a" />
Please note, you might need to increment/decrement the last digit or two to fit with any other mods already present in your Settings.apk.
UPDATE!
Attached to this post is Settings.apk for Bionix-v 1.3.1 already modified to show the long kernel version, and mod version. This should work on any other rom that includes my user-selectable am/pm mod, but its untested on anything other than bionix. And please note, mod version will be "unknown" unless you edit your build.prop yourself to reflect the real build number, and mod version.
Cheers everyone, =)
Nice
Sent from my SGH-T959 using XDA App
thanks for sharing this, its nice to see developers sharing source here in this forum instead of just compiled binaries
Jocey...
This is really good work!!!
Girl, you are freaking smart!!!!
All XDA App Users Rock Tapatalkie!!
sw33t! thanks again!!!
Wow, great work!
Check your pm's
Hi Jocelyn,
installed the settings.apk, I don't see the kernel version in the about phone.
I am using kernel with the honeycomb logo
something was up with my source. thanks for fixing it

[MOD][HOWTO][JB]Add quad lockscreen to any stock based JB rom. **UPDATED**

This howto will teach you how to add a quad lockscreen with phone and messaging to any jb rom in 2 ways:
[SMALI]: you're going to modify already compiled files, you will need a basic knowledge about decompiling/recompiling/editing jar, apk and smali files.
[JAVA]: you're going to modify the JB source code, you will need a basic knowledge about java and how to compile an AOSP.
Choose your path and always follow the instuction with that tag.
framework resources editing:
[SMALI]
Decompile your framework-res.apk
Put ic_lockscreen_phone_activated.png, ic_lockscreen_phone_normal.png, ic_lockscreen_sms_activated.png, ic_lockscreen_sms_normal.png in /res/drawable-hdpi/
[JAVA]
Put ic_lockscreen_phone_activated.png, ic_lockscreen_phone_normal.png, ic_lockscreen_sms_activated.png, ic_lockscreen_sms_normal.png in /frameworks/base/core/res/res/drawable-hdpi/
[SMALI]
Put ic_lockscreen_phone.xml, ic_lockscreen_sms.xml in /res/drawable/
[JAVA]
Put ic_lockscreen_phone.xml, ic_lockscreen_sms.xml in /frameworks/base/core/res/res/drawable/
Add the necessary entries in /frameworks/base/core/res/res/values/public.xml:
Code:
<java-symbol type="drawable" name="ic_lockscreen_sms" />
<java-symbol type="drawable" name="ic_lockscreen_phone" />
[SMALI]
Open /res/values/arrays.xml
[JAVA]
Open /frameworks/base/core/res/res/values/arrays.xml
[SMALI]/[JAVA]
Replace the whole array <array name="lockscreen_targets_with_camera"> .. </array> with:
Code:
<array name="lockscreen_targets_with_camera">
<item>@drawable/ic_lockscreen_unlock</item>
<item>@drawable/ic_lockscreen_sms</item>
<item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_phone</item>
<item>@drawable/ic_lockscreen_camera</item>
<item>@null</item>
<item>@null</item>
<item>@null</item>
</array>
Replace the whole array <array name="lockscreen_target_descriptions_with_camera"> .. </array> with:
Code:
<array name="lockscreen_target_descriptions_with_camera">
<item>@string/description_target_unlock</item>
<item>@string/description_target_sms</item>
<item>@string/description_target_search</item>
<item>@string/description_target_phone</item>
<item>@string/description_target_camera</item>
<item>@null</item>
<item>@null</item>
<item>@null</item>
</array>
[SMALI]
Open /res/values-land/arrays.xml
[JAVA]
Open /frameworks/base/core/res/res/values-land/arrays.xml
[SMALI]/[JAVA]
Replace the whole array <array name="lockscreen_targets_with_camera"> .. </array> with:
Code:
<array name="lockscreen_targets_with_camera">
<item>@null</item>
<item>@null</item>
<item>@drawable/ic_lockscreen_unlock</item>
<item>@drawable/ic_lockscreen_sms</item>
<item>@drawable/ic_action_assist_generic</item>
<item>@drawable/ic_lockscreen_phone</item>
<item>@drawable/ic_lockscreen_camera</item>
<item>@null</item>
</array>
Replace the whole array <array name="lockscreen_target_descriptions_with_camera"> .. </array> with:
Code:
<array name="lockscreen_target_descriptions_with_camera">
<item>@null</item>
<item>@null</item>
<item>@string/description_target_unlock</item>
<item>@string/description_target_sms</item>
<item>@string/description_target_search</item>
<item>@string/description_target_phone</item>
<item>@string/description_target_camera</item>
<item>@null</item>
</array>
[SMALI]
Open /res/values/strings.xml
[JAVA]
Open /frameworks/base/core/res/res/values/strings.xml
[SMALI]/[JAVA]
Add the following entries:
Code:
<string name="description_target_sms">Sms</string>
<string name="description_target_phone">Phone</string>
[SMALI]
Recompile your framework. Then decompile the new one and write down the addresses of the following resources in /res/values/pubblic.xml:
Code:
ic_action_assist_generic
ic_lockscreen_camera
ic_lockscreen_silent
ic_lockscreen_unlock
ic_lockscreen_unlock_phantom
ic_lockscreen_phone
ic_lockscreen_sms
framework editing: ***UPDATED***
[JAVA]
Edit /frameworks/base/core/java/com/android/internal/widget/multiwaveview/GlowPadView.java
Code:
- return mTargetDescriptions.get(index);
+ String targetZ = "";
+ try {
+ targetZ = mTargetDescriptions.get(index);
+ } catch (Exception e) {
+ }
+ return targetZ;
Code:
- return mDirectionDescriptions.get(index);
+ try {
+ String directionZ = mDirectionDescriptions.get(index);
+ return directionZ;
+ } catch (Exception e) {
+ return "";
+ }
[SMALI]
Disassemble your framework.jar
Edit /com/android/internal/widget/multiwaveview/GlowPadView.smali and replace the whole methods ".method private getDirectionDescription(I)Ljava/lang/String;" and ".method private getTargetDescription(I)Ljava/lang/String;" with the following methods:
Code:
.method private getDirectionDescription(I)Ljava/lang/String;
.locals 4
.parameter "index"
.prologue
.line 1119
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
if-eqz v2, :cond_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->isEmpty()Z
move-result v2
if-eqz v2, :cond_1
.line 1120
:cond_0
iget v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptionsResourceId:I
invoke-direct {p0, v2}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->loadDescriptions(I)Ljava/util/ArrayList;
move-result-object v2
iput-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
.line 1121
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDrawables:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v2
iget-object v3, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result v3
if-eq v2, v3, :cond_1
.line 1122
const-string v2, "GlowPadView"
const-string v3, "The number of target drawables must be equal to the number of direction descriptions."
invoke-static {v2, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 1124
const/4 v0, 0x0
.line 1133
:goto_0
return-object v0
.line 1130
:cond_1
:try_start_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mDirectionDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 1131
.local v0, directionZ:Ljava/lang/String;
goto :goto_0
.line 1132
.end local v0 #directionZ:Ljava/lang/String;
:catch_0
move-exception v1
.line 1133
.local v1, e:Ljava/lang/Exception;
const-string v0, ""
goto :goto_0
.end method
Code:
.method private getTargetDescription(I)Ljava/lang/String;
.locals 4
.parameter "index"
.prologue
.line 1099
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
if-eqz v2, :cond_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->isEmpty()Z
move-result v2
if-eqz v2, :cond_1
.line 1100
:cond_0
iget v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptionsResourceId:I
invoke-direct {p0, v2}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->loadDescriptions(I)Ljava/util/ArrayList;
move-result-object v2
iput-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
.line 1101
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDrawables:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v2
iget-object v3, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
invoke-virtual {v3}, Ljava/util/ArrayList;->size()I
move-result v3
if-eq v2, v3, :cond_1
.line 1102
const-string v2, "GlowPadView"
const-string v3, "The number of target drawables must be equal to the number of target descriptions."
invoke-static {v2, v3}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 1104
const/4 v1, 0x0
.line 1114
:goto_0
return-object v1
.line 1109
:cond_1
const-string v1, ""
.line 1111
.local v1, targetZ:Ljava/lang/String;
:try_start_0
iget-object v2, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mTargetDescriptions:Ljava/util/ArrayList;
invoke-virtual {v2, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v2
move-object v0, v2
check-cast v0, Ljava/lang/String;
move-object v1, v0
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
.line 1112
:catch_0
move-exception v2
goto :goto_0
.end method
Recompile your framework.jar
Now we're done with the framework, now we need to modify last file: android.policy.jar
android policy editing:
[JAVA]
Open /frameworks/base/policy/src/com/android/internal/policy/impl/LockScreen.java
Inside the method onTrigger, inside the switch (resId) add:
Code:
case com.android.internal.R.drawable.ic_lockscreen_phone:
Intent phoneIntent = new Intent(Intent.ACTION_MAIN);
phoneIntent.setClassName("com.android.contacts", "com.android.contacts.activities.DialtactsActivity");
phoneIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(phoneIntent);
mCallback.goToUnlockScreen();
break;
case com.android.internal.R.drawable.ic_lockscreen_sms:
Intent mmsIntent = new Intent(Intent.ACTION_MAIN);
mmsIntent.setClassName("com.android.mms", "com.android.mms.ui.ConversationList");
mmsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(mmsIntent);
mCallback.goToUnlockScreen();
break;
You're done, feel free to compile!
Of course you can use whatever activity you want, remember to change the images accordingly.
[SMALI]
Disassemble your android.policy.jar
Edit /com/android/internal/policy/impl/LockScreen.smali and add the following methods:
Code:
.method static synthetic access$1400(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
.locals 1
.parameter "x0"
.prologue
.line 56
iget-object v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mContext:Landroid/content/Context;
return-object v0
.end method
.method static synthetic access$1500(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
.locals 1
.parameter "x0"
.prologue
.line 56
iget-object v0, p0, Lcom/android/internal/policy/impl/LockScreen;->mContext:Landroid/content/Context;
return-object v0
.end method
Edit /com/android/internal/policy/impl/LockScreen$GlowPadViewMethods.smali.
Replace the whole method onTrigger with:
Code:
.method public onTrigger(Landroid/view/View;I)V
.locals 7
.parameter "v"
.parameter "target"
.prologue
const/high16 v6, 0x1000
.line 313
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->mGlowPadView:Lcom/android/internal/widget/multiwaveview/GlowPadView;
invoke-virtual {v4, p2}, Lcom/android/internal/widget/multiwaveview/GlowPadView;->getResourceIdForTarget(I)I
move-result v3
.line 321
.local v3, resId:I
sparse-switch v3, :sswitch_data_0
.line 367
:goto_0
return-void
.line 323
:sswitch_0
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1200(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
move-result-object v4
invoke-static {v4}, Landroid/app/SearchManager;->getAssistIntent(Landroid/content/Context;)Landroid/content/Intent;
move-result-object v0
.line 324
.local v0, assistIntent:Landroid/content/Intent;
if-eqz v0, :cond_0
.line 325
invoke-direct {p0, v0}, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->launchActivity(Landroid/content/Intent;)V
.line 329
:goto_1
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->pokeWakelock()V
goto :goto_0
.line 327
:cond_0
const-string v4, "LockScreen"
const-string v5, "Failed to get intent for assist activity"
invoke-static {v4, v5}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_1
.line 333
.end local v0 #assistIntent:Landroid/content/Intent;
:sswitch_1
new-instance v4, Landroid/content/Intent;
const-string v5, "android.media.action.STILL_IMAGE_CAMERA"
invoke-direct {v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
invoke-direct {p0, v4}, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->launchActivity(Landroid/content/Intent;)V
.line 334
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->pokeWakelock()V
goto :goto_0
.line 339
:sswitch_2
new-instance v2, Landroid/content/Intent;
const-string v4, "android.intent.action.MAIN"
invoke-direct {v2, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 340
.local v2, phoneIntent:Landroid/content/Intent;
const-string v4, "com.android.contacts"
const-string v5, "com.android.contacts.activities.DialtactsActivity"
invoke-virtual {v2, v4, v5}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 341
invoke-virtual {v2, v6}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
.line 342
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1300(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
move-result-object v4
invoke-virtual {v4, v2}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
.line 343
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
goto :goto_0
.line 348
.end local v2 #phoneIntent:Landroid/content/Intent;
:sswitch_3
new-instance v1, Landroid/content/Intent;
const-string v4, "android.intent.action.MAIN"
invoke-direct {v1, v4}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 349
.local v1, mmsIntent:Landroid/content/Intent;
const-string v4, "com.android.mms"
const-string v5, "com.android.mms.ui.ConversationList"
invoke-virtual {v1, v4, v5}, Landroid/content/Intent;->setClassName(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
.line 350
invoke-virtual {v1, v6}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
.line 351
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$1400(Lcom/android/internal/policy/impl/LockScreen;)Landroid/content/Context;
move-result-object v4
invoke-virtual {v4, v1}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
.line 352
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
goto :goto_0
.line 357
.end local v1 #mmsIntent:Landroid/content/Intent;
:sswitch_4
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$500(Lcom/android/internal/policy/impl/LockScreen;)V
.line 358
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->pokeWakelock()V
goto/16 :goto_0
.line 364
:sswitch_5
iget-object v4, p0, Lcom/android/internal/policy/impl/LockScreen$GlowPadViewMethods;->this$0:Lcom/android/internal/policy/impl/LockScreen;
invoke-static {v4}, Lcom/android/internal/policy/impl/LockScreen;->access$400(Lcom/android/internal/policy/impl/LockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
move-result-object v4
invoke-interface {v4}, Lcom/android/internal/policy/impl/KeyguardScreenCallback;->goToUnlockScreen()V
goto/16 :goto_0
.line 321
:sswitch_data_0
.sparse-switch
0x1080294 -> :sswitch_0
0x10802dd -> :sswitch_1
0x10802f6 -> :sswitch_4
0x10802fe -> :sswitch_5
0x1080301 -> :sswitch_5
0x1080604 -> :sswitch_2
0x1080607 -> :sswitch_3
.end sparse-switch
.end method
Replace the values you wrote down back here:
Code:
0x1080294 -> :sswitch_0
0x10802dd -> :sswitch_1
0x10802f6 -> :sswitch_4
0x10802fe -> :sswitch_5
0x1080301 -> :sswitch_5
0x1080604 -> :sswitch_2
0x1080607 -> :sswitch_3
Recompile and you're good to go!
Enjoy and happy editing!
reserved
{
"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"
}
Make this into a flashable zip please?
onasri15 said:
Make this into a flashable zip please?
Click to expand...
Click to collapse
lazy people are lazy
http://forum.xda-developers.com/showthread.php?t=1794061
atl4ntis said:
lazy people are lazy
http://forum.xda-developers.com/showthread.php?t=1794061
Click to expand...
Click to collapse
I am curious those flash-able frameworks are only if u have STOCK and then they will add only that feature only. So if I am running another MOD I cannot flash those mods because they will overwrite the framework file and maybe change something else?
Dude. This mod is supposed to be in the Themes and Apps section, is not here. This is an Android Development section.
kalinusa said:
I am curious those flash-able frameworks are only if u have STOCK and then they will add only that feature only. So if I am running another MOD I cannot flash those mods because they will overwrite the framework file and maybe change something else?
Click to expand...
Click to collapse
this thread isn't about flashable stuff so please refrain from asking anything but editing coding stuff.
as for you question, of course if you got any other mods this one "MAY" break it, depends from the files involved in the mods. Do a nand backup and try yourself or get your modded files and edit them accordingly to this howto.
DaXmax said:
Dude. This mod is supposed to be in the Themes and Apps section, is not here. This is an Android Development section.
Click to expand...
Click to collapse
DUDE i see code and stuff here, i don't see why this doesn't belong to dev section. It's a ****ing howto. No themes or mods are published here.
This deserve more then any make -j1 otapackage + busybox stuff.
This won't work on CM10 right because the framework-res apk will probably be different than stock?
onasri15 said:
This won't work on CM10 right because the framework-res apk will probably be different than stock?
Click to expand...
Click to collapse
framework isn't an issue since you are just adding things..
android.policy could be a problem... if you know a bit about smali you could handle it.
Anyway the best way is to try.
Didn't cm10 already have a quad lockscreen btw?
im almost done but i dont know how to do this
"Disassemble your android.policy.jar"
mixtapes08 said:
im almost done but i dont know how to do this
"Disassemble your android.policy.jar"
Click to expand...
Click to collapse
use smali/baksmali or aapt/apktool
edit:typo
atl4ntis said:
use smali/baksmali or aapt/apktool
edit:typo
Click to expand...
Click to collapse
I didn't see this one but I've done it using my own self method lol and I got it on j belly 0.1.4 thank you so much
Sent from my Nexus S™
atl4ntis said:
This howto will teach you how to add a quad lockscreen with phone and messaging to any jb rom in 2 ways:
...
Enjoy and happy editing!
Click to expand...
Click to collapse
atl4ntis thanks for your explanation!
i have some problem whit my quad lockscreen! When i start a services on setting -> accessibility (as example talkback or iphone notification application services or an app that required his services activated!)
when i tap the center of screen to unlock the phone.. it reboot!
where i can look into the code for revolve this annoying problem?
thanks!
impazzito said:
atl4ntis thanks for your explanation!
i have some problem whit my quad lockscreen! When i start a services on setting -> accessibility (as example talkback or iphone notification application services or an app that required his services activated!)
when i tap the center of screen to unlock the phone.. it reboot!
where i can look into the code for revolve this annoying problem?
thanks!
Click to expand...
Click to collapse
+1 here. Do you have a solution?
reference.phone said:
+1 here. Do you have a solution?
Click to expand...
Click to collapse
do you have same problem?
i don't have this issue cos i'm not using the accessibiity service but i think the issue is here in:
/base/com/android/internal/widget/multiwaveview/GlobalPadView.java
Code:
private String getTargetDescription(int index) {
if (mTargetDescriptions == null || mTargetDescriptions.isEmpty()) {
mTargetDescriptions = loadDescriptions(mTargetDescriptionsResourceId);
if (mTargetDrawables.size() != mTargetDescriptions.size()) {
Log.w(TAG, "The number of target drawables must be"
+ " equal to the number of target descriptions.");
return null;
}
}
return mTargetDescriptions.get(index);
}
private String getDirectionDescription(int index) {
if (mDirectionDescriptions == null || mDirectionDescriptions.isEmpty()) {
mDirectionDescriptions = loadDescriptions(mDirectionDescriptionsResourceId);
if (mTargetDrawables.size() != mDirectionDescriptions.size()) {
Log.w(TAG, "The number of target drawables must be"
+ " equal to the number of direction descriptions.");
return null;
}
}
return mDirectionDescriptions.get(index);
}
specifically in the return mTargetDescriptions.get(index); and return mDirectionDescriptions.get(index);.
This should fix it:
Code:
- return mDirectionDescriptions.get(index);
+ try {
+ String directionZ = mDirectionDescriptions.get(index);
+ return directionZ;
+ } catch (Exception e) {
+ return "";
+ }
Code:
- return mTargetDescriptions.get(index);
+ try {
+ String targetZ = mTargetDescriptions.get(index);
+ } catch (Exception e) {
+ return targetZ;
+ }
Didn't try it and not sure when i can add the smali part, but it involves editing a new file, framework.jar.
I'm quite busy atm, going holiday tomorrow.
atl4ntis said:
i don't have this issue cos i'm not using the accessibiity service but i think the issue is here in:
/base/com/android/internal/widget/multiwaveview/GlobalPadView.java
Code:
private String getTargetDescription(int index) {
if (mTargetDescriptions == null || mTargetDescriptions.isEmpty()) {
mTargetDescriptions = loadDescriptions(mTargetDescriptionsResourceId);
if (mTargetDrawables.size() != mTargetDescriptions.size()) {
Log.w(TAG, "The number of target drawables must be"
+ " equal to the number of target descriptions.");
return null;
}
}
return mTargetDescriptions.get(index);
}
private String getDirectionDescription(int index) {
if (mDirectionDescriptions == null || mDirectionDescriptions.isEmpty()) {
mDirectionDescriptions = loadDescriptions(mDirectionDescriptionsResourceId);
if (mTargetDrawables.size() != mDirectionDescriptions.size()) {
Log.w(TAG, "The number of target drawables must be"
+ " equal to the number of direction descriptions.");
return null;
}
}
return mDirectionDescriptions.get(index);
}
specifically in the return mTargetDescriptions.get(index); and return mDirectionDescriptions.get(index);.
This should fix it:
Code:
- return mDirectionDescriptions.get(index);
+ try {
+ String directionZ = mDirectionDescriptions.get(index);
+ return directionZ;
+ } catch (Exception e) {
+ return "";
+ }
Code:
- return mTargetDescriptions.get(index);
+ try {
+ String targetZ = mTargetDescriptions.get(index);
+ } catch (Exception e) {
+ return targetZ;
+ }
Didn't try it and not sure when i can add the smali part, but it involves editing a new file, framework.jar.
I'm quite busy atm, going holiday tomorrow.
Click to expand...
Click to collapse
Im patiently waiting for your revisions sir
Sent from my Nexus S™
mixtapes08 said:
Im patiently waiting for your revisions sir
Sent from my Nexus S™
Click to expand...
Click to collapse
mixtapes08 may you make an alpha mod with this changes end give it to me so, if works, you will publish for the nex release of jelly belly?
thanks a lot!
impazzito said:
mixtapes08 may you make an alpha mod with this changes end give it to me so, if works, you will publish for the nex release of jelly belly?
thanks a lot!
Click to expand...
Click to collapse
That codes is for compiling from sources. Compiling from smali is different.
Sent from my Nexus S™

[guide][jb][3-way] easily enable extended power menu for mtk devices

Hello Everyone ,
In this guide i'll show u how to add Reboot and Recovery option to power menu
There is lots of Guides on how to add recovery option to power menu but none worked perfectly on my device(MTK)
so i found a new way , in which we need not to find proper globalaction files
Requirements :
apktool
Notepad++
android.policy.jar
framework-res.apk
Time and Patience
Click to expand...
Click to collapse
Part-1
Decompile Your framework-res.apk and navigate to - res/value/strings.xml
add these lines at the end.
Code:
<string name="reboot_text">Reboot</string>
<string name="recovery_text">Recovery</string>
Like 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"
}
and add the attached pngs to - res/drawable-hdpi/ and compile the apk
again decompile the modded apk and open res/values/public.xml
Part-2
Now Decompile your "android.policy.jar" and add the attached files to - "android.policy.jar.out\smali\com\android\internal\policy\impl"
Now open GlobalActions.smali and find this method
Code:
.method private createDialog()Lcom/android/internal/policy/impl/GlobalActions$GlobalActionsDialog;
Below that you will see
Code:
.locals 11
change it to
Code:
.locals [COLOR="Red"]12[/COLOR]
Now find
Code:
.prologue
Below that paste this
Code:
const [COLOR="Red"]v11[/COLOR], 0x1080030 <------------ Replace the id with ic_lock_power_off (power off drawable) in the opened public.xml
Now Find this
Code:
new-instance [COLOR="Purple"]v1[/COLOR], Lcom/android/internal/policy/impl/GlobalActions$2;
const [COLOR="DarkGreen"]v2[/COLOR], 0x10400e7
change the id 0x10400e7 with the new id in public.xml
Code:
<public type="string" name="global_action_power_off"
now below that you will see
Code:
const [COLOR="Magenta"]v3[/COLOR], 0x10400e7
now delate the above line and paste this below
Code:
invoke-direct {v1, p0, v11, v2}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 317
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$98;
const [COLOR="Red"]v2[/COLOR], 0x108061a <----------id of <public type="drawable" name="ic_lock_reboot"
const [COLOR="Magenta"]v3[/COLOR], 0x104054f <----------id of <public type="string" name="reboot_text"
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$98;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 327
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$99;
const [COLOR="Red"]v2[/COLOR], 0x1080619 <---------- id of <public type="drawable" name="ic_lock_recovery"
const [COLOR="Magenta"]v3[/COLOR], 0x1040550 <-----------id of <public type="string" name="recovery_text"
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
Replace the above ids with the id in your public.xml
Before :
Code:
.line 281
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
.line 284
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
[COLOR="RoyalBlue"]new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
const v2, 0x1080030
const v3, 0x10400e7
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[/COLOR]
.line 309
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 312
After :
Code:
.line 281
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
.line 284
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$2;
[COLOR="Blue"] const v2, 0x10400e7
invoke-direct {v1, p0, v11, v2}, Lcom/android/internal/policy/impl/GlobalActions$2;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 317
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$98;
const v2, 0x108061a
const v3, 0x104054f
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$98;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 327
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$99;
const v2, 0x1080619
const v3, 0x1040550
invoke-direct {v1, p0, v2, v3}, Lcom/android/internal/policy/impl/GlobalActions$99;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
[/COLOR] .line 309
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;
iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;
invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
Now compile and flash both the files
I have attached my GlobalActions.smali for comparision just change the extension from .zip to .smali
Result :
Hints :
1 . While Replacing the id from public.xml replace only last 7 digits
like this
2. keep track of registers (like v1 v2 v11 etc) and .Line numbers should be unique
3. Register values (like 0x108061a) will be Different for Different roms
I've Tested this guide on 3 different roms and it is working fine without any errors
If u Have any Problems Post here i'll try my best to help you
Credits/ Thanks
SuperDroidBond
Adi Aisiteru Reborn
Learnt many things from their guides ...
Click to expand...
Click to collapse
If you like my work Hit Thanks ..dont forget ​​
Reserved ...
+1
reserved ..
Great guide bro :good:
hello aweasome guide sir thanks alot
put can you give me a smali tool you used
the guide is aweasome realy want to do it thanks
i have done the tutorial and when i press and hold power volume it softreboots
so where is the problem
hope any one here helps me
working for my device Xperia C
after changing Const V3 with V2 that u said in the section of putting the line 317 and 327
u have to fix it more as things are going wrong cause thereis gona be amiss in the last line
Mohamed Yahia San said:
working for my device Xperia C
after changing Const V3 with V2 that u said in the section of putting the line 317 and 327
u have to fix it more as things are going wrong cause thereis gona be amiss in the last line
Click to expand...
Click to collapse
hello how do you mean changing Const V3 with V2 ????
i mean instead OF
const v3, 0x10400e7
i made it
const v2, 0x10400e7
but with different id of course
Thanx sir it works on my mt6589 cross a88

[GUIDE][CM9-11] Add partition info in Settings.apk

Assalamualaikum
Hello guys, i want to share a simple guide with you
WHAT IS IT?
it's a guide to make a partition info in the Settings.apk
Source:
SCREENSHOT
{
"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"
}
Ok, let's start working on it
WHATS NEEDED?
- Brain
- A cup of coffe
- Use Apktool v 2.0.0 beta 9
- Settings.apk
- Attachment file
1. Decompile your Settings.apk
2. Download and extrack Attachment file and place it in the right place
3. Go to the ~\Settings\res\values\strings.xml
Add this code below before </resources>
Code:
<string name="partition_info_title">Partition info</string>
<string name="partition_info_system">/system</string>
<string name="partition_info_data">/data</string>
<string name="partition_info_cache">/cache</string>
<string name="partition_info_sdcard">/sdcard (FAT)</string>
<string name="partition_info_sdext">/sd-ext (EXT)</string>
<string name="partition_info_used_of">/</string>
<string name="nol">Unavailable</string>
</resources>
3. Go to the ~\Settings\res\xml\settings_headers.xml
Add this code below wherever you want inside settings_headers.xml
Code:
<header android:icon="@drawable/partition_info" android:title="@string/partition_info_title">
<intent android:targetPackage="com.android.settings" android:action="com.android.action.MAIN" android:targetClass="com.android.settings.ktech.PartitionInfo" />
</header>
4. Compile your Settings.apk and decompile again
5. Go to ~\Settings\AndroidManifest.xml
Code:
<activity android:label="@string/partition_info_title" android:name=".ktech.PartitionInfo">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.VOICE_LAUNCH"/>
</intent-filter>
</activity>
6. Go to the ~\Settings\smali\com\android\settings\ktech\PartitionInfo.smali
Find & replace this code below with your public id
Code:
Line 110 0x7f080403 public type="string" name="partition_info_used_of"
Line 189 0x7f050043 public type="xml" name="partition_info"
7. Recompile Settings.apk then Sign it
8. Push it in your phone
hi i have one problem i make all the steps and im getting fc of settings when im pushing ''partition info'' and then i see that after decompile (the second decompile) the partition_info is in pyblic type drawable and not in pyblic type xml im trying 5 times but nothing (sorry for my bad english)
G.M.L said:
hi i have one problem i make all the steps and im getting fc of settings when im pushing ''partition info'' and then i see that after decompile (the second decompile) the partition_info is in pyblic type drawable and not in pyblic type xml im trying 5 times but nothing (sorry for my bad english)
Click to expand...
Click to collapse
Post your log here
Here is it
OK I made it I changed the icon name in drawable-hdpi and after decomplile (the second time) in public the names are correct thanks k_tech!!!!!!
G.M.L.
G.M.L said:
OK I made it I changed the icon name in drawable-hdpi and after decomplile (the second time) in public the names are correct thanks k_tech!!!!!!
G.M.L.
Click to expand...
Click to collapse
Ok, good job
Thx sir, its work on my LG P713 (4.1.2)
Thx sir...
step6 is little confusing....could u plz be in detail.
rrajesh011 said:
step6 is little confusing....could u plz be in detail.
Click to expand...
Click to collapse
Open smali/com/android/settings/k_tech/partitioninfo.smali and leave it open
Open value/public.xml and find
type=string name=partition_info_used_of id=this number copy and paste to partition info.smali in line 1100
And
type=xml name=partition_info id=this number copy and paste in partition info.Smali in line 1890
Compile and its ready!!!
G.M.L.
G.M.L said:
Open smali/com/android/settings/k_tech/partitioninfo.smali and leave it open
Open value/public.xml and find
type=string name=partition_info_used_of id=this number copy and paste to partition info.smali in line 1100
And
type=xml name=partition_info id=this number copy and paste in partition info.Smali in line 1890
Compile and its ready!!!
G.M.L.
Click to expand...
Click to collapse
this is my partitioninfo.smali i didnot find line 189. i found line 110 but where to add public id.
Code:
.class public Lcom/android/settings/ktech/PartitionInfo;
.super Landroid/preference/PreferenceActivity;
.source "PartitionInfo.java"
# instance fields
.field private extfsIsMounted:Z
.field private mCachePartSize:Landroid/preference/Preference;
.field private mDataPartSize:Landroid/preference/Preference;
.field private mSDCardPartEXTSize:Landroid/preference/Preference;
.field private mSDCardPartFATSize:Landroid/preference/Preference;
.field private mSystemPartSize:Landroid/preference/Preference;
# direct methods
.method public constructor <init>()V
.locals 1
.prologue
.line 45
invoke-direct {p0}, Landroid/preference/PreferenceActivity;-><init>()V
.line 60
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/settings/ktech/PartitionInfo;->extfsIsMounted:Z
return-void
.end method
.method private ObtainFSPartSize(Ljava/lang/String;)Ljava/lang/String;
.locals 11
.param p1, "PartitionPath" # Ljava/lang/String;
.prologue
.line 103
new-instance v4, Ljava/io/File;
invoke-direct {v4, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 104
.local v4, "extraPath":Ljava/io/File;
new-instance v5, Landroid/os/StatFs;
invoke-virtual {v4}, Ljava/io/File;->getPath()Ljava/lang/String;
move-result-object v7
invoke-direct {v5, v7}, Landroid/os/StatFs;-><init>(Ljava/lang/String;)V
.line 105
.local v5, "extraStat":Landroid/os/StatFs;
invoke-virtual {v5}, Landroid/os/StatFs;->getBlockSize()I
move-result v7
int-to-long v0, v7
.line 106
.local v0, "eBlockSize":J
invoke-virtual {v5}, Landroid/os/StatFs;->getBlockCount()I
move-result v7
int-to-long v2, v7
.line 107
.local v2, "eTotalBlocks":J
mul-long v7, v2, v0
invoke-virtual {v5}, Landroid/os/StatFs;->getAvailableBlocks()I
move-result v9
int-to-long v9, v9
mul-long/2addr v9, v0
sub-long/2addr v7, v9
invoke-static {p0, v7, v8}, Landroid/text/format/Formatter;->formatFileSize(Landroid/content/Context;J)Ljava/lang/String;
move-result-object v6
.line 108
.local v6, "retstr":Ljava/lang/String;
new-instance v7, Ljava/lang/StringBuilder;
invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v7, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
const-string v8, " "
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {p0}, Lcom/android/settings/ktech/PartitionInfo;->getResources()Landroid/content/res/Resources;
move-result-object v8
const v9, 0x7f080403
invoke-virtual {v8, v9}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
move-result-object v8
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
const-string v8, " "
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
.line 109
new-instance v7, Ljava/lang/StringBuilder;
invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v7, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
mul-long v8, v2, v0
invoke-static {p0, v8, v9}, Landroid/text/format/Formatter;->formatFileSize(Landroid/content/Context;J)Ljava/lang/String;
move-result-object v8
invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v7
invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
.line 110
return-object v6
.end method
# virtual methods
.method public fileExists(Ljava/lang/String;)Z
.locals 2
.param p1, "filename" # Ljava/lang/String;
.prologue
.line 114
new-instance v0, Ljava/io/File;
invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 115
.local v0, "f":Ljava/io/File;
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v1
return v1
.end method
.method protected onCreate(Landroid/os/Bundle;)V
.locals 5
.param p1, "icicle" # Landroid/os/Bundle;
.prologue
const/4 v4, 0x1
.line 64
invoke-super {p0, p1}, Landroid/preference/PreferenceActivity;->onCreate(Landroid/os/Bundle;)V
.line 66
const v2, 0x7f050043
invoke-virtual {p0, v2}, Lcom/android/settings/ktech/PartitionInfo;->addPreferencesFromResource(I)V
.line 68
invoke-virtual {p0}, Lcom/android/settings/ktech/PartitionInfo;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
move-result-object v1
.line 70
.local v1, "prefSet":Landroid/preference/PreferenceScreen;
const-string v2, "system_part_info"
invoke-virtual {v1, v2}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
iput-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSystemPartSize:Landroid/preference/Preference;
.line 71
const-string v2, "data_part_info"
invoke-virtual {v1, v2}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
iput-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mDataPartSize:Landroid/preference/Preference;
.line 72
const-string v2, "cache_part_info"
invoke-virtual {v1, v2}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
iput-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mCachePartSize:Landroid/preference/Preference;
.line 73
const-string v2, "sdcard_part_info_fat"
invoke-virtual {v1, v2}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
iput-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSDCardPartFATSize:Landroid/preference/Preference;
.line 74
const-string v2, "sdcard_part_info_ext"
invoke-virtual {v1, v2}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v2
iput-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSDCardPartEXTSize:Landroid/preference/Preference;
.line 76
const-string v2, "/dev/block/mmcblk0p2"
invoke-virtual {p0, v2}, Lcom/android/settings/ktech/PartitionInfo;->fileExists(Ljava/lang/String;)Z
move-result v2
if-ne v2, v4, :cond_0
.line 77
const-string v2, "PartitionInfo"
const-string v3, "sd: ext partition mounted"
invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 78
iput-boolean v4, p0, Lcom/android/settings/ktech/PartitionInfo;->extfsIsMounted:Z
.line 84
:goto_0
:try_start_0
iget-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSystemPartSize:Landroid/preference/Preference;
const-string v3, "/system"
invoke-direct {p0, v3}, Lcom/android/settings/ktech/PartitionInfo;->ObtainFSPartSize(Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
.line 85
iget-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mDataPartSize:Landroid/preference/Preference;
const-string v3, "/data"
invoke-direct {p0, v3}, Lcom/android/settings/ktech/PartitionInfo;->ObtainFSPartSize(Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
.line 86
iget-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mCachePartSize:Landroid/preference/Preference;
const-string v3, "/cache"
invoke-direct {p0, v3}, Lcom/android/settings/ktech/PartitionInfo;->ObtainFSPartSize(Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
.line 87
iget-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSDCardPartFATSize:Landroid/preference/Preference;
const-string v3, "/sdcard"
invoke-direct {p0, v3}, Lcom/android/settings/ktech/PartitionInfo;->ObtainFSPartSize(Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
.line 89
iget-boolean v2, p0, Lcom/android/settings/ktech/PartitionInfo;->extfsIsMounted:Z
if-ne v2, v4, :cond_1
.line 90
iget-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSDCardPartEXTSize:Landroid/preference/Preference;
const-string v3, "/external_sd"
invoke-direct {p0, v3}, Lcom/android/settings/ktech/PartitionInfo;->ObtainFSPartSize(Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setSummary(Ljava/lang/CharSequence;)V
:try_end_0
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
.line 99
:goto_1
return-void
.line 80
:cond_0
const-string v2, "PartitionInfo"
const-string v3, "sd: ext partition not mounted"
invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_0
.line 92
:cond_1
:try_start_1
iget-object v2, p0, Lcom/android/settings/ktech/PartitionInfo;->mSDCardPartEXTSize:Landroid/preference/Preference;
const/4 v3, 0x0
invoke-virtual {v2, v3}, Landroid/preference/Preference;->setEnabled(Z)V
:try_end_1
.catch Ljava/lang/IllegalArgumentException; {:try_start_1 .. :try_end_1} :catch_0
goto :goto_1
.line 95
:catch_0
move-exception v0
.line 96
.local v0, "e":Ljava/lang/IllegalArgumentException;
invoke-virtual {v0}, Ljava/lang/IllegalArgumentException;->printStackTrace()V
goto :goto_1
.end method
Change
0x7f080403 in line 110 with the id of partition_info_used_of
and
0x7f050058 in line 189 with the id of partition_info
Thanks
nice sir.
but i have problem, for /sd-ext(EXT) is displayed unavailable. i have 16gb external storage..
My rom is stock 4.1.2 touchwiz.
hope can fix :fingers-crossed:
syaeful said:
nice sir.
but i have problem, for /sd-ext(EXT) is displayed unavailable. i have 16gb external storage..
My rom is stock 4.1.2 touchwiz.
hope can fix :fingers-crossed:
Click to expand...
Click to collapse
Try this smali and tell me if it work
G.M.L said:
Try this smali and tell me if it work
Click to expand...
Click to collapse
thanks sir... i will try and give feedback later
---------- Post added at 10:23 AM ---------- Previous post was at 10:04 AM ----------
Still same sir,,
syaeful said:
thanks sir... i will try and give feedback later
---------- Post added at 10:23 AM ---------- Previous post was at 10:04 AM ----------
Still same sir,,
Click to expand...
Click to collapse
I will check it again later and I will tell you
G.M.L.
syaeful said:
thanks sir... i will try and give feedback later
---------- Post added at 10:23 AM ---------- Previous post was at 10:04 AM ----------
Still same sir,,
Click to expand...
Click to collapse
in partition_info.xml try to change @string/nol with @string/status_unavailable and tell me
in Android_manifest.xml did you add the activity?
G.M.L said:
in partition_info.xml try to change @string/nol with @string/status_unavailable and tell me
in Android_manifest.xml did you add the activity?
Click to expand...
Click to collapse
i have done with manifest..
i wil try for strings. thanks before
G.M.L said:
Try this smali and tell me if it work
Click to expand...
Click to collapse
thank you. ROM cook me JB 4.1.2
i try this smali

[GUIDE][SMALI]Disable StatusBar notifications[GUIDE][SMALI]

Disable Bluetooth/Alarm/Volume Notifications in StatusBar​
This MOD disables the ongoing Notifications for Bluetooth, Alarm and Volume
and can easily be modified to remove other ongoing statusbar notifications.
this MOD operates a little different it not only removes the icon but also the notification
as well, thus freeing up the statusbar. I tried several different mods for this and none seemed to work
the way I wanted them to so with a lot of searching and a little luck i found the smali code to disable
them rather than just hide the icons.​
STEP 1:
Pull SystemUI.apk either from your device or from your ROM.zip file
from device: adb pull /system/priv-app/SystemUI.apk
from ROM.zip: extract /system/priv-app/SystemUI.apk
STEP 2:
using available tools decompile the apk (either using apktool or Virtuous Ten Studio) I recomend VTS
Locate smali/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.smali
make the changes listed below:
For Bluetooth notifications:
Search for .method private final updateBluetooth(Landroid/content/IntentV
in that method search for const-string v6, "bluetooth" it should look like this
Add the lines in BLUE
Code:
[COLOR="Blue"]goto :goto_aa[/COLOR]
const-string v6, "bluetooth"
invoke-virtual {v4, v6, v2, v5, v1}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;IILjava/lang/String;)V
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v5, "bluetooth"
iget-boolean v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mBluetoothEnabled:Z
invoke-virtual {v4, v5, v6}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
[COLOR="Blue"]:goto_aa[/COLOR]
:cond_0
return-void"
For Alarm search for .method private final updateAlarm(Landroid/content/IntentV
Add the lines in BLUE
Code:
.method private final updateAlarm(Landroid/content/Intent;)V
.locals 3
const-string v1, "alarmSet"
const/4 v2, 0x0
invoke-virtual {p1, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
[COLOR="Blue"]goto :goto_cc[/COLOR]
const-string v2, "alarm_clock"
invoke-virtual {v1, v2, v0}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
[COLOR="Blue"]:goto_cc[/COLOR]
return-void
.end method
For volume search for .method private final updateVolume()V
Add the lines in BLUE
Code:
[COLOR="Blue"]goto :goto_bb[/COLOR]
const-string v7, "volume"
invoke-virtual {v6, v7, v2, v5, v1}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;IILjava/lang/String;)V
:cond_1
iget-boolean v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mVolumeVisible:Z
if-eq v4, v5, :cond_2
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v6, "volume"
invoke-virtual {v5, v6, v4}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
iput-boolean v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mVolumeVisible:Z
[COLOR="Blue"]:goto_bb[/COLOR]
:cond_2
return-void
STEP 3:
Save the smali file, recompile the SystemUI.apk and push to your device to test
adb push SystemUI.apk /system/priv-app/SystemUI.apk
adb shell
cd /system/priv-app
chmod 0644 SystemUI.apk
reboot
This smali fragment contains many other ongoing statusbar notifications that can be disabled using the same methods as above.
@cstayton
You made the community alive .... Till we have Official LP.... Awesome work as always Sir[emoji106]
{
"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"
}
cstayton said:
Disable Bluetooth/Alarm/Volume Notifications in StatusBar​
This MOD disables the ongoing Notifications for Bluetooth, Alarm and Volume
and can easily be modified to remove other ongoing statusbar notifications.
this MOD operates a little different it not only removes the icon but also the notification
as well, thus freeing up the statusbar. I tried several different mods for this and none seemed to work
the way I wanted them to so with a lot of searching and a little luck i found the smali code to disable
them rather than just hide the icons.​
STEP 1:
Pull SystemUI.apk either from your device or from your ROM.zip file
from device: adb pull /system/priv-app/SystemUI.apk
from ROM.zip: extract /system/priv-app/SystemUI.apk
STEP 2:
using available tools decompile the apk (either using apktool or Virtuous Ten Studio) I recomend VTS
Locate smali/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.smali
make the changes listed below:
For Bluetooth notifications:
Search for .method private final updateBluetooth(Landroid/content/IntentV
in that method search for const-string v6, "bluetooth" it should look like this
Add the lines in BLUE
Code:
[COLOR="Blue"]goto :goto_aa[/COLOR]
const-string v6, "bluetooth"
invoke-virtual {v4, v6, v2, v5, v1}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;IILjava/lang/String;)V
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v5, "bluetooth"
iget-boolean v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mBluetoothEnabled:Z
invoke-virtual {v4, v5, v6}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
[COLOR="Blue"]:goto_aa[/COLOR]
:cond_0
return-void"
For Alarm search for .method private final updateAlarm(Landroid/content/IntentV
Add the lines in BLUE
Code:
.method private final updateAlarm(Landroid/content/Intent;)V
.locals 3
const-string v1, "alarmSet"
const/4 v2, 0x0
invoke-virtual {p1, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
[COLOR="Blue"]goto :goto_cc[/COLOR]
const-string v2, "alarm_clock"
invoke-virtual {v1, v2, v0}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
[COLOR="Blue"]:goto_cc[/COLOR]
return-void
.end method
For volume search for .method private final updateVolume()V
Add the lines in BLUE
Code:
[COLOR="Blue"]goto :goto_bb[/COLOR]
const-string v7, "volume"
invoke-virtual {v6, v7, v2, v5, v1}, Landroid/app/StatusBarManager;->setIcon(Ljava/lang/String;IILjava/lang/String;)V
:cond_1
iget-boolean v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mVolumeVisible:Z
if-eq v4, v5, :cond_2
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mService:Landroid/app/StatusBarManager;
const-string v6, "volume"
invoke-virtual {v5, v6, v4}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
iput-boolean v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;->mVolumeVisible:Z
[COLOR="Blue"]:goto_bb[/COLOR]
:cond_2
return-void
STEP 3:
Save the smali file, recompile the SystemUI.apk and push to your device to test
adb push SystemUI.apk /system/priv-app/SystemUI.apk
adb shell
cd /system/priv-app
chmod 0644 SystemUI.apk
reboot
This smali fragment contains many other ongoing statusbar notifications that can be disabled using the same methods as above.
Click to expand...
Click to collapse
Hey man! Thanks for this!
I was wondering if you could help me out with the following, I want to hide my bluetooth icon if bluetooth is enable and not connected to a paired device, but show it if I am connected to a paired device.
Thanks.
Rkr87 said:
Hey man! Thanks for this!
I was wondering if you could help me out with the following, I want to hide my bluetooth icon if bluetooth is enable and not connected to a paired device, but show it if I am connected to a paired device.
Thanks.
Click to expand...
Click to collapse
that'll take a little digging i'll see what i can find, no guarantees tho

Categories

Resources