[MOD] [HOW-TO] Remove / Restore keyboard icon in status bar - Verizon Samsung Galaxy S III

This will remove the keyboard notification icon in the status bar. For some (like me) its annoying. If you are running a custom ROM with changes to services.jar this will over write them. Best bet is to do a Nandroid before flashing. I am also including a restore zip for those who want to return to stock. I looked but did not see a specific mod to remove this option without loading a full ROM so enjoy. If there is one already floating around out there, then here is another...LOL. Thank me if this helps you.
This was tested on a stock deodexed LG1 ROM. It will more than likely work on other firmwares and non-stock ROMs but I have not tested on those.
The zips provided below will work in CWM or TWRP....or whatever recovery you prefer.
For those who want to do it themselves on thier own rom heres what to do:
Decompile: services.jar in framework.
Browse to: smali/com/android/server/InputMethodManagerService.smali
Scroll down to line (aprox) 8755 and look for the code:
Code:
iget-object v12, v0, Lcom/android/server/InputMethodManagerService;->mCurToken:Landroid/os/IBinder;
move-object/from16 v0, p1
[COLOR="Red"] if-eq v12, v0, :cond_1
[/COLOR]
.line 1369
:cond_0
const-string v12, "InputManagerService"
new-instance v13, Ljava/lang/StringBuilder;
Comment out or delete the line above in red.
Recompile
Chmod 644 and push to /system/framework
Enjoy!

ParanoidAndroid 2.10 Fail to Boot
Just flashed on ParanoidAndroid 2.10, bad idea. Caused an endless boot. I need to read all directions, glad I read the part about making a nandroid . I will have to try the code changes when I get time.
Thanks.

Like for example you turn your screen off after just sending a message and there's the little keyboard chooser notification??
Yeah, I hate that, but not so much to go through all this trouble.

jdubau55 said:
Like for example you turn your screen off after just sending a message and there's the little keyboard chooser notification??
Yeah, I hate that, but not so much to go through all this trouble.
Click to expand...
Click to collapse
Its just a zip file, shouldnt be that much trouble.

cannot find the line
cannot find the line in services.jar i am running latest paranoid rom
Didact74 said:
This will remove the keyboard notification icon in the status bar. For some (like me) its annoying. If you are running a custom ROM with changes to services.jar this will over write them. Best bet is to do a Nandroid before flashing. I am also including a restore zip for those who want to return to stock. I looked but did not see a specific mod to remove this option without loading a full ROM so enjoy. If there is one already floating around out there, then here is another...LOL. Thank me if this helps you.
This was tested on a stock deodexed LG1 ROM. It will more than likely work on other firmwares and non-stock ROMs but I have not tested on those.
The zips provided below will work in CWM or TWRP....or whatever recovery you prefer.
For those who want to do it themselves on thier own rom heres what to do:
Decompile: services.jar in framework.
Browse to: smali/com/android/server/InputMethodManagerService.smali
Scroll down to line (aprox) 8755 and look for the code:
Code:
iget-object v12, v0, Lcom/android/server/InputMethodManagerService;->mCurToken:Landroid/os/IBinder;
move-object/from16 v0, p1
[COLOR="Red"] if-eq v12, v0, :cond_1
[/COLOR]
.line 1369
:cond_0
const-string v12, "InputManagerService"
new-instance v13, Ljava/lang/StringBuilder;
Comment out or delete the line above in red.
Recompile
Chmod 644 and push to /system/framework
Enjoy!
Click to expand...
Click to collapse

If you're running PA then you shouldn't flash this as it should already be in the ROM.

Would you be able to update this for BLK3?
Thanks in advance.

jlee08517 said:
Would you be able to update this for BLK3?
Thanks in advance.
Click to expand...
Click to collapse
I would also like to know if this is possible
Edit: doesn't work
Sent from my SCH-I535 using Tapatalk 2

Related

[ROM] LOL v. 1.4.2 (with kernel 2.2.2+oc+lagfix)(+ how to create powermenu on LGP500)

