I don't see why is not possible to include in xiaomi eu roms, if you are able to compile custom roms...Nope.. Ask Xiaomi to do that..
Patching is not the problem. There has to be a reason why it's not there officially, and unless you have an answer to why that is, we rather not mess with user's hardware. Since you're quite competent yourself, you can mod the ROM on your own device as much as you want.I don't see why is not possible to include in xiaomi eu roms, if you are able to compile custom roms...
I edited by myself to the first of xiaomi eu 12.x the MiSettings.apk to enable the 90hz by using apktool and decompiling the apk.
The option is present at the path smali->com->xiaomi->misetting->display->RefreshRate , you should replace the condition ( :cond_2) on line 137, with cond_1, then the option 90hz is visible. In my case, to replace the misettings.apk, I had to use the magisk with the overlay option to load the modified apk with a custom install.sh function.
As far as I know as a developer, It should be easy for the xiaomi eu devs to include such modification if the result of smali is the same across the different versions, just with a diff is easy to know that.
What is the reason? I don't see the problem if exposing that option on Xiaomi EU ROMs.Patching is not the problem. There has to be a reason why it's not there officially, and unless you have an answer to why that is, we rather not mess with user's hardware. Since you're quite competent yourself, you can mod the ROM on your own device as much as you want.
Which file in RefreshRate dir are you talking about?What is the reason? I don't see the problem if exposing that option on Xiaomi EU ROMs.
The point is that I have to do the process that I have described above every time that a ROM is released. Also, there are different users changing that option via terminal and setedit app.
It would be nice to have the option for the phones that supports 120hz. As lower fps means lower GPU load and then battery saving.
But I get It, Xiaomi EU modders are not interesting into mod those features.
The fastest way is to manipulate the a.smali to put 90hz instead of 60hz in cond_2.Which file in RefreshRate dir are you talking about?
.method private b()V
.locals 4
const-string v0, "fpsList"
invoke-static {v0}, Lb/c/a/b/a/b;->b(Ljava/lang/String;)[I
move-result-object v0
if-eqz v0, :cond_1
array-length v1, v0
if-gtz v1, :cond_0
goto :goto_1
:cond_0
invoke-static {v0}, Ljava/util/Arrays;->sort([I)V
array-length v1, v0
new-array v1, v1, [I
iput-object v1, p0, Lcom/xiaomi/misettings/display/RefreshRate/RefreshRateActivity;->d:[I
const/4 v1, 0x0
:goto_0
array-length v2, v0
if-ge v1, v2, :cond_1
iget-object v2, p0, Lcom/xiaomi/misettings/display/RefreshRate/RefreshRateActivity;->d:[I
array-length v3, v0
sub-int/2addr v3, v1
add-int/lit8 v3, v3, -0x1
aget v3, v0, v3
aput v3, v2, v1
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_1
:goto_1
return-void
.end method
.method private b()V
.locals 4
const-string v0, "fpsList"
invoke-static {v0}, Lb/c/a/b/a/b;->b(Ljava/lang/String;)[I
move-result-object v0
if-eqz v0, :cond_1
array-length v1, v0
# Force enable 90hz
const-string v2, "90"
# Current index+1
add-int/lit8 v1, v1, 0x1
# put value v2 inside array v0 at index v1+1
aput-object v2, v0, v1
#Recalculate arraylength
array-length v1, v0
if-gtz v1, :cond_0
goto :goto_1
:cond_0
invoke-static {v0}, Ljava/util/Arrays;->sort([I)V
array-length v1, v0
new-array v1, v1, [I
iput-object v1, p0, Lcom/xiaomi/misettings/display/RefreshRate/RefreshRateActivity;->d:[I
const/4 v1, 0x0
:goto_0
array-length v2, v0
if-ge v1, v2, :cond_1
iget-object v2, p0, Lcom/xiaomi/misettings/display/RefreshRate/RefreshRateActivity;->d:[I
array-length v3, v0
sub-int/2addr v3, v1
add-int/lit8 v3, v3, -0x1
aget v3, v0, v3
aput v3, v2, v1
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_1
:goto_1
return-void
.end method
Main point is that if something goes wrong, you will break just your device.. If we add it to our ROMs, thousands of users will be affected.. So for their safety, we are not interested in HW mods.. It's Xiaomi's responsibility..What is the reason? I don't see the problem if exposing that option on Xiaomi EU ROMs.
The point is that I have to do the process that I have described above every time that a ROM is released. Also, there are different users changing that option via terminal and setedit app.
It would be nice to have the option for the phones that supports 120hz. As lower fps means lower GPU load and then battery saving.
But I get It, Xiaomi EU modders are not interested into mod those features.
Thanks for replying anyway.
Which is silly, because all you do here is change the title/summary, nothing else.The fastest way is to manipulate the a.smali to put 90hz instead of 60hz in cond_2.
Which is even more absurd.The cool way is to enable the option via manipulating the RefreshRateActivity.smali, which in the latest xiaomi Eu version (I haven't tested into my device) is to manipulate the method b()V at the line 54 from:
Code:.method private b()V .locals 4 const-string v0, "fpsList" invoke-static {v0}, Lb/c/a/b/a/b;->b(Ljava/lang/String;)[I move-result-object v0 if-eqz v0, :cond_1 array-length v1, v0 if-gtz v1, :cond_0 goto :goto_1 :cond_0 invoke-static {v0}, Ljava/util/Arrays;->sort([I)V array-length v1, v0 new-array v1, v1, [I iput-object v1, p0, Lcom/xiaomi/misettings/display/RefreshRate/RefreshRateActivity;->d:[I const/4 v1, 0x0 :goto_0 array-length v2, v0 if-ge v1, v2, :cond_1 iget-object v2, p0, Lcom/xiaomi/misettings/display/RefreshRate/RefreshRateActivity;->d:[I array-length v3, v0 sub-int/2addr v3, v1 add-int/lit8 v3, v3, -0x1 aget v3, v0, v3 aput v3, v2, v1 add-int/lit8 v1, v1, 0x1 goto :goto_0 :cond_1 :goto_1 return-void .end method
to:
Code:.method private b()V .locals 4 const-string v0, "fpsList" invoke-static {v0}, Lb/c/a/b/a/b;->b(Ljava/lang/String;)[I move-result-object v0 if-eqz v0, :cond_1 array-length v1, v0 # Force enable 90hz const-string v2, "90" # Current index+1 add-int/lit8 v1, v1, 0x1 # put value v2 inside array v0 at index v1+1 aput-object v2, v0, v1 #Recalculate arraylength array-length v1, v0 if-gtz v1, :cond_0 goto :goto_1 :cond_0 invoke-static {v0}, Ljava/util/Arrays;->sort([I)V array-length v1, v0 new-array v1, v1, [I iput-object v1, p0, Lcom/xiaomi/misettings/display/RefreshRate/RefreshRateActivity;->d:[I const/4 v1, 0x0 :goto_0 array-length v2, v0 if-ge v1, v2, :cond_1 iget-object v2, p0, Lcom/xiaomi/misettings/display/RefreshRate/RefreshRateActivity;->d:[I array-length v3, v0 sub-int/2addr v3, v1 add-int/lit8 v3, v3, -0x1 aget v3, v0, v3 aput v3, v2, v1 add-int/lit8 v1, v1, 0x1 goto :goto_0 :cond_1 :goto_1 return-void .end method
array-length v1, v0
# Force enable 90hz
const-string v2, "90"
# Current index+1
add-int/lit8 v1, v1, 0x1
# put value v2 inside array v0 at index v1+1
aput-object v2, v0, v1
array[array.length + 1] = "90";
Which is silly, because all you do here is change the title/summary, nothing else.
Which is even more absurd.
This:
Translates in Java to:Code:array-length v1, v0 # Force enable 90hz const-string v2, "90" # Current index+1 add-int/lit8 v1, v1, 0x1 # put value v2 inside array v0 at index v1+1 aput-object v2, v0, v1
Which basically results in IndexOutOfBoundsException because: 0 <= index < array.lengthCode:array[array.length + 1] = "90";
Didn't you say you were a developer? It's basic knowledge that each array has a fixed length.
Why don't you just find where the "fpsList" array is defined and add the "90" item there?
Hint: No decompilation is needed to edit it.
Or just find where the array is at and change it, the array is barebones and in plain sight on vendor partition, not hard to findAbout the first point, it isn't just the text draw on the activity, it is also the value stored in the settings table...This is the method that I'm currently using and checking the "user_refresh_rate" it changes to 90 instead 60 as it did before the change, I have checked it with setedit...
About the OOB, just enlarge the array one position:
new-array v3, v1, [Ljava/lang/String;.
Or just find where the array is at and change it, the array is barebones and in plain sight on vendor partition, not hard to find
In any case, just curious, set 90 FPS and then go to Developer options and toggle on "Show refresh rate", what do you see on the screen?
We use essential cookies to make this site work, and optional cookies to enhance your experience. Cookies are also used for ads personalisation