ref: Add Reboot Mod - Motorola Photon 4G

EDIT: post #3 now includes the steps so a guide to add it to your own files this information is from http://forum.xda-developers.com/showthread.php?t=811532 only modified to work with photon
ok guys i got it working im on skinny rev unlocked with dark fire theme so that is the framework apk i used but its easy to modify for the developers wanting to add this to there theme or rom.. just use my files android.policy.jar and framework.jar
to do this decompile and edit this xml in your framework.apk
Code:
"framework-res.apk\res\values\strings.xml"
add
Reboot
Recovery
next add png icons here
"framework-res.apk\res\drawable-hdpi"
make sure they are named
"ic_lock_reboot.png
"ic_lock_recovery.png
then recompile/build etc.. after you have build apk decompile it again
go here
frameworkres.apk\res\values\public.xml
you will see this with different id #s
and
these are what you need to change in the android.policy.jar
com\android\internal\policy\impl\GlobalActions.sma li"
at line 661
const v3, 0x1080501 (reboot icon)
const v4, 0x10404ed (reboot string)
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$10;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
const/4 v1, 0x5
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x1080502 (recovery icon)
const v4, 0x10404ee (recovery string)
the first set of icon ids are for reboot
first # is drawable icon second is string #
second set is recovery as in the ( ) 's
so now change these numbers to those in the public.xml as i described above
next recompile your android.policy.jar and its ready to add
thanks!
screenie here http://dl.dropbox.com/u/46879286/20120214113758.jpeg
colors are off sorry

chrystal0925 said:
ok guys i got it working im on skinny rev unlocked with dark fire theme so that is the framework apk i used but its easy to modify for the developers wanting to add this to there theme or rom.. just use my files android.policy.jar and framework.jar
download here http://dl.dropbox.com/u/46879286/photon.power.mod.zip
to do this decompile and edit this xml in your framework.apk
"framework-res.apk\res\values\strings.xml"
add
Reboot
Recovery
next add png icons here
"framework-res.apk\res\drawable-hdpi"
make sure they are named
"ic_lock_reboot.png
"ic_lock_recovery.png
then recompile/build etc.. after you have build apk decompile it again
go here
frameworkres.apk\res\values\public.xml
you will see this with different id #s
and
these are what you need to change in the android.policy.jar
com\android\internal\policy\impl\GlobalActions.sma li"
at line 661
const v3, 0x1080501 (reboot icon)
const v4, 0x10404ed (reboot string)
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$10;->(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
const/4 v1, 0x5
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x1080502 (recovery icon)
const v4, 0x10404ee (recovery string)
the first set of icon ids are for reboot
first # is drawable icon second is string #
second set is recovery as in the ( ) 's
so now change these numbers to those in the public.xml as i described above
next recompile your android.policy.jar and its ready to add
thanks!
screenie here http://dl.dropbox.com/u/46879286/20120214113758.jpeg
colors are off sorry
Click to expand...
Click to collapse
This is great I was working on it last night did you have to make changes to build prop?
Sent from my MB855 using xda premium

No I didn't and it works fine
edit: above may not work on other roms with my files so heres a guide need to be deodex odex is not working:
use apk_manager to decompile framework-res
open "values\strings.xml add this to it
Code:
<string name="reboot_recovery">Recovery</string>
<string name="reboot">Reboot</string>
next add png icons here (i attached some to use )
"framework-res.apk\res\drawable-hdpi"
make sure they are named
"ic_lock_reboot.png
"ic_lock_recovery.png
recompile then decompile to get it to auto generate the public id's
now to add the option to the shutdown
so decompile framework.jar and open "com\android\internal\app\ShutdownThread.smali
add to line 40 keep the lines spaced(skipping a line between )
Code:
.field public static mReboot:I
then at line 542 before "invoke-static {}, Landroid/os/Power;->shutdown()V" add this
Code:
sget v1, Lcom/android/internal/app/ShutdownThread;->mReboot:I
const/4 v2, 0x1
if-eq v1, v2, :reboot
const/4 v2, 0x2
if-eq v1, v2, :rebootRecovery
then at line 557 or about line 554 after this
.line 512
return-void
add this
Code:
:reboot
const-string v4, "now"
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
return-void
:rebootRecovery
const-string v4, "recovery"
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V
return-void
next save and recompile
now decompile androidpolicy.jar
open com\android\internal\policy\impl\GlobalActions.smali
look for .method private createDialog()Landroid/app/AlertDialog;
and at line 624 edit to add two more methods
Code:
.line 232
const/4 v0, 0x4
(change the 0x4 to 0x6)
and at line 657 edit out the ids from your public.xml (]do not add this reference here )
add this
Code:
const/4 v1, 0x4
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$10;
const v3, 0x1080501 ([COLOR="Red"]change this to drawable reboot id[/COLOR])
const v4, 0x10404ed [COLOR="red"](reboot string id[/COLOR])
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$10;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
const/4 v1, 0x5
new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$11;
const v3, 0x1080502( [COLOR="red"]drawable recovery id[/COLOR])
const v4, 0x10404ee ([COLOR="red"]recovery string id[/COLOR])
invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V
aput-object v2, v0, v1
so you need to go back to your framework.apk
open res/values/public to get the id's to change the above..
save and go to
GlobalActions$5.smali and copy it and name it GlobalActions$10.smali
open GlobalActions$10 and replace all instances ( so any where you see) of GlobalActions$5
with GlobalActions$10 then add this code
Code:
sput v2, Lcom/android/internal/app/ShutdownThread;->mReboot:I
to line 52 before
invoke-static {v0, v1}, Lcom/android/internal/app/ShutdownThread;->shutdown(Landroid/content/Context;Z)V
now copy GlobalActions$10.smali and name it GlobalActions$11.smali
replace all instances of GlobalActions$10 with GlobalActions$11
then save recompile and everything is now added to run this mod!

