[How To] Fix Phantom Voicemail For Most ROMs - EVO 4G Android Development

The main post has several older ROMs that are not likely to change. If you are looking for newer ROMS like Decks ICS, CM9, AOKP, and MIUIv4 look at the end of the thread and work your way back. Most are fixes uploaded as attachments after request are made. Since there are so many updates I am not even going to try to keep the main thread current becuase of time constrants.
Thanks for your understanding,
JusticeAA
***********************************************************************
I know there are several Sprint users that are plagued with the native voicemail notification icon and message "New Voicemail (2) Dial ..." which is commonly referred to as the "phantom voicemail."
There is a "fix" in which you can call Sprint and activate an old phone but for some with government contacts and such that is not an option. I found a fix that should work with almost all ROMs since it changes the android side not the HTC side.
I have attached a flashable zip for several popular rom's to this post. For the DIY I will leave the walk through.
Basic knowledge and tools about decompiling and compiling apk's is required, do a search it will be helpful. For some reason I decompile with apkmultitool and recompile with apktool and have the best luck, your results may vary.
**Standard Disclaimer: Know what you are doing and backup anything before you change things. Google search is your friend.**
Here are the steps:
1. Extract the Phone.apk from your ROM and decompile.
2. Open \smali\com\android\phone\CallNotifier$1.smali if you are using a sense rom, I use Notepad++
3. Other roms you may have to search for it, MIUI has the section needed in CallNotifier$2.smali
3. Near the bottom of the small file you will see something like this:
.method public onMessageWaitingIndicatorChangedEnhanced(I)V
.locals 1
.parameter "count"
.prologue
.line 638
iget-object v0, p0, Lcom/android/phone/CallNotifier$1;->this$0:Lcom/android/phone/CallNotifier;
#calls: Lcom/android/phone/CallNotifier;->onMwiChanged(I)V
invoke-static {v0, p1}, Lcom/android/phone/CallNotifier;->access$000(Lcom/android/phone/CallNotifier;I)V
.line 639
return-void
.end method
Click to expand...
Click to collapse
If you can't find it use Notepad++ and search in multiple files for "onMessageWaitingIndicatorChanged"
In that section (between .method public... and .end method), change the line:
invoke-static {v0, p1}, Lcom/android/phone/CallNotifier;->access$000(Lcom/android/phone/CallNotifier;I)V
Click to expand...
Click to collapse
to:
return-void
Click to expand...
Click to collapse
Now it should look like this:
.method public onMessageWaitingIndicatorChangedEnhanced(I)V
.locals 1
.parameter "count"
.prologue
.line 638
iget-object v0, p0, Lcom/android/phone/CallNotifier$1;->this$0:Lcom/android/phone/CallNotifier;
#calls: Lcom/android/phone/CallNotifier;->onMwiChanged(I)V
return-void
.line 639
return-void
.end method
Click to expand...
Click to collapse
4. Save your smali and recompile, if you did it right there should be no errors (I always get errors in apkmultitool ,that is why I use apktool.)
5. Copy the classes.dex from your new apk build into the original apk to keep the original signature.
5. Push your modified Phone.apk back into /system/app and you should be good to go.
This is a much cleaner method then what I used before. This should reduce battery drain and prevent sudden closing of the Phone.apk.
THEY ARE FLASHABLE ZIPs. Make sure you wipe cache and dalvik first to be on the safe side.

Thanks for passing this on man. Imma have to try this.

I've called my phone, left a message. Dialed vm, erased message and the vm icon is gone after this.
Sent from my PC36100 using Tapatalk

Any chance of getting this fix in a zip file, or apk for us less techknow furtunate ?
Thanks

lionedas said:
Any chance of getting this fix in a zip file, or apk for us less techknow furtunate ?
Thanks
Click to expand...
Click to collapse
I uploaded the two that I have, what rom are you using? I obliviously won't have time to do every request but I can do some.

JusticeAA said:
I uploaded the two that I have, what rom are you using? I obliviously won't have time to do every request but I can do some.
Click to expand...
Click to collapse
Radiance RC4
so I think the rcmix you posted should work right ?
Edit: after looking at them I dont think they are the same, I am post phone.akp from RC4
incase you get time to mod it.
Thanks again