Hello everybody, this is my first homemade ROM and everything started more like a joke.. (that’s the reason of its name.. ) rather than because of the necessity of a different ROM - I just wanted to experiment a bit in order to improve my knowledge!
The Void (thanks to Noejn) I was using before was working flawlessly, but I was curious to learn the procedure of cooking my own, so I tried, and when a problem showed up I resolved them.. it was a great way to learn something new!
First I made it for personal use only, then talking to my friends on an Italian android forum they wanted to try it, so they became my beta testers (MicheyKnox since the first day and NioBee from the second on).
During the last week many other users installed the Rom and I made some minor bug fixes and improvements and now it’s ready to be published here…!
But let’s go to the TECHNICAL SPECIFICATIONS:
* based on the v10q (Froyo 2.2.2)
* rom deodexed
* zipaligned
* root + superuser + busybox
* a2sd (darktremor script) + dalvik-cache on ext partition
* HW acceleration by default enabled
* Jit by default enabled
* Kernel froyo 2.2.2 recompiled by me with oc+lagfix (thx to drellisdee and mik_os)
* CPU automatically set 245/729/interactive
* gingerbread keyboard
* adw.launcher + adwnotifier
* customized theme with circular battery
* updated Google apps
* also includes: terminal emulator, OI file manager
* customization scripts: appinst and cpuclock
* customized POWERMENU able to reboot the phone or reboot directly in recovery
* BaBa (Burning Apple Boot Animation)
* wifi power (set by default to 20 dBm, edit the script /system/etc/setwifi.sh for modify this value)
* support for wlan wpa adhoc
* market hack (the market will seem that you are using Froyo 2.2)
BaBa is a Boot animation which is made of two different animations I found on XDA dimensions and timings where adapted in order to fit our needs (thanks to MickeyKnox )
Some apps like facebook, twitter and layar were removed, they can easily be installed through the Marked!
Removed: AppAdvisor and LG update advisor.
Other apps removed:
Code:
AIME.apk (LG Keyboard)
AnalogClockWidget.apk
BookmarksWidget.apk
CalendarWidget.apk
CarHome.apk
CarHomeLauncher.apk
ClockWeatherWidget.apk
DigitalAlarmWidget.apk
DualClockWidget.apk
GenieWidget.apk (news and weather widget)
LGHome.apk (launcher LG)
MagicSmokeWallpapers.apk
MemoWidget.apk
MessageWidget.apk
PhotoWidget.apk
Protips.apk
VisualizationWallpapers.apk
ConnectionManagerWidget.apk
Email.apk
LiveWallpapers.apk
Talk.apk
For these apps I created a script that allows you to install or uninstall them in a very easy way, without the need of root explorer.
To open this script go to Terminal Emulator (installed by default) or use adb shell from your PC and write:
su
appinst
a menu will popup where you’ll find all the options, just follow the onscreen instructions.
(the script works taking its files from the LOL directory in your SD Card, so if you delete this directory, the script won’t work!)
With my second script: cpuclock you’ll be able to change the default frequency in LOL without the need of installing other apps, to use it go to Terminal Emulator or via adb shell from your PC and write
su
cpuclock
and then follow the onscreen instructions, all your settings will be available after you reboot your device.
DOWNLOAD LINKS:
LOL v 1.4.2 (multiupload)
md5: 648e91a9d8458039d4937c4911acaf82
INSTALLATION (please follow these steps carefully):
What you need: root + custom recovery
* Reboot into custom recovery (through 3-button combo)
* Partition SDcard (swap: 0, ext: 512 – or bigger if you like), convert ext2 to ext3
* wipe everything (data/factory, cache, dalvik-cache, ext, android_secure)
* Toggle PC-USB connection and copy the downloaded zip you wish to flash into the root of your SDcard; unplug afterwards
* flash from SDcard and choose the file you just copied
* reboot
On first boot it takes some minutes for the phone to load: DON’T PANIC! Wait for at least 5-6 minutes!
************************************************************
I prepared a zip with the scripts translated into English (the original scripts in the Rom are in Italian)
just download and flash over.
************************************************************
Thanks to MickeyKnox for beta testing, for BaBa and for the time spent together on msn while I was cooking
Thanks to NioBee for beta testing and for her tips and suggestions (and for this translation from Italian )
Thanks to the guys on XDA where I found the tools needed to cook my ROM (dsixda + others) and to mik_os for his fantastic kernel
original discussion (in Italian): androidworld.it
************* standalone kernel ***************
zip in AnyKernel Updater by Koush package
kernel 2.2.2 + oc + lagfix by mik_os/Der_Caveman
kernel 2.2.2 + oc + lagfix by LG
SCREENSHOTS:
a little how to
ok, i wrote a little tutorial on how to create a powermenu
sorry for my english
************************************************************************************************
for first step i used this tutorial (i only removed the option "donwload"):
http://forum.xda-developers.com/showthread.php?t=811532
(copied from thread above)
untermensch said:
Step 1.
the first thing we need to do is add string and image resources to framwork-res
for this example I am using a stock JI6 ROM your resource id's will be different
if on another ROM
use apk_manager to decompile framework-res
open "res\values\strings.xml" and add our string resources
Code:
<string name="reboot_recovery">Recovery</string>
<string name="reboot">Reboot</string>
save and close
open "res\values\public.xml" and assign our strings resource id's
scroll until you get to the end of the "<public type="string"" id list
note the id of the last string, in this example it is "10403c2" sometimes
the id's are out of order so search for "10403c2 + 1" or "10403c3"
if the next id is unused then we can start assigning id's to the strings
we added.
Code:
<public type="string" name="reboot_recovery" id="0x010403c3" />
<public type="string" name="reboot" id="0x010403c5" />
now is a good time to add the image resources so add your icons to
"res\drawable-hdpi"
and assign id's to them the same way we did for the strings
in this example, using the example icons in the zip file I had
Code:
<public type="drawable" name="reboot" id="0x010803aa" />
<public type="drawable" name="recovery" id="0x010803ab" />
save and close
now framework-res has the resources needed for this mod use
apk_manager to compile.
Click to expand...
Click to collapse
step 2: (This part is based on untermensch's tutorial to which i have made serveral changes to let it work on LG)
now we are going to add the extra options to the power menu
decompile android.policy.jar with baksmali
open com\android\internal\policy\impl\GlobalActions.smali and change the line 436 from
Code:
const/4 v0, 0x3
to
Code:
const/4 v0, 0x5
insert the following line at line 462 (the original line 462 becomes line 486)
(remember to change reboot and recovery's image/string id with the ones used in the first step)
Code:
const/4 v1, 0x3
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$7;
const v3, 0x10803e0 # reboot icon resource id
const v4, 0x104039d # reboot string resource id
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$7;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
const/4 v1, 0x4
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$8;
const v3, 0x10803e1 # recovery icon resource id
const v4, 0x104039c # recovery string resource id
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
save and exit
(here starts my real job )
ok now copy GlobalActions$3.smali to GlobalActions$7.smali
edit GlobalActions$7.smali
search and replace all GlobalActions$3.smali to GlobalActions$7.smali
and change this line:
Code:
const/4 v1, 0x1
invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V
to
Code:
const/4 v1, 0x1
const-string v2, "now"
invoke-static {v0, v2, v1}, Lcom/android/internal/app/ShutdownThread;->reboot(Landroid/content/Context;Ljava/lang/String;Z)V
save and exit
now copy GlobalActions$3.smali to GlobalActions$8.smali
edit GlobalActions$8.smali
search and replace all GlobalActions$3.smali to GlobalActions$8.smali
and change this line:
Code:
const/4 v1, 0x1
invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V
to
Code:
const/4 v1, 0x1
const-string v2, "recovery"
invoke-static {v0, v2, v1}, Lcom/android/internal/app/ShutdownThread;->reboot(Landroid/content/Context;Ljava/lang/String;Z)V
save and exit
recompile android.policy.jar with smali
done
PaoloM70 said:
Hello everybody, this is my first homemade ROM
Click to expand...
Click to collapse
GREAT, glad to see you posted your Rom here...!!
I am using this rom since the very beginning, and I can only recommend it... give it a try!
FANTASTIC ROM great work is the BEST ROM I've never had, SPECTACULAR!
very very good rom grazie paolo
Hiya, well done m8!
....As Paolo said in his post, i've been betatester for LOL Rom.
Well this rom is absolutely stable, never had a crash since started to use it.
Scripts, reboot and recovery-reboot mods are a great add-on....
i never found something like this in any rom i tested in past.
I really hope our xda friends will appreciate this ROM as we do!!!
oki, be good.
Mickeyknox
good work man
Molto bella e velocissima!!!!!!!
Grazie Paolo
vicvic said:
Molto bella e velocissima!!!!!!!
Grazie Paolo
Click to expand...
Click to collapse
Vic i'm not sure (kidding) but i suppose u should write in english.... foreign guys wont understand italian....
Awsome!! Please, how you boot option into power-off menu?
you have to modify some xml in folder values in framework and the androidpolicy.jar
great works!!!
The_ERROR said:
Awsome!! Please, how you boot option into power-off menu?
Click to expand...
Click to collapse
i just modified the framework-res.apk and android.policy.jar
exact procedure I followed is hard to explain ...btw i started my work from this thread
http://forum.xda-developers.com/showthread.php?t=811532
I do get "preparing SD card"error(i'm ussin the 2gb card...
CrysiZ said:
I do get "preparing SD card"error(i'm ussin the 2gb card...
Click to expand...
Click to collapse
Do you get this error after having finished flashing?
I think the problem could be connected to app2sd...
usually it is not recommended to use it on lower class SD, better if class4 or higher..
So how kn i remove it?
very very good, thanks!
CrysiZ said:
So how kn i remove it?
Click to expand...
Click to collapse
I'm sorry, app2sd is part of the rom, and for the moment it's not possible to remove it without recompiling the whole...
But can you explain me WHEN exactly you get this error? During flash or afterwards? Did you manage to boot up the sistem at least once?
lol
excellent will give it a try. god with so many nand backups I am losing my train of thought.
Ye..it worked for 30 min or so and then it started to get this error.

[MOD][Updated:3/14/11]Toggle on/off entire CLOCK or just AM/PM from StatusBar - Sense

Update 3/14/2011: This mod was originally an exact port of the original referenced below, however, I've taken it a step further (and modified this post accordingly), to reflect the fact that in addition to the ability to remove am/pm from the 12-hour clock, you are now also presented with the option, via the 'Settings'/'Date & Time' menu, to remove the clock all together as well.
Okay guys, I originally "partially" ported this functionality by simply forcing the removal of the AM/PM indicators from the status bar clock all together.
However, I received a few PMs regarding the potential of doing the same as was done by s0niqu3 in his original mod, and since I had some free time this weekend, I decided to take a look. I have to be honest, I hate porting someone else's work, as I find it easier to just do it from scratch, rather than figuring out what someone else did, but the original mod did give me a good jump off point to implement this for our Sense based ROMs. Credit to s0niqu3 for the original mod.
The mod requires modifications to BOTH your Setting.apk file, as well as the services.jar framework file. So, I used as a starting point the services.jar file I've supplied in my Power Control Widgets thread, v2.1.1 (the most up to date version).
If you are running a 3.70 based ROM that does not use the power control widgets, or if your services.jar file has been further modified, you will have to manually modify your own services.jar file, and incorporate the changes I've made to the services.jar to support this feature, and as such, at the end of this post, I have included the single method that you should replace. As such, this post contains links to 2 different flashable zips. The first zip is the complete mod, which includes BOTH Settings.apk and services.jar. The second zip contains the Settings.apk file only, should you wish/need to modify your own services.jar file directly.
To access this feature / option, after flashing the supplied zip, click Menu, Settings, then Date & Time, and you will see the following:
Stock clock settings (default, no change):
{
"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"
}
Remove am/pm toggled:
Remove clock completely:
As you can see in the above screen shots, a new screen preferences have been added to the Date & Time menu. The first, labeled 'Show clock', is defaulted to 'on', and when un-checked, will disable the display of your clock in the status bar. The second, labeled "Do not display AM/PM", will cause the default AM/PM indicator to be removed while utilizing the 12-hour format time, when you have the clock set to visible. Unchecking this option will cause the AM/PM to return. Also, I added dependencies to the checkbox options, so that when/if the clock is disabled from display all together, the dependent options become unavailable as well.
Download Complete Mod for Clock Display Options <---Flash via recovery
Download Settings.apk Mod ONLY for supporting Clock Display Options <---Flash via recovery
Note: The complete mod replaces a framework file, and as such, your initial boot after flashing will take a while, as your Dalvik cache gets rebuilt. This mod REQUIRES your ROM to be deodexed (not stock rooted w/o flashing a custom ROM). Also, if you have made any other custom edits to your services.jar file, this will revert to stock. If you do NOT want to lose, consider modifying your own services.jar per the instructions below.
To manually modify your services.jar file to support the above referenced features, decompile your services.jar file and open /com/android/server/status/StatusBarPolicy.smali, and wholesale replace the updateClock() method in your existing file with the following tweaked version I've provided:
Code:
.method private final updateClock()V
.locals 7
.prologue
.line 940
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mCalendar:Ljava/util/Calendar;
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v1
invoke-virtual {v0, v1, v2}, Ljava/util/Calendar;->setTimeInMillis(J)V
.line 941
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;
iget-object v1, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;
invoke-static {v1}, Landroid/text/format/DateFormat;->getTimeFormat(Landroid/content/Context;)Ljava/text/DateFormat;
move-result-object v1
iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mCalendar:Ljava/util/Calendar;
invoke-virtual {v2}, Ljava/util/Calendar;->getTime()Ljava/util/Date;
move-result-object v2
invoke-virtual {v1, v2}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v1
iget-object v4, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v4}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v2, "am_pm"
const/4 v3, 0x0
invoke-static {v4, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-eqz v4, :cond_1
const-string v5, " PM"
const-string v6, ""
invoke-virtual {v1, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object v1
const-string v5, " AM"
const-string v6, ""
invoke-virtual {v1, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object v1
:goto_0
iget-object v4, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v4}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v2, "time_display"
const/4 v3, 0x1
invoke-static {v4, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-nez v4, :cond_0
const-string v1, ""
:cond_0
iput-object v1, v0, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
.line 942
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mService:Lcom/android/server/status/StatusBarService;
iget-object v1, p0, Lcom/android/server/status/StatusBarPolicy;->mClockIcon:Landroid/os/IBinder;
iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;
const/4 v3, 0x0
invoke-virtual {v0, v1, v2, v3}, Lcom/android/server/status/StatusBarService;->updateIcon(Landroid/os/IBinder;Lcom/android/server/status/IconData;Lcom/android/server/status/NotificationData;)V
.line 943
return-void
:cond_1
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;
invoke-direct {p0}, Lcom/android/server/status/StatusBarPolicy;->getSmallTime()Ljava/lang/CharSequence;
move-result-object v1
goto :goto_0
.end method
Once manually completing the mod above, you can then use the supplied Setting.apk file in conjunction with your manually edited services.jar file to toggle am/pm on off, or the display of the clock all together.
JsChiSurf said:
Okay guys, I originally "partially" ported this functionality by simply forcing the removal of the AM/PM indicators from the status bar clock all together.
However, I received a few PMs regarding the potential of doing the same as was done by s0niqu3 in his original mod, and since I had some free time this weekend, I decided to take a look. I have to be honest, I hate porting someone else's work, as I find it easier to just do it from scratch, rather than figuring out what someone else did, but the original mod did give me a good jump off point to implement this for our Sense based ROMs. Credit to s0niqu3 for the original mod.
The mod requires modifications to BOTH your Setting.apk file, as well as the services.jar framework file. So, I used as a starting point the services.jar file I've supplied in my Power Control Widgets thread, v2.1.1 (the most up to date version).
If you are running a 3.70 based ROM that does not use the power control widgets, you will have to manually modify your own services.jar file, and incorporate the changes I've made to the services.jar to support this feature, and as such, at the end of this post, I have included the single method that you should replace. As such, this post contains links to 2 different flashable zips. The first zip is the complete mod, which includes BOTH Settings.apk and services.jar. The second zip contains the Settings.apk file only, should you wish/need to modify your own services.jar file directly.
To access this feature / option, after flashing the supplied zip, click Menu, Settings, then Date & Time, and you will see the following:
As you can see in the above screen shots, a new screen preference has been added to the Date & Time menu labeled "Do Not Display AM/PM", and placing a checkmark in the corresponding box will cause the default AM/PM indicator to be removed while utilizing the 12-hour format time. Unchecking the option will cause the AM/PM to return.
Download Complete Mod for removing AM/PM from time <---Flash via recovery (old style update-script only)
Download Settings.apk Mod ONLY for supporting the removal of AM/PM from time <---Flash via recovery (old style update-script only)
Note: The complete mod replaces a framework file, and as such, your initial boot after flashing will take a while, as your Dalvik cache gets rebuilt. This mod REQUIRES your ROM to be deodexed (not stock rooted w/o flashing a custom ROM). Also, if you have made any other custom edits to your services.jar file, this will revert to stock. If you do NOT want to lose, consider modifying your own services.jar per the instructions below.
To manually modify your services.jar file to support dynamic removal of the am/pm indicator from your status bar clock, decompile your services.jar file and open /com/android/server/status/StatusBarPolicy.smali, and wholesale replace the updateClock() method in your existing file with the following tweaked version I've provided:
Code:
.method private final updateClock()V
.locals 7
.prologue
.line 940
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mCalendar:Ljava/util/Calendar;
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v1
invoke-virtual {v0, v1, v2}, Ljava/util/Calendar;->setTimeInMillis(J)V
.line 941
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;
iget-object v1, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;
invoke-static {v1}, Landroid/text/format/DateFormat;->getTimeFormat(Landroid/content/Context;)Ljava/text/DateFormat;
move-result-object v1
iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mCalendar:Ljava/util/Calendar;
invoke-virtual {v2}, Ljava/util/Calendar;->getTime()Ljava/util/Date;
move-result-object v2
invoke-virtual {v1, v2}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v1
iget-object v4, p0, Lcom/android/server/status/StatusBarPolicy;->mContext:Landroid/content/Context;
invoke-virtual {v4}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v2, "am_pm"
const/4 v3, 0x0
invoke-static {v4, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-eqz v4, :cond_0
const-string v5, " PM"
const-string v6, ""
invoke-virtual {v1, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object v1
const-string v5, " AM"
const-string v6, ""
invoke-virtual {v1, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
move-result-object v1
:cond_0
iput-object v1, v0, Lcom/android/server/status/IconData;->text:Ljava/lang/CharSequence;
.line 942
iget-object v0, p0, Lcom/android/server/status/StatusBarPolicy;->mService:Lcom/android/server/status/StatusBarService;
iget-object v1, p0, Lcom/android/server/status/StatusBarPolicy;->mClockIcon:Landroid/os/IBinder;
iget-object v2, p0, Lcom/android/server/status/StatusBarPolicy;->mClockData:Lcom/android/server/status/IconData;
const/4 v3, 0x0
invoke-virtual {v0, v1, v2, v3}, Lcom/android/server/status/StatusBarService;->updateIcon(Landroid/os/IBinder;Lcom/android/server/status/IconData;Lcom/android/server/status/NotificationData;)V
.line 943
return-void
.end method
Once manually completing the mod above, you can then use the supplied Setting.apk file in conjunction with your manually edited services.jar file to toggle am/pm on off.
Click to expand...
Click to collapse
Thank you sir!!
TMartin03 said:
Thank you sir!!
Click to expand...
Click to collapse
You're welcome .
AAAHHHHHH!!
I gotta get this smali/baksmali junk figured out! I need to remove the am/pm, gps reticule...
Thank you so much OP! Its good when the dev puts instructions for you to do it yourself. It was fairly simple. I used my classes.dex and it worked perfectly! And i don't even have to reboot for the am/pm to show or not show, action right away. Sweetness!
Thank you! I didn't think this would ever get done... time to update my Gingerbread theme
snandlal said:
Thank you so much OP! Its good when the dev puts instructions for you to do it yourself. It was fairly simple. I used my classes.dex and it worked perfectly! And i don't even have to reboot for the am/pm to show or not show, action right away. Sweetness!
Click to expand...
Click to collapse
Thanks for confirming it worked for you. It's always nice to hear that it has worked for someone other than yourself when releasing!
The services.jar side of the edit is rather straight forward, so it is relatively easy to post instructions when/if it is preferred to modify your own directly. The Settings.apk edits are MUCH more extensive, and in such an instance, or in other mod instances, it's not always as easy to do (post instructions).
datajosh said:
Thank you! I didn't think this would ever get done... time to update my Gingerbread theme
Click to expand...
Click to collapse
I was a reluctant participant as I remove the clock all together, but it seemed to be in enough demand that I finally gave in and took a look (I'm a modder of the people ). It didn't hurt that much of the legwork was already done, preventing me from having to figure out some of the details.
JsChiSurf said:
I was a reluctant participant as I remove the clock all together, but it seemed to be in enough demand that I finally gave in and took a look (I'm a modder of the people ). It didn't hurt that much of the legwork was already done, preventing me from having to figure out some of the details.
Click to expand...
Click to collapse
radical.
so how much do i have to donate for you to get into my services file to remove the am/pm and gps reticule for me?? keep getting invalid or corrupt jarfile baksmali.jar or i get unable to access jarfile baksmali
tailsthecat3 said:
so how much do i have to donate...
Click to expand...
Click to collapse
That's not how I, nor anyone else on this forum should "work". Donations are shown as an appreciation for one's effort, but not, IMHO, to be used as payment in advance of one's services.
Having said that, if you want offline help such as this, it is best to take it to a PM, as opposed to a thread post.
JsChiSurf said:
That's not how I, nor anyone else on this forum should "work". Donations are shown as an appreciation for one's effort, but not, IMHO, to be used as payment in advance of one's services.
Having said that, if you want offline help such as this, it is best to take it to a PM, as opposed to a thread post.
Click to expand...
Click to collapse
well, i did include the winky face...
thanks for your hard work
Great mod J! So easy to do and use.
One thing though, the first thing I noticed after flashing the file is that with the am/pm turned "on," the font for the am/pm is a lot larger than stock. Normally I believe it is 50% of the size now.
Whats next? Liked hearing about the contacts colors being switched black/white like mms. My friends here have been asking about Music.apk and it's black/white switch. Something to think about.
Peace man.
Thanks again!
_Burst_ said:
Great mod J! So easy to do and use.
One thing though, the first thing I noticed after flashing the file is that with the am/pm turned "on," the font for the am/pm is a lot larger than stock. Normally I believe it is 50% of the size now.
Click to expand...
Click to collapse
Keep in mind, almost ALL of the work is in Setting.apk .
Thanks for the heads up, you are right regarding the am/pm font size. I hadn't noticed. This is a factor of the port, where the am/pm font is of the same size as the digits. HTC did a custom formatting of the time. I think it should be a relatively easy fix, though it will take some custom/creative workarounds. Stay tuned.
OP has been updated with a fix for having the am/pm font size reduced, as expected (stock). If you've already downloaded, you can re-download and flash over top. The code for self-modifying has been updated as well.
Thanks again for the heads up.
Reference (corrected am/pm font size):
I flashed the file using amon_ra and it worked perfectly! However, I do have one concern.
A while back when I flashed this rom, there was a modification to this same services.jar that removed the GPS icon when it was not in use. Upon flashing this again, the icon resurfaced.
Can the two modifications coexist? Are you able to edit one on top of the other, or must you have to create a new file? Forgive my greed, but my interest to the thread was to save real estate on my notification bar.
Any and all input on the matter is much appreciated. Thanks again to the OP for the useful tweak!
Iilex said:
I flashed the file using amon_ra and it worked perfectly! However, I do have one concern.
A while back when I flashed this rom, there was a modification to this same services.jar that removed the GPS icon when it was not in use. Upon flashing this again, the icon resurfaced.
Can the two modifications coexist? Are you able to edit one on top of the other, or must you have to create a new file? Forgive my greed, but my interest to the thread was to save real estate on my notification bar.
Any and all input on the matter is much appreciated. Thanks again to the OP for the useful tweak!
Click to expand...
Click to collapse
As outlined in the OP, if you are running custom edits to the services.jar file, you will need manually apply either this mod to your existing services.jar for (using the instructions provided), or re-apply your other mods to the services.jar file provided in the OP.
JsChiSurf said:
Note: The complete mod replaces a framework file, and as such, your initial boot after flashing will take a while, as your Dalvik cache gets rebuilt. This mod REQUIRES your ROM to be deodexed (not stock rooted w/o flashing a custom ROM). Also, if you have made any other custom edits to your services.jar file, this will revert to stock. If you do NOT want to lose, consider modifying your own services.jar per the instructions below.
Click to expand...
Click to collapse
tailsthecat3 said:
well, i did include the winky face...
thanks for your hard work
Click to expand...
Click to collapse
Yes, I did see the winky face. Just wanted to state it for the record .
Found a very minute "issue" with the most recent code provided for self-modification. If you self modified using the version I supplied with the fix for am/pm size, you may want to re-apply once again.
The issue was not in the compiled version, just a copy / paste error on my side.
JsChiSurf said:
Found a very minute "issue" with the most recent code provided for self-modification. If you self modified using the version I supplied with the fix for am/pm size, you may want to re-apply once again.
The issue was not in the compiled version, just a copy / paste error on my side.
Click to expand...
Click to collapse
There was only an adjustment to the services.jar, right?
TMartin03 said:
There was only an adjustment to the services.jar, right?
Click to expand...
Click to collapse
Correct. But the issue was not in the compiled services.jar, just the provided code after making the am/pm change.

[MOD]/[HOWTO] 1x/3G Mod for S4 (MJA/MF9/MDL/JB)

Greetings and Salutations, Sprint Galaxy S4 Owners and other curious parties!
Disclaimer: Just reading this may cause your head to burst, your phone to catch fire, dogs and cats may do the tango! I am not responsible for any bad stuff that happens from you reading or acting on the information in this thread.
If any ROM authors want to use this fix in their ROMs, I'm completely cool with that. A quick kudos in your credits section would be nice, though.
Background: One of the things that really peeves me off about Sprint is that they want us to think we always have 3G service. I know that I don't have 3G in all of the areas I travel, and I also don't when I am roaming.
Thankfully, the fix is quite simple!
This was my primary reason for rooting my phone, that's how aggravating it is for me.
Let's change 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"
}
To this:
Credits
Calkulin - for getting me started on the crusade to expose Sprint's 1x evilness.
crawrj - for the stock rooted deodexed MDL/MF9 ROM I developed this on.
CNexus - for the stock rooted deodexed MJA ROM I developed this on.
Samsung - for a much better phone this time around than my previous E4GT.
The brave XDA members who try these instructions and report their success or failure!!!
XDA for being a great source of information!!!
XDA members for thinking outside of the box!!!
The fix:
This fix requires editing your SystemUI.apk file. If you are using one of the fine custom ROMs on XDA, be aware that the you or the author may have already made changes to the SystemUI.apk file, so using my file IS NOT RECOMMENDED.
If you are using the stock, deodexed MDL ROM or the Stock Rooted Deodexed ROM from crawrj, you can use my attached SystemUI.apk. There are also flashable ZIPs - flash at your own risk. BE SURE TO GET THE CORRECT VERSION FOR WHAT ROM YOU ARE ON! If you use the attached APKs, SystemUI.apk is for MDL, SystemUI-MF9.apk is for MF9, SystemUI-MJA.apk is for MFA. You must make sure the APK is called SystemUI.apk before pushing to your device.
This mod relies on the assumption that your ROM developer has not deleted any of the 1x graphic files in the ROM. The developer CAN theme or otherwise change the images as long as the file names remain the same.
What you need to perform this mod:
1. An Sprint Galaxy S4 ZIP file, or a phone running a Sprint Galaxy S4 ROM -- AOSP ROMs already have the correct indicators.
2. The Java SDK -- So you can run Smali.
3. Smali/Baksmali -- So you can decompile/compile the classes.dex file.
4. Android SDK -- To push/pull files from your phone (adb only).
5. Some sort of archive tool (such as WinRAR, 7zip, etc).
5. A text editor capable of editing UNIX-formatted files. I recommend Notepad++, personally.
Ease Of Use Tips: Install Java SDK first, then Android SDK (if you need adb). Download the smali files (smali-1.4.2.jar and baksmali-1.4.2.jar at the time of this writing) to a new "working" folder where we can do our magic. The beta smali/baksmali also work.
KEEP A COPY OF YOUR PRE-EDITED SYSTEMUI.APK FILE, just in case!
Instructions:
1a. [If you are using a ROM ZIP File]: Use 7zip/WinRAR/WinZip to open the ROM ZIP file. Navigate to system\app and extract SystemUI.apk to your "working" folder.
1b. [If you want to grab SystemUI.apk from your running phone]: Use adb to pull SystemUI.apk to your working folder. Example: adb pull /system/app/SystemUI.apk C:\Working\SystemUI.apk
To avoid problems, ONLY USE adb to pull/push SystemUI.apk. Phone apps may cause unknown issues.
2. Go to a command prompt in your "working" folder and run the following command: java -jar baksmali-1.4.2.jar -o SystemUI/ SystemUI.apk
3. Browse to your "working" folder and see that there is now an SystemUI folder inside, with other subfolders. Browse to SystemUI\com\android\systemui\statusbar\policy.
4. Edit the file called NetworkController.smali with your favorite UNIX-format compatible text editor and look for the following text. The key is to search for updateSPRDataNetType. Edit the line below that is in BOLD.
For MJA:
Code:
.line 1666
:pswitch_fc
[B]invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/NetworkController;->updateSPRDataNetType()V[/B]
goto/16 :goto_d
For MF9:
Code:
.line 1554
:pswitch_f2
[B]invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/NetworkController;->updateSPRDataNetType()V[/B]
goto/16 :goto_d
For MDL:
Code:
.line 1550
:pswitch_e3
[B]invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/NetworkController;->updateSPRDataNetType()V[/B]
goto/16 :goto_d
5. Change that line to say invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/NetworkController;->updateVZWDataNetType()V (change the SPR to VZW)
*** The above change will give you Verizon's data icons -- including their trademarked 4GLTE icon (instead of the default Sprint 4G icon). If you want the "correct" 4G icon, follow steps 5a-5c. If you like Verizon's icon, continue with step 6.
5a. Still in the NetworkController.smali file, look for the following text. The key is to search for DATA_4G_LTE: (please include the colon, because there are other DATA_4G_LTE lines for other carriers. Edit the lines below that are in BOLD.
For MJA:
Code:
.line 2219
:pswitch_11f
[B]sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_4G_LTE:[[I[/B]
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 2220
[B]const v0, 0x7f0200e0[/B]
iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
For MF9:
Code:
.line 1993
:pswitch_11f
[B]sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_4G_LTE:[[I[/B]
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1994
[B]const v0, 0x7f0200d2[/B]
iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
For MDL:
Code:
.line 1980
:pswitch_11f
[B]sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->DATA_4G_LTE:[[I[/B]
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1981
[B]const v0, 0x7f0200d6[/B]
iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
5b. Change the first line to say DATA_4G: instead of DATA_4G_LTE:. For MJA, change the second line to say 0x7f0200de instead of 0x7f0200e0. For MF9, change the second line to say 0x7f0200d0 instead of 0x7f0200d2. For MDL, change the second line to say 0x7f0200d4 instead of 0x7f0200d6.
5c. Your final version should look like this (my changes in BOLD):
For MJA:
Code:
.line 2219
:pswitch_11f
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->[B]DATA_4G:[/B][[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 2220
const v0, [B]0x7f0200de[/B]
iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
For MF9:
Code:
.line 1993
:pswitch_11f
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->[B]DATA_4G:[/B][[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1994
const v0, [B]0x7f0200d0[/B]
iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
For MDL:
Code:
.line 1980
:pswitch_11f
sget-object v0, Lcom/android/systemui/statusbar/policy/TelephonyIcons;->[B]DATA_4G:[/B][[I
iget v1, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mInetCondition:I
aget-object v0, v0, v1
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataIconList:[I
.line 1981
const v0, [B]0x7f0200d4[/B]
iput v0, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mDataTypeIconId:I
6. Save NetworkController.smali
7. Go back to your command prompt, change to your "working" folder and issue the following command: java -jar smali-1.4.2.jar SystemUI/ -o newclasses.dex
8. If there weren't any errors, go ahead and rename the original classes.dex to classes.old and rename newclasses.dex to classes.dex.
9. Open SystemUI.apk in your favorite archiver (if you closed it earlier).
10. Drag the file called classes.dex from your "working" folder into SystemUI.apk and replace the one already in there.
11. Run the following commands to get the file on your phone:
Code:
adb remount
adb push SystemUI.apk /system/app/SystemUI.apk
adb reboot
You should hear your bootup sound and then the changes should be instantly applied.
To Test:
1. Dial ##DATA# (##3282#) on your phone.
2. Enter your MSL (can be found by typing getprop ril.MSL from Terminal Emulator or adb shell). You may have to dial ##3282# and press "OK" without entering anything first.
3. Scroll to Others at the bottom of the list.
4. Click on HDR/1X Selection
5. Change from LTE + CDMA + EVDO Mode to CDMA Only Mode. This puts your phone in 1X only mode.
6. Press OK.
7. Verify 1X icon comes within 30 seconds, if you have service. Try toggling Airplane Mode if you have issues seeing the 1X icon the first time.
8. Repeat steps 4-7, substituting LTE + CDMA + EVDO for CDMA Only Mode to switch back.
How I found this: Sprint's updateDataNetType doesn't properly identify 1X - it shows up as 3G. I haven't spent enough time dabbling in the file to determine which code block "should" be the 1X -- however, the Verizon updateDataNetType works perfectly for us. On the E4GT, this change was much easier because the code for 1X was easier to work with. I may update this in the future with a "proper" fix. I have tested this on 1x/3G/4G networks while roaming without issue.
Please let me know whether or not this worked for you. I'd like to make a list of ROMs (with applicable mods) this works for or doesn't work for.
I will do whatever I can to help if you are struggling. If there's something you don't understand, please let me know. I can update the instructions if I accidentally wrote something wrong.
Reserved
This one is mine
Reserved
This one is also mine!
Very nice. I can't stand this always on 3g icon either. I know I'm on 1x quite a bit around my area.
Sent from my SPH-L720 using Tapatalk 4 Beta
Worked perfect on the Stock Deodexed Rom. Many Thanks!!
What would happen with an unlocked Sprint S4 if used overseas on GSM carriers? Would it know to display 2G for GSM/GPRS/EDGE and 3G for UMTS/WCDMA/HSPA?
I believe that would be the case. If you plan on using it as a world phone, I'd be very interested in your results!
myphone12345 said:
What would happen with an unlocked Sprint S4 if used overseas on GSM carriers? Would it know to display 2G for GSM/GPRS/EDGE and 3G for UMTS/WCDMA/HSPA?
Click to expand...
Click to collapse
Sent from my SPH-L720 using Tapatalk 2
Great! Did you use the attached APK, or did you try out the tutorial? If you did the tutorial, I had a typo earlier -- the steps 5a-5c said to change the 0x7f0200d6 to 0x7f0200d4, but I forgot to change the 6 to a 4 in my "after" code view. I fixed that this morning. As a FYI, if you don't change the 6 to a 4, it will keep the 4GLTE icon.
piaa_nissan said:
Worked perfect on the Stock Deodexed Rom. Many Thanks!!
Click to expand...
Click to collapse
After trying for an hour to get adb to work I cheated and just threw the systemui file into the rom and reflashed.
Sent via Galaxy SIV
maradonaiconboy said:
This one is mine
Clubvegas999
Click to expand...
Click to collapse
Did u seriously have to quote the entire post for that 5 word reply?
Anyway thanks for the mod works like a charm. I did it the manual way not using ur apk tho
ForceROM 2.0
Sent from my SPH-L720 using xda premium
Is there any way this can be made into a flashable zip?
4 Door Skyline said:
Is there any way this can be made into a flashable zip?
Click to expand...
Click to collapse
Same question. Can make via zip flashable ? Thanks before
andytm said:
Same question. Can make via zip flashable ? Thanks before
Click to expand...
Click to collapse
+3 !
4 Door Skyline said:
Is there any way this can be made into a flashable zip?
Click to expand...
Click to collapse
andytm said:
Same question. Can make via zip flashable ? Thanks before
Click to expand...
Click to collapse
Joe0113 said:
+3 !
Click to expand...
Click to collapse
A flashable ZIP was added to the first post. ZIP worked for me. Let me know if there are any problems with it.
nivron said:
A flashable ZIP was added to the first post. ZIP worked for me. Let me know if there are any problems with it.
Click to expand...
Click to collapse
Much appreciated! :good:
Updated for MF9
I haven't tested this yet as I don't have time to install the ROM, but I went ahead and updated it for MF9. Please try it out and let me know how it works.
Also if you cook it in yourself, make sure to realize that there are separate instructions for MF9/MDL in the OP! :victory:
Just curious, will this work on either odexed or deodexed?
Nice work. It worked great on MDL and I'm about to try it on MF9.
Sent from my SPH-L720 using Tapatalk 2
It should work on odexed if you delete /system/app/SystemUI.odex. I think my ZIP files do that automatically.
Foulwx said:
Just curious, will this work on either odexed or deodexed?
Nice work. It worked great on MDL and I'm about to try it on MF9.
Sent from my SPH-L720 using Tapatalk 2
Click to expand...
Click to collapse
Sent from my SPH-L720 using Tapatalk 2
nivron said:
It should work on odexed if you delete /system/app/SystemUI.odex. I think my ZIP files do that automatically.
Sent from my SPH-L720 using Tapatalk 2
Click to expand...
Click to collapse
Ah yes, I see that in the updater-script. Thanks!
Connected to my Sprint Airave on 1x
Connected to my Sprint Airave on 3G
On Wifi I get 32 Mbps Down and 13 Mbps Up
Sent from my SPH-L720 using xda app-developers app
**Thanks for this btw, Flashed 1x3G-Mod-jfltespr-MF9.zip in TWRP on my Odexed MF9 Stock Rom and worked perfectly. I was overwhelmed with the directions before seeing the zip, lol.

[MOD][DEV] Power Menu Soft-Reboot Option

WHAT IS THIS ?
soft reboot is different from normal reboot... it take very very less time to reboot, very useful if any app or mod require reboot...
while checking my smali skills got this .... so when you need to reboot just long press on power-off, bing.. it will take 25% of normal reboot time
STEPS:
#1:decompile android.policy.jar, goto com\android\internal\policy\impl\ ,open the file which is responsible for power-off...normally in all AOSP its GlobalActions$2.smali.... in other device it may be GlobalActions$3, $4....
HOW TO FIND THE CORRECT FILE ?
open the the file search for onPress()V , in that method it it have shutdown()V... then its Power-off method
#2:search for onLongPress()Z then in that method add the below code immidietly after onLongPress()Z,
Code:
.registers 4
const-string v1, "ctl.restart"
const-string v2, "surfaceflinger"
invoke-static {v1, v2}, Landroid/os/SystemProperties;->set(Ljava/lang/String;Ljava/lang/String;)V
const-string v2, "zygote"
invoke-static {v1, v2}, Landroid/os/SystemProperties;->set(Ljava/lang/String;Ljava/lang/String;)V
#3:save, compile... flash or push the new file...
NOTE : you can use the same method for adding long press options for reboot and recovery methods...
How about for normal reboot? Is it possible?
anerik said:
How about for normal reboot? Is it possible?
Click to expand...
Click to collapse
yup.. good idea... i will post tomarrow here...
akash akya said:
yup.. good idea... i will post tomarrow here...
Click to expand...
Click to collapse
That would be awesome! Since i tried to do an extended power menu but did not succeed, it would be nice to long-press shutdown = reboot and long-press airplane mode = recovery
akash akya said:
yup.. good idea... i will post tomarrow here...
Click to expand...
Click to collapse
Help me here bro
My GlobalActions$2.smali has this
Code:
# virtual methods
.method public onLongPress()Z
.registers 2
iget-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions$2;->this$0:Lcom/android/internal/policy/impl/GlobalActions;
#getter for: Lcom/android/internal/policy/impl/GlobalActions;->mWindowManagerFuncs:Landroid/view/WindowManagerPolicy$WindowManagerFuncs;
invoke-static {v0}, Lcom/android/internal/policy/impl/GlobalActions;->access$500(Lcom/android/internal/policy/impl/GlobalActions;)Landroid/view/WindowManagerPolicy$WindowManagerFuncs;
move-result-object v0
invoke-interface {v0}, Landroid/view/WindowManagerPolicy$WindowManagerFuncs;->rebootSafeMode()V
const/4 v0, 0x1
return v0
.end method
I delete the above method and added yours
then when i long press power button it reboots
i can't slect options but simply reboot and can't turn off as well
akash akya said:
WHAT IS THIS ?
soft reboot is different from normal reboot... it take very very less time to reboot, very useful if any app or mod require reboot...
while checking my smali skills got this .... so when you need to reboot just long press on power-off, bing.. it will take 25% of normal reboot time
Cool, but I used xposed framewok and added apm, in this app it gives you the option to soft reboot and others in the power menu
Click to expand...
Click to collapse
And someone knows where to find the file responsible for the "power menu" ????

[MOD] [HOW-TO] 4.4.2 TW Camera Shutter sound | Flash with low battery

Isn't my work all credits to @jobnik & @majdinj
original thread: http://forum.xda-developers.com/showthread.php?t=2038675
I made it only compatible with KitKat (4.4.2)
Root and deodexed SamsungCamera2.apk recommended.
Needed tools:
Backsmali/Smali
Notepad++
7Zip
1.) Baksmali SamsungCamera2.apk
1. Adding "Shutter Sound On/Off" option in Camera Menu:
Instead smali editing you can add this line to your others.xml (so you do not have to do step 2,3,4,5,6,7) :
Code:
<CscFeature_Camera_ShutterSoundMenu>TRUE</CscFeature_Camera_ShutterSoundMenu>
2.) Navigate to com\sec\android\app\camera\resourcedata folder
3.) Open CommonSettingsMenuResourceData.smali
find: "CscFeature_Camera_ShutterSoundMenu"
Add the blue line
Code:
.line 66
invoke-static {}, Lcom/sec/android/app/CscFeature;->getInstance()Lcom/sec/android/app/CscFeature;
move-result-object v0
const-string v1, [COLOR="DarkGreen"]"CscFeature_Camera_ShutterSoundMenu"[/COLOR]
invoke-virtual {v0, v1}, Lcom/sec/android/app/CscFeature;->getEnableStatus(Ljava/lang/String;)Z
move-result v0
[COLOR="Blue"]const/4 v0, 0x1[/COLOR]
if-eqz v0, :cond_a5
4.) Save and close
5.) Navigate to \com\sec\android\app\camera folder
6.) Open Camera.smali
find: "CscFeature_Camera_ShutterSoundMenu"
Add the blue line
Code:
const-string v22, "[COLOR="DarkGreen"]CscFeature_Camera_ShutterSoundMenu[/COLOR]"
invoke-virtual/range {v21 .. v22}, Lcom/sec/android/app/CscFeature;->getEnableStatus(Ljava/lang/String;)Z
move-result v21
[COLOR="Blue"]const/16 v21, 0x1[/COLOR]
if-nez v21, :cond_4a1
7.) Save and close
8.) Now open your customer.xml and delete the following line from it: <ShutterSound>on</ShutterSound>
Isn't included in every customer.xml..
Shutter sound selection will work only after Factory data reset
2. Camera can be used with flash in low battery state:
9.) Navigate to \com\sec\android\app\camera folder
10.) Open Camera.smali
find: .method protected handleLowBattery(Z)V
Add the blue line.
Code:
[COLOR="DarkGreen"].method protected handleLowBattery(Z)V[/COLOR]
.registers 9
.parameter "temp"
.prologue
const v6, 0x7f0c01cb
const v5, 0x7f0c001d
const/4 v4, 0x0
const/4 v3, 0x1
.line 3045
[COLOR="blue"]return-void[/COLOR]
const-string v1, "Camera2"
const-string v2, "handleLowBattery"
find: .method private handleBatteryChanged(Landroid/content/IntentV
now find: handleLowBattery(Z)V Delete the whole line which one contains it:
Code:
iput-object v2, p0, Lcom/sec/android/app/camera/Camera;->mPluggedLowBatteryPopup:Landroid/app/AlertDialog;
.line 2872
invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->finishTimerCount()V
.line 2873
[COLOR="Red"]invoke-virtual {p0, v5}, Lcom/sec/android/app/camera/Camera;->[/COLOR][COLOR="DarkGreen"]handleLowBattery(Z)V[/COLOR]
find: .method private handleBatteryChanged(Landroid/content/IntentV
now find: handlePluggedLowBattery(Z)V
Delete the whole line which one contains it, delete only the next three lines (search down with Notepad++)
Code:
.line 2843
[COLOR="Red"]invoke-direct {p0, v6}, Lcom/sec/android/app/camera/Camera;->[/COLOR][COLOR="DarkGreen"]handlePluggedLowBattery(Z)V[/COLOR]
.line 2864
:cond_bf
:goto_bf
iget v2, p0, Lcom/sec/android/app/camera/Camera;->battLevel:I
iget v3, p0, Lcom/sec/android/app/camera/Camera;->mLowBatteryWarningLevel:I
Code:
.line 2878
[COLOR="red"]invoke-direct {p0, v5}, Lcom/sec/android/app/camera/Camera;->[/COLOR][COLOR="DarkGreen"]handlePluggedLowBattery(Z)V[/COLOR]
.line 2879
iget-object v2, p0, Lcom/sec/android/app/camera/Camera;->mEngine:Lcom/sec/android/app/camera/CommonEngine;
invoke-virtual {v2, v8}, Lcom/sec/android/app/camera/CommonEngine;->isCurrentState(I)Z
move-result v2
if-nez v2, :cond_e3
.line 2880
[COLOR="Red"]invoke-direct {p0, v5}, Lcom/sec/android/app/camera/Camera;->[/COLOR][COLOR="DarkGreen"]handlePluggedLowBattery(Z)V[/COLOR]
find: .method private handlePluggedLowBattery(Z)V
Add the blue line.
Code:
[COLOR="DarkGreen"].method private handlePluggedLowBattery(Z)V[/COLOR]
.registers 9
.parameter "temp"
.prologue
const v6, 0x7f0c019a
const v5, 0x7f0c0199
const/4 v4, 0x1
const/4 v3, 0x0
.line 3102
[COLOR="blue"]return-void[/COLOR]
const-string v1, "Camera2"
const-string v2, "handlePluggedLowBattery"
11.) Save your changes
12.) Smali classout folder
13.) Add the new classes.dex file to SamsungCamera2.apk with 7Zip
14.) Push to your Phone
Nice?
Yes Tkari4. Good dev man. This mod going to be in 1.3 rom i think. [emoji6]
Envoyé de mon SM-N9005 en utilisant Tapatalk
micky387 said:
Yes Tkari4. Good dev man. This mod going to be in 1.3 rom i think. [emoji6]
Envoyé de mon SM-N9005 en utilisant Tapatalk
Click to expand...
Click to collapse
Yes, of course!
Shutter sound mod is fixed in the OP.
Now Off option can be selected:
{
"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"
}
tkari4 said:
Shutter sound mod is fixed in the OP.
Now Off option can be selected:
Click to expand...
Click to collapse
did you do factory reset? I deleted <ShutterSound>on</ShutterSound> and changed features.xml, but still cannot swicht it off,
is it possible not to do factory reset??
pir0texnik said:
did you do factory reset? I deleted <ShutterSound>on</ShutterSound> and changed features.xml, but still cannot swicht it off,
is it possible not to do factory reset??
Click to expand...
Click to collapse
I think no, because it's in the csc.
Sent from my SM-N9005 using Tapatalk
tkari4 said:
I think no, because it's in the csc.
Sent from my SM-N9005 using Tapatalk
Click to expand...
Click to collapse
I tried changing customer.xml and features.xml on 4.4.2 (Noto 3) and 4.3 (S3, Note 2). In both cases it was possible to switch on shutter sound menu, but it never changes state. It is always on, taping does not work. I baksmalied SamsungCamera2.odex and converted to java to undertand how does it work, but I am not a big specialist in java, maybe someone can help finally kill the sound...
pir0texnik said:
I tried changing customer.xml and features.xml on 4.4.2 (Noto 3) and 4.3 (S3, Note 2). In both cases it was possible to switch on shutter sound menu, but it never changes state. It is always on, taping does not work. I baksmalied SamsungCamera2.odex and converted to java to undertand how does it work, but I am not a big specialist in java, maybe someone can help finally kill the sound...
Click to expand...
Click to collapse
1.) Add this line
Code:
<CscFeature_Camera_ShutterSoundMenu>TRUE</CscFeature_Camera_ShutterSoundMenu>
to others.xml or to features.xml. (if you have booth, than features xml will be used)
add over </FeatureSet>
Code:
<CscFeature_Camera_ShutterSoundMenu>TRUE</CscFeature_Camera_ShutterSoundMenu>
</FeatureSet>
</SamsungMobileFeauture>
2.) Delete <ShutterSound>on</ShutterSound> or <ShutterSound>off</ShutterSound> from customer.xml
3.) Factory data reset
Should work..
tkari4 said:
1.) Add this line
Code:
<CscFeature_Camera_ShutterSoundMenu>TRUE</CscFeature_Camera_ShutterSoundMenu>
to others.xml or to features.xml. (if you have booth, than features xml will be used)
add over </FeatureSet>
Code:
<CscFeature_Camera_ShutterSoundMenu>TRUE</CscFeature_Camera_ShutterSoundMenu>
</FeatureSet>
</SamsungMobileFeauture>
2.) Delete <ShutterSound>on</ShutterSound> or <ShutterSound>off</ShutterSound> from customer.xml
3.) Factory data reset
Should work..
Click to expand...
Click to collapse
This method is invalid, because I am in the China, code named CHN CSC
Is there a way to remove CSC restrictions?
lijianjunyonghu said:
This method is invalid, because I am in the China, code named CHN CSC
Is there a way to remove CSC restrictions?
Click to expand...
Click to collapse
Sorry I can't help more..
I'm using it without problem in my Rom...
1. I put <CscFeature_Camera_ShutterSoundMenu>true</CscFeature_Camera_ShutterSoundMenu> in features.xml
2. I deleted <ShutterSound>on</ShutterSound> from customer.xml
3. I did factory data reset.
Now menu really works, but sound plays no matter what option is chosen...
I even added ro.camera.sound.forced=0 in build.prop and did factory data reset without any effect, shutter still plays.
Device is Galaxy S3, 4.3
tkari4 said:
Sorry I can't help more..
I'm using it without problem in my Rom...
Click to expand...
Click to collapse
Thank you
An Error Occured ...
Hi,
if I try to Baksmali the SasmungCamera2.apk I get an error, please see uploaded pics.
Google couldnt help me. What am I doing wrong?
Thanks
Alec86 said:
Hi,
if I try to Baksmali the SasmungCamera2.apk I get an error, please see uploaded pics.
Google couldnt help me. What am I doing wrong?
Thanks
Click to expand...
Click to collapse
As I see you are trying to modify one apk file from an odexed Rom.
SamungCamera2.apk must be deodexed first.
You need SamungCamera2.apk & SamungCamera2.odex. Deodex it, than you can make changes.
If your Rom is odexed, than push the modified SamungCamera2.apk back to your phone, than delete SamungCamera2.odex and reboot.
deodexed apk
tkari4 said:
As I see you are trying to modify one apk file from an odexed Rom.
SamungCamera2.apk must be deodexed first.
You need SamungCamera2.apk & SamungCamera2.odex. Deodex it, than you can make changes.
If your Rom is odexed, than push the modified SamungCamera2.apk back to your phone, than delete SamungCamera2.odex and reboot.
Click to expand...
Click to collapse
First thank you for your response,
I tried to deodexe with "Universal_Deodexer_V5" , I followed the instructions for this tool and deodexed SamungCamera2.apk. But I cannt still "baksmali" the apk. Same error.
I uploaded the log file from "Universal_Deodexer_V5"
Any idea?
Thanks
Alec86 said:
First thank you for your response,
I tried to deodexe with "Universal_Deodexer_V5" , I followed the instructions for this tool and deodexed SamungCamera2.apk. But I cannt still "baksmali" the apk. Same error.
I uploaded the log file from "Universal_Deodexer_V5"
Any idea?
Thanks
Click to expand...
Click to collapse
Try with this version, because you have the same error: http://forum.xda-developers.com/showpost.php?p=55233256&postcount=1
deodexed apk
tkari4 said:
Try with this version, because you have the same error: http://forum.xda-developers.com/showpost.php?p=55233256&postcount=1
Click to expand...
Click to collapse
Hi,
thank you again. Meanwhile I tried to enable/disable the shutter sound over the " features.xml" and it worked immediately. The shutter sound is now disabled PERMANENTLY, no matter if it disabled or enabled in the camera settings. The camera settings disable only the autofocus sound. I haven't do the factory reset, only wiped cache.
By the way, the fixed "Universal_Deodexer" works well. I Smali classout folder with our scripts and get "Moded_SamsungCamera2.apk" . The new Moded apk dont worke on my Phone (force close), what should I do (for the further experince)? I pushed the classes.dex in the deodexed apk, but still force close.
Alec86 said:
Hi,
thank you again. Meanwhile I tried to enable/disable the shutter sound over the " features.xml" and it worked immediately. The shutter sound is now disabled PERMANENTLY, no matter if it disabled or enabled in the camera settings. The camera settings disable only the autofocus sound. I haven't do the factory reset, only wiped cache.
By the way, the fixed "Universal_Deodexer" works well. I Smali classout folder with our scripts and get "Moded_SamsungCamera2.apk" . The new Moded apk dont worke on my Phone (force close), what should I do (for the further experince)? I pushed the classes.dex in the deodexed apk, but still force close.
Click to expand...
Click to collapse
Did you deleted the SamsungCamera2.odex from your phone?
Normally the Moded_SamsungCamera2.apk must work. (maybe the raw folder compression causing the problem in the apk)
Set the compression level before baksmali to 0.
Try to wipe dalvik-cache.
compression level
tkari4 said:
Did you deleted the SamsungCamera2.odex from your phone?
Normally the Moded_SamsungCamera2.apk must work. (maybe the raw folder compression causing the problem in the apk)
Set the compression level before baksmali to 0.
Try to wipe dalvik-cache.
Click to expand...
Click to collapse
I sat the compression level to 0 and it works Thank you again
My shutter sound is still disabled PMANENTLY, no matter if it disabled or enabled in the camera settings. Is this supposet to be?
Thanks

Categories

Resources