chrystal0925 said:
No I didn't and it works fine
Sent from my MB855 using XDA App
Click to expand...
Click to collapse
Sounds good,and Thanks
Sent from my MB855 using xda premium

Welcome hope it helps!
Sent from my MB855 using XDA App

If anyone needs send me your framework apk and I can mod it for you to use
Sent from my MB855 using XDA App

how to change android.policy.jar. when i open it, its only contain manifest.mf. there is also android.policy.odex.

zeguym said:
how to change android.policy.jar. when i open it, its only contain manifest.mf. there is also android.policy.odex.
Click to expand...
Click to collapse
you need baksmali to decompile it. which rom are you on? if you cant get it send me the policy and framework.. once you decompile the policy it turns it into a classes.dex then you zip the policy using 7zip or winrar and you replace the new classes.dex with the one in the zip..

chrystal0925 said:
you need baksmali to decompile it. which rom are you on? if you cant get it send me the policy and framework.. once you decompile the policy it turns it into a classes.dex then you zip the policy using 7zip or winrar and you replace the new classes.dex with the one in the zip..
Click to expand...
Click to collapse
I use stock rom.
Can you kindly give step by step how to decompile and compile it again.
I already have baksmali, but when trying to decompile it, it always failed.
is this because stock rom is odex ? not deodex ?

zeguym said:
I use stock rom.
Can you kindly give step by step how to decompile and compile it again.
I already have baksmali, but when trying to decompile it, it always failed.
is this because stock rom is odex ? not deodex ?
Click to expand...
Click to collapse
That could be why I'm using deodex files.. I'm not to sure on directions I use a tool like a script its simple it was 2 commands one to decompile other to recompile.. as far as I know deodex is for theming Modding etc..

I was trying to see if you can use my files but your framework I've had people use my reboot mod on the echo on stock but the framework apk was a deodex version and the rest odex I could deodex it n try if you can post the apk I dont think I have a stock file but if so then you would just decompile my files and edit what I listed after adding to the frameworkapk. You can try this way as well
Sent from my MB855 using XDA App