lionedas said:
Radiance RC4
so I think the rcmix you posted should work right ?
Click to expand...
Click to collapse
Its based off the same build so it should, fyi Radiance RC5 is out now.
Make a nandroid first so you can go back if it doesn't work.

sizes are different posted apk above
RC4 and RC5 use the same phone.apk so it should be good for guys needing it for both..

lionedas said:
sizes are different posted apk above
RC4 and RC5 use the same phone.apk so it should be good for guys needing it for both..
Click to expand...
Click to collapse
I just upload the modded Radiance Phone.apk. The archive was giving me trouble in 7zip but I think I got it straightened out.
Please let me know if it works.

Anyone have any how to links, or ? on getting system apk's installed
Thanks

Nice job.Thank you

Any chance you can do CyanogenMod 7.2?

nydriek said:
Any chance you can do CyanogenMod 7.2?
Click to expand...
Click to collapse
There should already be a setting in CM7 for that. If you go into settings, then phone settings, one of the options is something like display voicemail notifications. Make sure that is off and they should be gone.

lionedas said:
Anyone have any how to links, or ? on getting system apk's installed
Thanks
Click to expand...
Click to collapse
Sorry about being so lazy, I am testing out making flashable zips and will upload them as soon as they are done.

Flashable zips are up, the only one I have test is for RCMix3D, so please let me know.

lionedas said:
Radiance RC4
so I think the rcmix you posted should work right ?
Edit: after looking at them I dont think they are the same, I am post phone.akp from RC4
incase you get time to mod it.
Thanks again
Click to expand...
Click to collapse
4 and 5 are up, in case you want to update!

Hey, think you can make one for nrg energy Rom? I was tryin your method but screwed up a few times. A flashable zip would be awesome
Sent from my PC36100 using xda premium

Steven 1 said:
Hey, think you can make one for nrg energy Rom? I was tryin your method but screwed up a few times. A flashable zip would be awesome
Sent from my PC36100 using xda premium
Click to expand...
Click to collapse
Done, please report back on how it works.

AOSP?
ive tried to decompile this using apktool for miui and it keeps telling me that it cant decode attr value like 487536705398 times its crazy any solutions?

dvickers said:
ive tried to decompile this using apktool for miui and it keeps telling me that it cant decode attr value like 487536705398 times its crazy any solutions?
Click to expand...
Click to collapse
MIUI is totally different, I was able to decompile it with apkmultitool by using the framework as a dependency.
The code is in a totally different place too and it already used the (Z) value. I did a small modification and it compiled without errors but that doesn't mean it will work.
(removed)

Related

Is it possible to get live wallpaper working on the eris build?

I'm working on a Rom based off fresh's eris build but I want live wallpapers with sense. I flashed the fix that is posted on geekfor.me but I get a force close because the rosie isn't compatible. Does anyone know what I can do to get it working?
Note:I pushed the LiveWallpapers.apk and LiveWallpaperspicker.apk to /system/app but the option still doesnt come up to select the live wallpapers. Thank you
tjohnsonjr said:
I'm working on a Rom based off fresh's eris build but I want live wallpapers with sense. I flashed the fix that is posted on geekfor.me but I get a force close because the rosie isn't compatible. Does anyone know what I can do to get it working?
Note:I pushed the LiveWallpapers.apk and LiveWallpaperspicker.apk to /system/app but the option still doesnt come up to select the live wallpapers. Thank you
Click to expand...
Click to collapse
would you mind posting the Rosie.apk and odex (if there is an odex) and i can do it for you
Or if you wanna do it by yourself, baksmali the rosie.apk or rosie.odex and edit the Deviceflag smali changing the line
Code:
.method public static isLiveWallaperSupported()Z
.registers 1
.prologue
.line 8
[B]const/4 v0, 0x0[/B]
return v0
.end method
to
Code:
.method public static isLiveWallaperSupported()Z
.registers 1
.prologue
.line 8
[B]const/4 v0, 0x1[/B]
return v0
.end method
.................
Here you go THANK YOU!!!
oh, i also need your frameworks so i can deodex it
http://www.4shared.com/file/qBCWfqT9/framework.html
tjohnsonjr said:
http://www.4shared.com/file/qBCWfqT9/framework.html
Click to expand...
Click to collapse
ok, so the eris build apparently doesn't have a deviceflags.smali, so i took the liberty of making one with the proper modifications. tell me how it goes. push the odex first, then the apk to /system/app
thank you so much. I'll let you know how it works
Sent from my HERO200 using the XDA mobile application powered by Tapatalk
Didn't work. The phone won't go pass the boot screen.

[updated][MOD][SENSE4]Autorotate Rosie

Update: corrected issue wile adding shortcut.
Hello,
Here is autorotate Rosie.apk for Sense4 build (1.53), just install it in recovery.
Hope you like it!
edit: I haven't seen that Baadnews has done it before me,so it's not his apk, it's really my work. Please don't tell me I'm a kanger.
edit2: Baad's version is better because you can toggle autorotate on/off with modded dev-tools apk, in my version it's hard coded in Rosie.apk without ability to disable it. Here is the link to Baad's post: http://forum.xda-developers.com/showpost.php?p=24074180&postcount=1678
Is that from you?
send with HTC Sensation powered by Sense 4 using Tapatalk 2
Yes, just some smali files to edit.
Note for themers: You only need to replace classes.dex in Rosie.apk.
strange I saw this already few days ago in Insert Coin Beta topic...
madtrexx said:
strange I saw this already few days ago in Insert Coin Beta topic...
Click to expand...
Click to collapse
In insertcoin topic is a apk and no apk in this topic Just a zip flash ^^
madtrexx said:
strange I saw this already few days ago in Insert Coin Beta topic...
Click to expand...
Click to collapse
I didn't follow this thread, so I didn't see baad has done it before me, and I have done it MYSELF, I am not a kanger.
All apologize to baad.
dude, do not worry, you are not a kanger, all your work is very appreciated. keep up the good work, and if you ever need help or an advice feel free to ask
Very thx for fix this bug
nono2lozere said:
Yes, just some smali files to edit.
Note for themers: You only need to replace classes.dex in Rosie.apk.
Click to expand...
Click to collapse
Anyway you could post/pm the smali edits you made. I want to try and see if it will work on Sense 4.0 Lite for the HTC One V ports.
obviously i tried your apk and baads one but as expected they didn't work!
scaryshark said:
Anyway you could post/pm the smali edits you made. I want to try and see if it will work on Sense 4.0 Lite for the HTC One V ports.
obviously i tried your apk and baads one but as expected they didn't work!
Click to expand...
Click to collapse
Hello,
Decompile Rosie.apk, go to Rosie/smali/com/htc/launcher/settings/ (or Rosie\smali\com\htc\laucher\settings\ if you're using Windows), open SettigUtil.smali.
Search isSupportOrientationChange()Z method and replace it with:
Code:
.method public static isSupportOrientationChange()Z
.locals 1
.prologue
.line 341
const/4 v0, 0x1
return v0
.end method
Compile, replace classes.dex in original apk, push apk to /system/app.
That's all!
nono2lozere said:
Hello,
Decompile Rosie.apk, go to Rosie/smali/com/htc/launcher/settings/ (or Rosie\smali\com\htc\laucher\settings\ if you're using Windows), open SettigUtil.smali.
Compile, replace classes.dex in original apk, push apk to /system/app.
That's all!
Click to expand...
Click to collapse
just got home now, unfortunatley there isn't an entry for that in the smali code, i guess i'll have to try something else.

[HOW-TO][4.1.2] Proper home button lagfix

Hello xda'ers,
someone reading the title may say: but we still have no home button lag!
You could link me Oliwe's mod but this is a different thing.
His fix or mod consist to disable mHomeKeyDoubleClickConcept launching directly launchHomeFromHotKey()V method.
Nothing bad until you hate to have double click feature to launch vlingo (or voice commands).
If you want NO LAG and keep the double click feature?
Now there s a real fix to the home button lag, no workaround, no disabling samsung features! :victory:
We need to place a single line into a .smali file inside our android.policy.jar called PhoneWindowManager.smali.
This mod it s really simple to do, there s no :cond_xx to replace, add or remove.
Simply add green part
Code:
.line 3267
.end local v38 #statusbar:Lcom/android/internal/statusbar/IStatusBarService;
:cond_304
:goto_304
const/16 v46, 0x0
move/from16 v0, v46
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHomePressed:Z
[COLOR="DarkGreen"]invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V[/COLOR]
Now we launch home before double click is recognized, but.. we re doing this twice, so we need to delete the second launch.
In fact if we take a look at PhoneWindowManager$HomeKeyDoubleClickConcept.smali we can see, at the end of singleClickJob()V method (red lines)
Code:
[COLOR="Red"]if-eqz v7, :cond_93[/COLOR]
const-string v7, "HomeKeyDoubleClick"
const-string v8, " in singleClickJob(), mSentHomeDownToApp is false. Now call launchHomeFromHotKey()"
invoke-static {v7, v8}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 8201
[COLOR="Red"] :cond_93
iget-object v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
invoke-virtual {v7}, Lcom/android/internal/policy/impl/PhoneWindowManager;->launchHomeFromHotKey()V
[/COLOR] goto :goto_48
.line 8203
:cond_99
iget-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$HomeKeyDoubleClickConcept;->DEBUG:Z
if-eqz v7, :cond_48
const-string v7, "HomeKeyDoubleClick"
const-string v8, " in singleClickJob(), mSentHomeDownToApp is true. now set mSentHomeDownToApp to false and do nothing."
invoke-static {v7, v8}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_48
.end method
that we re launching again "launchhomefromhotkey" method, so we need to delete the red lines.
This will fix home button lag, won t let u return on default homescreen (but u will get the homescreen u were before) and no more problem with apex or other non touchwiz launchers.
it s so easy that maybe samsung someday will implement it this way lol
that s all.
Easy to do
recompile and enjoy your no lag home button with double click feature.
need a zip? Send me your android.policy.jar or request this mod to your rom maker.
download for phoenix v5
HERE
in case of problems restore your old android.policy, u can get it on 3rd post, Androssama's courtesy
Mirko ddd said:
recompile and enjoy your no lag home button with double click feature.
Click to expand...
Click to collapse
I would've loved to be able to do so . Problem is I don't know what to use to edit apk files. Care to share what a begginer should have in his android tool-case?
Mirko ddd said:
need a zip? Send me your android.policy.jar or request this mod to your rom maker.
Click to expand...
Click to collapse
I attached the file from Phoenix v5 (ZSDMA6 base)
Androssama said:
I would've loved to be able to do so . Problem is I don't know what to use to edit apk files. Care to share what a begginer should have in his android tool-case?
I attached the file from Phoenix v5 (ZSDMA6 base)
Click to expand...
Click to collapse
Thanks, i ll zip asap. I m not home now
EDIT: got it on 2nd post, cheers
can tis work on stock rooted?? MA6..
Same for me, I don't know how to compile. Maybe my android.policy.jar is the same than Androssama's. I'm from Android Revolution HD 10.0.
Thanks.
Edit : When we have the zip, we have to flash it or just extract and replace android.policy. jar in /system/framework ?
Could you do this with Xposed framework. ....?
That would be easier...
Sent from my GT-N7100 using Tapatalk HD
Mirko, can I ask what do you use to decompile/recompile smali?
Every time I try (granted it was ages ago) I always get errors
Uvoguine said:
Same for me, I don't know how to compile. Maybe my android.policy.jar is the same than Androssama's. I'm from Android Revolution HD 10.0.
Thanks.
Edit : When we have the zip, we have to flash it or just extract and replace android.policy. jar in /system/framework ?
Click to expand...
Click to collapse
i just needed one to test if worked, source is in OP, tutorial is easy, so every rom maker can include it with proper credits.
amg009 said:
Could you do this with Xposed framework. ....?
That would be easier...
Sent from my GT-N7100 using Tapatalk HD
Click to expand...
Click to collapse
yes i can, but it s not my buisness since i have no roms here. u can ask it to your rom maker, source is in OP
CitizenLee said:
Mirko, can I ask what do you use to decompile/recompile smali?
Every time I try (granted it was ages ago) I always get errors
Click to expand...
Click to collapse
probably because u do it with apktool.best way is to use smali/baksmali directly from the SDK.
Hi Mirko,
Could you modify it for me? I'm using Wanamlite 2.8 MA3 rom, attached is the android.policy.jar
Thanks!!
amg009 said:
Could you do this with Xposed framework. ....?
That would be easier...
Sent from my GT-N7100 using Tapatalk HD
Click to expand...
Click to collapse
Yep, it would be gr8 if someone could implement this through Xposed framework....
Sorry to dig this up but I couldnt find another proper solution.
How can I achieve this on 4.3 (DN3 ROM)?

[MOD] H+ Icon for HSPA+ and HSPAP network for Android 4.2.2

Im separated icons for HSDPA and HSPA+ networks
Now it shown H or H+ in status bar according to the network types
rollon76 said:
Im separated icons for HSDPA and HSPA+ networks
Now it shown H or H+ in status bar according to the network types
Click to expand...
Click to collapse
Can you share with us, which files you have edited to get it work?
old.splatterhand said:
Can you share with us, which files you have edited to get it work?
Click to expand...
Click to collapse
Many.Its a animated icons
Replace in \SystemUI\smali\com\android\systemui\statusbar\policy\HtcGenericNetworkController.smali
.line 1507
:cond_44
sget-object v0, Lcom/android/systemui/statusbar/policy/HtcTelephonyIcons;->HTC_DATA_H:[I
to
sget-object v0, Lcom/android/systemui/statusbar/policy/HtcTelephonyIcons;->HTC_DATA_HPLUS:[I
then copy png and xml files from zip and recompile
I mean only the H+ Icon, not the others (animated).
So, it is more than on 4.1.2...
H+ Icon for HSPA+ and HSPAP network for Android 4.4.2 for HTC ONE
H+ Icon for HSPA+ and HSPAP network for Android 4.4.2 for HTC ONE (tested ViperOne 6.2.1 1.54.401.5)
How to:
First make a backup
1. Decompile your SystemUI.apk
2. Navigate to smali/com/android/systemui/statusbar/policy/HtcGenericNetworkController.smali
3. Find the method .method private final updateDataNetType()V
4. Find the smali code (Line 5497)
if-nez v29, :cond_25
sget-object v29, Lcom/android/systemui/statusbar/policy/HtcIcons;->HTC_DATA_H:[I
5. Replace HTC_DATA_H by HTC_DATA_HPLUS
if-nez v29, :cond_25
sget-object v29, Lcom/android/systemui/statusbar/policy/HtcIcons;->HTC_DATA_HPLUS:[I
6. Recompile the file and replace in the phone
7. Enjoy it
8. Click thanks button
9.
rollon76 said:
Credits to rollon76 by the Idea
Click to expand...
Click to collapse
dmonium said:
H+ Icon for HSPA+ and HSPAP network for Android 4.4.2 for HTC ONE (tested ViperOne 6.2.1 1.54.401.5)
How to:
First make a backup
1. Decompile your SystemUI.apk
2. Navigate to smali/com/android/systemui/statusbar/policy/HtcGenericNetworkController.smali
3. Find the method .method private final updateDataNetType()V
4. Find the smali code (Line 5497)
if-nez v29, :cond_25
sget-object v29, Lcom/android/systemui/statusbar/policy/HtcIcons;->HTC_DATA_H:[I
5. Replace HTC_DATA_H by HTC_DATA_HPLUS
if-nez v29, :cond_25
sget-object v29, Lcom/android/systemui/statusbar/policy/HtcIcons;->HTC_DATA_HPLUS:[I
6. Recompile the file and replace in the phone
7. Enjoy it
8. Click thanks button
9.
Click to expand...
Click to collapse
Will this work for M8 Marshmallow?
isimsizkullan said:
Will this work for M8 Marshmallow?
Click to expand...
Click to collapse
Yes. Insert Coin with MM base has it already (a long time).
old.splatterhand said:
Yes. Insert Coin with MM base has it already (a long time).
Click to expand...
Click to collapse
I dont want to change ROM, if i download the rom and pull the SystemUI.apk and flash it to my current system, will this work? Or am i have to recompile the SystemUI.apk myself?
isimsizkullan said:
I dont want to change ROM, if i download the rom and pull the SystemUI.apk and flash it to my current system, will this work? Or am i have to recompile the SystemUI.apk myself?
Click to expand...
Click to collapse
You are better to go and recompile SystemUI by yourself, i think.
You also can try with the apk from IC, but make a backup in recovery before.
old.splatterhand said:
You are better to go and recompile SystemUI by yourself, i think.
You also can try with the apk from IC, but make a backup in recovery before.
Click to expand...
Click to collapse
Sure, i will make a backup.
If you are using this "Insert Coin" ROM, can you upload SystemUI.apk? My connection is slow, downloading the whole ROM takes hours.
I am trying to decompile SystemUI.apk with Advanced Apk Tool but there is no smali folder.
isimsizkullan said:
Sure, i will make a backup.
If you are using this "Insert Coin" ROM, can you upload SystemUI.apk? My connection is slow, downloading the whole ROM takes hours.
I am trying to decompile SystemUI.apk with Advanced Apk Tool but there is no smali folder.
Click to expand...
Click to collapse
Here you go. Good luck.
old.splatterhand said:
Here you go. Good luck.
Click to expand...
Click to collapse
Thanks.
Did not work, SystemUI doesn't launch, i installed the old one back.
And i found out that to edit smali, the apk must be deodexed, is that right? I am on stock right now which means odexed.
isimsizkullan said:
Will this work for M8 Marshmallow?
Click to expand...
Click to collapse
Yes, this works with all htc phones, you only should find the line specific
if you like, you can send me the systemUI and I can modify it
dmonium said:
Yes, this works with all htc phones, you only should find the line specific
if you like, you can send me the systemUI and I can modify it
Click to expand...
Click to collapse
I was afraid to ask, thank you.
I uploaded the odex file too, i dont know if you need that but just in case.
DEODEX
isimsizkullan said:
I was afraid to ask, thank you.
I uploaded the odex file too, i dont know if you need that but just in case.
Click to expand...
Click to collapse
For make this mod is necessary deodex the apks (smali code is in the odex file)
I need the apks from framework too
dmonium said:
For make this mod is necessary deodex the apks (smali code is in the odex file)
I need the apks from framework too
Click to expand...
Click to collapse
Do you mean framework-res.apk?
all files apks and respective odex from /system/framework folder
dmonium said:
all files apks and respective odex from /system/framework folder
Click to expand...
Click to collapse
I am uploading the whole folder. I will give the link in ten minutes.
---------- Post added at 05:15 PM ---------- Previous post was at 04:49 PM ----------
dmonium said:
all files apks and respective odex from /system/framework folder
Click to expand...
Click to collapse
Sorry, my connection sucks.
Here: https://www.dropbox.com/s/qxwntsnh1zw9sjj/framework.zip?dl=0

[MOD][Guide][How to] Translatable 4-way reboot - outsource hard code to resources

Hello guys!
This guide is a small addendum to the popular mod that's included in almost every tw rom today - 4 way reboot.
As you all know for now the 4 way reboot has an array of items that are hard coded into the smali. So... no matter what locale you're on, it will always be in english. You can of course translate it in the smali (let's say to italian), but then in all the locales it will be in italian.
I don't like hard coding. So I will share with you an easy and elegant way to bring this mod to the way android is intended to be. We will outsource the char sequence back where those items belong - to strings in resources. So when you switch to a different locale, your reboot menu will show in that locale's language. Provided you modified that locale like we will do now...
Preliminary requiremtns:
1. Basic knowledge in compiling and decompiling of apks
2. Text/xml editor
3. About 10 mins of your time
4. Working 4-way reboot for tw roms (use this guide for example)
5. A deodexed TW rom
So let's get cracking:
1. Decompile framework-res.apk for your build. Navigate to res/values/strings.xml
Scroll to the bottom and right before the line that says </resources> add a new line. We will add a new string.
(btw really no need to do that at the bottom of the screen - you can add anywhere).
I just like all the strings I am adding to be at the bottom - easier to find
2. So we do something like this...
Code:
<string name="reboot_title">Advanced reboot menu</string>
This will be the title of our reboot menu. You can choose any name for the string and have any content. Like "Bob's rom reboot menu"...
Save strings.xml
3. Navigate back to values folder and open arrays.xml
Scroll down and just like we did with strings.xml, we will add a new array of strings.
Like so...
Code:
<string-array name="restart_menu">
<item>Reboot Phone</item>
<item>Fast Boot</item>
<item>Download Mode</item>
<item>Recovery Mode</item>
</string-array>
You can choose any other name for your array or change the names of the items. BUT YOU CANNOT CHANGE THEIR ORDER!!!
Save arrays.xml
4. Now, we did all that so we can have it translatable to different locales. So lets do that. We will use Italian language as an example.
5. Navigate to res/values-it/strings.xml and copy the string you created in values/strings.xml to the end of the file.
Change the content of the string to the one in Italian. Like so...
Code:
<string name="reboot_title">Menu riavvio avanzato</string>
Note that the name of the string should remain THE SAME as in values/strings.xml
Save the italian strings.xml
6. Now we do the same to values-it/arrays.xml
Code:
<string-array name="restart_menu">
<item>Riavviare il dispositivo</item>
<item>Riavvio Rapido</item>
<item>Modalità Recovery</item>
<item>Modalità Download</item>
</string-array>
7. Save all your modified files and compile framework-res.apk
8. We're not done with it yet. Now decompile it and navigate to values/public.xml.
Open it in the text/xml editor and leave it open. We will use it in a little while.
9. Decompile (or backsmali) android.policy.jar
You should already have the 4 way reboot incorporated. (see requirements for the guide!!!)
Navigate to smali/com/android/internal/policy/impl/GlobalActions$99.smali
10. Search ro the following line:
invoke-direct {v1, v2}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/ContextV
Right underneath it you will see the following:
const-string v2, "Reboot Menu"
This initializes the string builder for our dialog. This will send the string "Reboot Menu" to the register v2.
This is the "Hard Coding" that we want to avoid. So we change it. Instead we will send an integer to the register v2.
And that integer will be the public id for the string we created in strings.xml.
So go to your open public.xml file and search for the public id that the compiler created for our new string.
The easiest way to search would be by the name of the string. In this case would be reboot_title
Now what I find is this <public type="string" name="reboot_title" id="0x01040b8a" />
Your number could be different from mine... You use yours...
Copy ONLY the public id (in my case 0x01040b8a) and go back to your GlobalActions$99.smali file
Change
Code:
const[COLOR="Blue"][I][B]-string v2, "Reboot Menu"[/B][/I][/COLOR]
To
Code:
const [COLOR="Red"]v2, 0x01040b8a[/COLOR]
11. Now that we "fed" the public id to our register, we need to make sure the methos is USING it.
So The next line we change
From
Code:
invoke-virtual {v1, v2}, Landroid/app/AlertDialog$Builder;->setTitle([COLOR="Blue"]Ljava/lang/CharSequence;[/COLOR])Landroid/app/AlertDialog$Builder;
To
Code:
invoke-virtual {v1, v2}, Landroid/app/AlertDialog$Builder;->setTitle([COLOR="Red"]I[/COLOR])Landroid/app/AlertDialog$Builder;
So basically we said: do not use the char sequence, use the resources and find by ID that we fed into the register.
12. Now we do the same for the items in our reboot options.
Go back to the public.xml and find the public id for the array of strings we created in arrays.xml.
Search by name. I gave it a name restart_menu.
So I find this:
<public type="array" name="restart_menu" id="0x0107005e" />
We copy the public id 0x0107005e (remember - you use YOURS) and we go back to the smali.
13. Find this line and delete it:
Code:
sget-object v2, Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;->rebootOptions:[Ljava/lang/String;
Instead we put:
Code:
const v2, 0x0107005e
14. Now about 9 lines later you will see this monstrosity:
invoke-virtual {v1, v2, v3, v4}, Landroid/app/AlertDialog$Builder;->setSingleChoiceItems([Ljava/lang/CharSequence;ILandroid/content/DialogInterface$OnClickListenerLandroid/app/AlertDialog$Builder;
Basically it goes like this:
"We're gonna set the choice items for our reboot dialog.
We're gonna take them from the object called char sequence that we specified earlier
and assign it a function of doing something on click and use a function called Alert dialog builder"
Well, we don't want to use the char sequence. We want to use an integer we wrote into the v2 register.
So we change this:
Code:
invoke-virtual {v1, v2, v3, v4}, Landroid/app/AlertDialog$Builder;->setSingleChoiceItems([COLOR="Blue"][Ljava/lang/CharSequence;[/COLOR]ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;
To:
Code:
invoke-virtual {v1, v2, v3, v4}, Landroid/app/AlertDialog$Builder;->setSingleChoiceItems([COLOR="Red"]I[/COLOR]ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;
15. That's it. Save the edited smali and comlpile (or smali) android.policy.jar
MAKE BACKUP!!! Either nandroid or just have your working framework-res.apk and android.policy.jar in a flashable zip on your phone!!!!!!!​
16. Install both your modified framework-res.apk and your modified android.policy.jar into your device.
Flashing in recovery is recommended for framework jars.
If it reboots in the middle of you copying it into the system/framework you're in for alot of pain...
Well not actually pain but it will be either adb push, or rom reflash or backup framework files reflash in recovery.
Well, that's all!!! If you guys find it useful - use it and enjoy!
You can now translate your 4-way reboot to as many locales as you want.
Ask your users for help. Ask people from all around the world to translate those strings for you and put them in their locale in framework-res.
Most importantly - HAVE FUN!
No credit needed, no need to ask for permission to use it.
You can modify and redistribute and include in your rom - whatever!!! It's based on open source. It belongs to everyone!!!
As you can see - no flashable zips or ready made smali files are included. This is a "How-to" guide. Means - DO IT YOURSELF!!!
Cheers!!!
Hy mate ! Thanks for sharing this ! :good:
Great work Thanks for sharing girl.
That' s awesome!!! Thanks a lot
You are the best. All 4-way mods should be made this way . Clean, non hard coded, the way android is supposed to be ! Loved your mod since you did it on our beloved S2. Thanks for an excellent guide.
Thomas
DaOldMan said:
You are the best. All 4-way mods should be made this way . Clean, non hard coded, the way android is supposed to be ! Loved your mod since you did it on our beloved S2. Thanks for an excellent guide.
Thomas
Click to expand...
Click to collapse
A student can only be as good as their mentor! Thank YOU! For everything! ???
Inviato dal mio SM-G900F utilizzando Tapatalk
Thanks for sharing this guide my friend, good job :good:
Hi Dax! Awesome job you´ve done! Thx from me and the Echoe Members! :good::highfive::good:
Claudia! ​
YukiChan456 said:
Hi Dax! Awesome job you´ve done! Thx from me and the Echoe Members! :good::highfive::good:
Claudia! ​
Click to expand...
Click to collapse
thank you, Claudia! Great to see you here, my dear!!!
Offtopic: I was never gone. I 'm just always busy with the new forum and working! :silly:
I'm gonna try tomorrow, but if think it's too much for me. Gracie mille
Ajenaton1968 said:
I'm gonna try tomorrow, but if think it's too much for me. Gracie mille
Click to expand...
Click to collapse
Good luck let me know how it goes.
E di niente
daxgirl said:
Good luck let me know how it goes.
E di niente
Click to expand...
Click to collapse
Io sono spagnolo[emoji12] [emoji12] my english is poor [emoji23] [emoji23]
Ajenaton1968 said:
Io sono spagnolo[emoji12] [emoji12] my english is poor [emoji23] [emoji23]
Click to expand...
Click to collapse
Yeah, I got that. Well I don't speak Spanish (nor do I speak italian btw LOL). But on xda english is required
pleas moding for android 5 lolibop framework-res.apk & android.policy.jar
I tried for many but Commenting on the logo samsung
http://d-h.st/B9Tg
amro habib said:
pleas moding for android 5 lolibop framework-res.apk & android.policy.jar
I tried for many but Commenting on the logo samsung
http://d-h.st/B9Tg
Click to expand...
Click to collapse
I am sorry mate I really didn't understand the question
Sent from my SM-G900F using Tapatalk
daxgirl said:
I am sorry mate I really didn't understand the question
Sent from my SM-G900F using Tapatalk
Click to expand...
Click to collapse
ok
Possible you adjust the button on the attached link because I tried did not work
amro habib said:
ok
Possible you adjust the button on the attached link because I tried did not work
Click to expand...
Click to collapse
I will try. But what device is it?
Sent from my SM-G900F using Tapatalk
daxgirl said:
I will try. But what device is it?
Sent from my SM-G900F using Tapatalk
Click to expand...
Click to collapse
Thank you very much
my device note 3 N9005
Thanks man your fantastic it's done by me
The problem that because smali & baksmali...java

Categories

Resources