ive tried flashing on top of an odex version with a completely stock version just deodex it dont work it has to many looping issues so recommend that your rom is deodex..

wrong post. deleted.

Related

[FIX] Updated: How to fix deodexed System Framework (slow Browser)

Update 14th Aug 2011: JesusFreke has released a new version of baksmali (v1.2.7) which seems to have fixed the bug above
You may download it from here http://blog.jesusfreke.com/2011/08/smalibaksmali-127.html - Thank you JesusFreke for a great tool and support
Please feel free to report any bugs or issues with this tool here or on his blog.
-------------
Good news to all modders out there - I finally found the bug for real this time - unfortunately, it's in baksmali.jar" .. The fault occurs when it attempts to build deodex framework.jarodex from into smali files
specifically this file "android/view/SurfaceView.smali"
I believe baksmali (v1.2.6) just fails to realize that the class variable it wants to access belongs to the super (parent) class .. instead it simply accesses the local class variable.
But I have a work-around fix to the bug (guranteed to work as long as the order of class fields mLeft and mTop are the same in android/view/SurfaceView.smali as android/webkit/WebViewCore$ShowRectData.smali)
The solution:
1. replace
Code:
.method private super_mLeft()I
.registers 2
.prologue
.line 911
iget v0, p0, Landroid/view/SurfaceView;->mLeft:I
return v0
.end method
with
Code:
.method private super_mLeft()I
.registers 2
.prologue
.line 911
iget v0, p0, [strike]Landroid/webkit/WebView;[/strike][COLOR="Red"]Landroid/view/View;[/COLOR]->mLeft:I
return v0
.end method
2. and this
Code:
.method private super_mTop()I
.registers 2
.prologue
.line 914
iget v0, p0, Landroid/view/SurfaceView;->mTop:I
return v0
.end method
with
Code:
.method private super_mTop()I
.registers 2
.prologue
.line 914
iget v0, p0, [strike]Landroid/webkit/WebView;[/strike][COLOR="Red"]Landroid/view/View;[/COLOR]->mTop:I
return v0
.end method
3. and
Code:
iget-object v0, v0, Landroid/view/SurfaceView;->mLocation:[I
move-object v5, v0
const/4 v6, 0x0
move-object/from16 v0, p0
iget v0, v0, Landroid/view/SurfaceView;->mLeft:I
move v7, v0
add-int v7, v7, p4
aput v7, v5, v6
with
Code:
iget-object v0, v0, Landroid/view/SurfaceView;->mLocation:[I
move-object v5, v0
const/4 v6, 0x0
move-object/from16 v0, p0
iget v0, v0, [strike]Landroid/webkit/WebView;[/strike][COLOR="Red"]Landroid/view/View;[/COLOR]->mLeft:I
move v7, v0
add-int v7, v7, p4
aput v7, v5, v6
4. and last peice
Code:
iget-object v0, v0, Landroid/view/SurfaceView;->mLocation:[I
move-object v5, v0
const/4 v6, 0x1
move-object/from16 v0, p0
iget v0, v0, Landroid/view/SurfaceView;->mTop:I
move v7, v0
add-int v7, v7, p5
aput v7, v5, v6
.line 439
with
Code:
iget-object v0, v0, Landroid/view/SurfaceView;->mLocation:[I
move-object v5, v0
const/4 v6, 0x1
move-object/from16 v0, p0
iget v0, v0, [strike]Landroid/webkit/WebView;[/strike][COLOR="Red"]Landroid/view/View;[/COLOR]->mTop:I
move v7, v0
add-int v7, v7, p5
aput v7, v5, v6
.line 439
*NOTE* please keep my nickname in references for this solution.
Happy Modding,
- Brightidea
Thanks
But how we change the code
Assuming you have a deodex'd rom, baksmali browser.apk make the listed change and re-smali the code.
If you asking how to bakssmali etc, thats more drawn out..
I cant wait to try this, later this evening
I m just wondering how, just this one line can fix the laggy browser?
But anyway if this realy works, i m happy.
Thank you for sharing your work.
I think these misguided
the problem is in the framework.jar
example:
if you use a rom with the folder system / framework ODEX
and system / app deodex
The browser deodex not lose acceleration
but if you, deodex framework.jar, lose acceleration
criskelo said:
I think these misguided
the problem is in the framework.jar
example:
if you use a rom with the folder system / framework ODEX
and system / app deodex
The browser deodex not lose acceleration
but if you, deodex framework.jar, lose acceleration
Click to expand...
Click to collapse
So if i understand u right, this mod makes no sense with deodexed ROM?
He's saying that the fix wont work. It isn't an issue in the smali code of the Browser but rather an issue in the deodexed framework.
Also, the OP edited the original post:
I have found out that this approach is not the "real" solution to the bug. So, I am back in the lab trying to figure it out. Meanwhile, you may still use it as to my knowledge it doesn't do any harm.
Click to expand...
Click to collapse
OMG
You are the MAN
It works ....works .....works
Thank you
Edit: it worked for 5 min's and now keep FC
criskelo said:
I think these misguided
the problem is in the framework.jar
example:
if you use a rom with the folder system / framework ODEX
and system / app deodex
The browser deodex not lose acceleration
but if you, deodex framework.jar, lose acceleration
Click to expand...
Click to collapse
You're partly right - I found problems in the deodexed Browser that I am going to share after I fix the bugs in framework.
I am currently digging it up - hope to find the glitch soon.
GanGs_KiD said:
OMG
You are the MAN
It works ....works .....works
Thank you
Edit: it worked for 5 min's and now keep FC
Click to expand...
Click to collapse
Sorry to disappoint - but I am still working on the fix.
- Brightidea.
brightidea said:
You're partly right - I found problems in the deodexed Browser that I am going to share after I fix the bugs in framework.
I am currently digging it up - hope to find the glitch soon.
Click to expand...
Click to collapse
Do not know if it was understood
I say look in framework.jar
The problem is framework.jar
criskelo said:
Do not know if it was understood
I say look in framework.jar
The problem is framework.jar
Click to expand...
Click to collapse
I found the bug for real this time - unfortunately, it's in smali.jar ..
and you were right. The fault occurs when it attempts to build framework.jar from smali files
specifically this file "android/view/SurfaceView.smali"
But I have a work-around (guranteed to work as long as the order of class fields mLeft and mTop are the same in android/view/SurfaceView.smali as android/webkit/WebViewCore$ShowRectData.smali)
Go to the first post in the thread to get the solution.
- Brightidea
HAHA you did it!!
Works like a charm!
Maybe would be interesting to report this issue to jesusfreeke
very good job.
why isn't thist threat in "Original Android development" subforum????
Wow ..
U R the man ;D
brightidea said:
I found the bug for real this time - unfortunately, it's in smali.jar ..
and you were right. The fault occurs when it attempts to build framework.jar from smali files
specifically this file "android/view/SurfaceView.smali"
But I have a work-around (guranteed to work as long as the order of class fields mLeft and mTop are the same in android/view/SurfaceView.smali as android/webkit/WebViewCore$ShowRectData.smali)
Go to the first post in the thread to get the solution.
- Brightidea
Click to expand...
Click to collapse
Well actually works
Perfect!
great job brightidea!
Wohoo! You're the man! Waiting for this to be incorporated in all the ROMs
Well done.
Hacre said:
Well done.
Click to expand...
Click to collapse
Hacre being nice...whoa. epic post.
Epic fix as well!
Sent from my 119.2 linpack SGS2
brightidea.. you're a genius ! thank you sir

Remvove GPS icon in status bar

Using scotts clean rom 1.2 and was wondering of there was anything I could flash to remove that icon.
Sent from my Rezound using xda premium
nfrederick said:
Using scotts clean rom 1.2 and was wondering of there was anything I could flash to remove that icon.
Sent from my Rezound using xda premium
Click to expand...
Click to collapse
PM me.
do u know how to use apktool?
pm sent
never used apktool
EDIT
just downloaded and installed, looks like it runs using correctly when I type apktool in a command prompt.
thats as far as I got haha
I have a SystemUI.apk that has it removed, as well as all of the advanced settings...you'd have to adb push it or use root explorer/ES File Explorer to stick it in system/app.
Ironically, I'm trying to do the opposite and don't know how to re-enable it with this particular SysUI
Would you mind posting it?
awenthol said:
I have a SystemUI.apk that has it removed, as well as all of the advanced settings...you'd have to adb push it or use root explorer/ES File Explorer to stick it in system/app.
Ironically, I'm trying to do the opposite and don't know how to re-enable it with this particular SysUI
Click to expand...
Click to collapse
nfrederick said:
Would you mind posting it?
Click to expand...
Click to collapse
Hahah... I can help you both...
I was just about to post a mod that removed location.
awenthol you need to change two lines under gpsone
in HtcCdmaStatusBar.smali...
Look For:
Code:
.line 279
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/HtcCdmaStatusBar;->mService:Landroid/app/StatusBarManager;
const-string v1, "gpsone"
const/4 v2, 0x0
Change to
Code:
.line 279
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/HtcCdmaStatusBar;->mService:Landroid/app/StatusBarManager;
const-string v1, "gpsone"
[COLOR="Red"] const/4 v2, 0x1[/COLOR]
Then the second spot a few lines down is....
Code:
.method private updateMtGpsIcon()V
.locals 6
.prologue
const/4 v3, 0x3
const/4 v2, 0x0
Code:
.method private updateMtGpsIcon()V
.locals 6
.prologue
const/4 v3, 0x3
[COLOR="red"] const/4 v2, 0x1[/COLOR]
Oh and my next ROM will have the icon removed... And I will post a sep zip for it...
Ok, here is my mod: http://forum.xda-developers.com/showthread.php?p=21119197#post21119197
Thanks Scott, perfect timing! Haha.
I can't view the .xml files. I get some stuff at the top, but all I get for the rest of the document is yyyyy and random characters..
maximus20895 said:
I can't view the .xml files. I get some stuff at the top, but all I get for the rest of the document is yyyyy and random characters..
Click to expand...
Click to collapse
You need to decode them with apktool

[REQUEST] Disable increasing ringtone

I want to disable increasing ringtone. Is there any MOD available for "S Advance" that can be used?
I dont wanna use any app for this.
There are mods for s3 and s2 but i'm not sure whether they will run on s advance.
Plz help
XXLQB+Cocore 5.0+NOS Turbo
I'm going to add this feature to my ROM... anyways this is more of a Do-It-Yourself thingy.. so here are the steps, follow them and tell me whether they work or not...
1. Decompile SecPhone.apk using APKTOOL
2. Go to Smali\com\android\phone\Ringer$1.smali (note: open it with NotePad++)
3. Search for setStreamVolume. There should be two results. Delete the first one (the whole line in RED, like this):
Code:
.line 394
iget-object v1, p0, Lcom/android/phone/Ringer$1;->this$0:Lcom/android/phone/Ringer;
iget-object v1, v1, Lcom/android/phone/Ringer;->mAudioManager:Landroid/media/AudioManager;
[COLOR="Red"]invoke-virtual {v1, v3, v5, v4}, Landroid/media/AudioManager;->setStreamVolume(III)V[/COLOR]
4. Now search for nop (usually at the end of the file), copy it and hit enter twice and paste again (see code bellow, the blue one). "leave one line space in between each line":
Code:
goto/16 :goto_b
.line 717
nop
[COLOR="Blue"] nop[/COLOR]
:pswitch_data_1ca
.packed-switch 0x1
5. Save the changes
6. Recompile your SecPhone.apk.
7. With 7-Zip or WinRAR, open the the original (stock) SecPhone.apk. Then drag and drop the classes.dex and resources.arsc you just compiled into the (stock) SecPhone.apk.
8. Push the SecPhone.apk to your phone.
(Note that some Line numbers or numbers in the codes may differ)

[Tip] Activating Ink effect with fingers (4.3)

A. android.policy.jar file:
1. Copy the contents of “to android.policy.jar” folder.
2. Decompile android.policy.jar by backsmali/smali program.
3. Go to classout\com\android\internal\policy\impl\sec\ folder open CircleUnlockRippleRenderer.smali and search for "const/16 v1, 0x4002" and change this line.
search
Code:
const/16 v1, 0x4002
if-ne v0, v1, :cond_138
change
Code:
const/16 v1, 0x4002
if-ne v1, v1, :cond_138
Now recompile android.policy.jar and push them to your device.
Credits. majdinj
Sorry for my English
Great! Havent tried it yet, but it should work.. Any other way though? Like to flash via recovery? I have 4.3 leaked, stock, rooted, twrp, odexed
Sent from my GT-N7100 using XDA Premium 4 mobile app
Could you share the files.. TQ
here it is.
please help me.
sorry for bothering you with my newbies question.
i have problem,, i hope you can help me regarding to this thread.
first i used [4.3][MI6]DN3(Ditto Note 3) ROM from Electron Team(E-team)
in that ROM the ripple effect is basically mod like in this thread, what i want to do is to reverse it to the original note 2 which is the ink only out when using s-pen.
i already follow steps like you said on post#1
1. copy my android.policy.jar to my sd and move to my computer
2. decompile with backsmali/smali program
3. unlike you i go to classout\com\android\internal\policy\impl\keyguard\sec folder open CircleUnlockRippleRenderer.smali and search for "const/16 v1, 0x4002" and change
i change the value
Code:
const/16 v1, 0x4002
if-ne v1, v1, :cond_138
into the original
Code:
const/16 v1, 0x4002
if-ne v0, v1, :cond_138
4. Recompile android.policy.jar and copy to my sdcard.
5. move the android.policy.jar with rootbrowser to its original location and replace the original android.policy.jar
but i ended with many error when i push the android.policy.jar that i mod with steps like you said in post#1.
my error is non stop FC and non stop TW, NFC, and etc stopped working.
can you tell me where do i made mistake? please give me solution about this problem, thanks before.
Safe way to replace any files in framework folder is using cwm.zip
Sent from my GT-N7100 using XDA Premium 4 mobile app
ink effect for kitkat 4.4.2 with fingers.
please go here
Thanks.
Hit THANKS button, If I helped You.

[MOD] Custom Volume Step Count for Everything

So I've always been annoyed with how the HiFi volume only has 15 steps. For me, 5 is too low and 10 is too loud (cheap earbuds). With the release of the V30, I've learned that it has 75 steps for the HiFi volume, which prompted me to modify our system to get 75 steps as well.
Well, I didn't do that exactly, but I think this is better. I didn't manage to get the 75 steps on just the HiFi volume: I changed every slider, and it's customizable. By default, it's 1 step on the HiFi slider. This is about 1/2 of a step on the ringer volume I think. But if you don't like that, you can change what it uses.
The property is
Code:
volume_step_size
in Settings.Global.
You can set that using ADB. For instance, if you want to go back to the default step size for HiFi mode, you could use
Code:
adb shell settings put global volume_step_size 10
The default step size if 5, but for whatever reason, the system uses double the number you want. It's some weird scaling thing I think.
Attached is the modified services.jar. It goes in /system/framework/ with 0644 permissions.
Enjoy!
Do it Manually
This guide assumes you know how to decompile and recompile APKs/JARs or DEX files. I'm just going to tell you what code you need to edit to add this mod yourself.
- Decompile your services.jar. If you're on an odexed system, you'll either have to deodex the JAR or edit the DEX. That's beyond the scope of this though.
- Find these two files:
Code:
- /com/android/server/audio/AudioService.smali
- /com/android/server/audio/AudioService$VolumeStreamState.smali
- In AudioService, you need to add two new methods.
Code:
.method static synthetic -get49(Lcom/android/server/audio/AudioService;)Z
.locals 1
iget-boolean v0, p0, Lcom/android/server/audio/AudioService;->mHifiDacMode:Z
return v0
.end method
You'll want to make sure that -get49 isn't already used as a method name. My latest method was -get48, so the one I added I renamed to -get49.
Code:
.method private getCustomVolumeStepValue()I
.locals 3
const-string/jumbo v0, "volume_step_size"
const v1, 0x2
iget-object v2, p0, Lcom/android/server/audio/AudioService;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
invoke-static {v2, v0, v1}, Landroid/provider/Settings$Global;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
return v2
.end method
This is the method that grabs the current volume step set in Settings.Global. If there's no value found, it will use "2" by default.
- Now, go into AudioService$VolumeStreamState and find this method: "rescaleDeltaIndex(IIII)I." Comment the entire method out and paste this instead:
Code:
.method private rescaleDeltaIndex(IIII)I
.locals 3
.param p1, "deltaIndex" # I
.param p2, "flags" # I
.param p3, "streamType" # I
.param p4, "device" # I
.prologue
.line 4948
invoke-static {}, Lcom/android/server/audio/AudioService;->-get26()Z
move-result v2
if-eqz v2, :cond_4
const/high16 v2, 0x20000
and-int/2addr v2, p2
if-nez v2, :cond_4
const/4 v2, 0x3
if-ne p3, v2, :cond_4
.line 4950
iget-object v2, p0, Lcom/android/server/audio/AudioService$VolumeStreamState;->this$0:Lcom/android/server/audio/AudioService;
invoke-static {v2}, Lcom/android/server/audio/AudioService;->-get49(Lcom/android/server/audio/AudioService;)Z
move-result v2
if-eqz v2, :cond_0
and-int/lit16 v2, p2, 0x1000
if-nez v2, :cond_1
.line 4951
:cond_0
invoke-static {}, Lcom/android/server/audio/AudioService;->-get0()I
move-result v2
mul-int/2addr p1, v2
.line 4953
:cond_1
const/4 v1, 0x0
.line 4954
.local v1, "rescaledeltaIndex":I
invoke-virtual {p0, p4}, Lcom/android/server/audio/AudioService$VolumeStreamState;->getIndex(I)I
move-result v0
.line 4955
.local v0, "currentIndex":I
rem-int v2, v0, p1
if-eqz v2, :cond_3
.line 4956
if-gtz p1, :cond_2
.line 4957
rem-int v2, v0, p1
neg-int v1, v2
.line 4964
:goto_0
return v1
.line 4959
:cond_2
rem-int v2, v0, p1
sub-int v1, p1, v2
goto :goto_0
.line 4962
:cond_3
move v1, p1
goto :goto_0
.line 4966
.end local v0 # "currentIndex":I
.end local v1 # "rescaledeltaIndex":I
:cond_4
return p1
.end method
-get49 is the method you pasted earlier.
-get0 is the method that returns HIFI_MEDIA_VOLUME_OFFSET. Just make sure your -get0 is the same one as mine.
- Now, you need to actually get the custom method you pasted to be called. Find "adjustStreamVolume(IIILjava/lang/String;Ljava/lang/String;I)V" in AudioService and find the call to "rescaleIndex(III)I" inside it.
My call looks like this:
Code:
invoke-direct {v0, v6, v1, v13}, Lcom/android/server/audio/AudioService;->rescaleIndex(III)I
Change whatever you have to look like this:
Code:
invoke-direct {v0}, Lcom/android/server/audio/AudioService;->getCustomVolumeStepValue()I
- Rebuild and install!
Do I remove an old file first or just set this one in there
THANKS!!
The big step sizes have bothered me a lot!
If I want to use the adb command to set step sizes of 1, should I use 2?
Edit: File works for me!
Cheers
Emil
I've been looking for something like this. Thank you! ?
---------- Post added at 02:23 PM ---------- Previous post was at 02:22 PM ----------
shadavis08 said:
Do I remove an old file first or just set this one in there
Click to expand...
Click to collapse
I added .bak to the end of the original file so its still there in case I need it.
I changed the file and softrebooted. Not working.
Am I doing something wrong?
Salvaparalyzer said:
I changed the file and softrebooted. Not working.
Am I doing something wrong?
Click to expand...
Click to collapse
Did you change the permissions?
I would do a full reboot. A soft boot may not be enough.
Sent from my LG-H918 using Tapatalk
Salvaparalyzer said:
I changed the file and softrebooted. Not working.
Am I doing something wrong?
Click to expand...
Click to collapse
Are you sure it isn't working? Did you put it in the right place?
A little off-topic, but do you have any idea if something similar can be done for the brightness slider? Basically I would like to be able to set it to stick to increments of 5% or 10% when adjusting. Is there a similar setting I can change using ADB?
RichBordoni said:
A little off-topic, but do you have any idea if something similar can be done for the brightness slider? Basically I would like to be able to set it to stick to increments of 5% or 10% when adjusting. Is there a similar setting I can change using ADB?
Click to expand...
Click to collapse
Every time I fiddle with brightness something bootloops.
Zacharee1 said:
Are you sure it isn't working? Did you put it in the right place?
Click to expand...
Click to collapse
Permission are also correct I think
Update: Hmm, my phone soft restarts with incoming or out coming calls with this mod, fixed it by restoring my original file.
Just a heads up! Backup your old file.
H990DS V11i-GLOBAL-COM(flashed V10j Indonesia from V10g SEA)
3mL said:
Update: Hmm, my phone soft restarts with incoming or out coming calls with this mod, fixed it by restoring my original file.
Just a heads up! Backup your old file.
H990DS V11i-GLOBAL-COM(flashed V10j Indonesia from V10g SEA)
Click to expand...
Click to collapse
Weird, it doesn't happen here. The 990DS seems to always have problems with universal mods though.
Zacharee1 said:
Weird, it doesn't happen here. The 990DS seems to always have problems with universal mods though.
Click to expand...
Click to collapse
Yea, it's unfortunate.
Would you mind telling me what file you edited in the .dex file?
Perhaps it would work by editing my original file.
3mL said:
Yea, it's unfortunate.
Would you mind telling me what file you edited in the .dex file?
Perhaps it would work by editing my original file.
Click to expand...
Click to collapse
I'll write up a guide in a few hours. It involves editing Smali and all that.
Not only that. Phone reboots when trying to make a call with your file.
Restored the old file and the problem was gone.
H990ds here
3mL said:
Yea, it's unfortunate.
Would you mind telling me what file you edited in the .dex file?
Perhaps it would work by editing my original file.
Click to expand...
Click to collapse
Guide up.
Zacharee1 said:
Guide up.
Click to expand...
Click to collapse
Cheers! I'll have a look at it tomorrow.
Thanks Zach for the nice work.
I'm on OvrDrive's rom, h918, 10j. I believe it is odexed because the OP doesn't say anything about deodex.
I renamed the current services.jar, put yours in and set permissions. Rebooted and couldn't get past the LG logo.
Should your file work on this setup, or do I have to do it manually as you outlined?
androiddiego said:
Thanks Zach for the nice work.
I'm on OvrDrive's rom, h918, 10j. I believe it is odexed because the OP doesn't say anything about deodex.
I renamed the current services.jar, put yours in and set permissions. Rebooted and couldn't get past the LG logo.
Should your file work on this setup, or do I have to do it manually as you outlined?
Click to expand...
Click to collapse
I'm pretty sure this JAR is from OvrDriVE's 10J ROM so it should work fine.
Zacharee1 said:
I'm pretty sure this JAR is from OvrDriVE's 10J ROM so it should work fine.
Click to expand...
Click to collapse
Thanks! I'll try it again.

Categories

Resources