New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Mi Fitness): Add Force English locale
and Fix login
patch
#2734
Conversation
src/main/kotlin/app/revanced/patches/mifitness/misc/locale/ForceLocalePatch.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/app/revanced/patches/mifitness/misc/login/FixLoginPatch.kt
Show resolved
Hide resolved
src/main/kotlin/app/revanced/patches/mifitness/misc/login/fingerprints/LoginFingerprint.kt
Outdated
Show resolved
Hide resolved
override fun execute(context: BytecodeContext) { | ||
LoginFingerprint.result?.mutableMethod?.addInstruction( | ||
0, | ||
"const/4 p2, 0x0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure parameter 2 is never gonna change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, no i am not sure as i am not the owner of the original app;)
Any proposal of how to do it in a better way?
It is a constructor fingerprint that takes boolean as second param. This param, if false, disables Android phone account login and enables login/password login
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this parameter is used somewhere in the code, you can obtain it from one of the instructions. If the compiled code updates the register count, the parameter 2 shifts accordingly, but since you'd obtain it from an existing instruction, you'd correctly reference the necessary register.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pisek The parameter seems still to be hardcoded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oSumAtrIX , what do you mean?
I have changed XiaomiAccountManagerConstructorFingerprint to point directly to the param that i need.
package app.revanced.patches.mifitness.misc.login.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
internal object XiaomiAccountManagerConstructorFingerprint : MethodFingerprint(
accessFlags = AccessFlags.PRIVATE or AccessFlags.CONSTRUCTOR,
customFingerprint = { methodDef, _ ->
methodDef.definingClass == "Lcom/xiaomi/passport/accountmanager/XiaomiAccountManager;"
},
parameters = listOf(
"Landroid/content/Context;",
"Z",
),
)
So in this case i will always use 2nd param - boolean.
The instruction that uses p2 is if-nez p2, :cond_0
What do you propose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, the fingerprint could fail to resolve, which is about as fatal as the parameter changing because the patch would stop working in both cases. Instead, if you obtain the register from an existing instruction, the failure would be reduced down to the instruction shifting changing or moving. For now this is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i have updated the code to get the reg from instruction. Could you re-review?
src/main/kotlin/app/revanced/patches/mifitness/misc/locale/ForceLocalePatch.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/app/revanced/patches/mifitness/misc/locale/ForceLocalePatch.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/app/revanced/patches/mifitness/misc/locale/ForceEnglishLocalePatch.kt
Outdated
Show resolved
Hide resolved
override fun execute(context: BytecodeContext) { | ||
LoginFingerprint.result?.mutableMethod?.addInstruction( | ||
0, | ||
"const/4 p2, 0x0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this parameter is used somewhere in the code, you can obtain it from one of the instructions. If the compiled code updates the register count, the parameter 2 shifts accordingly, but since you'd obtain it from an existing instruction, you'd correctly reference the necessary register.
d964b8f
to
fd27725
Compare
Could anyone of you guy take a look at what is wrong with the build? |
Try rebasing off dev branch (or merge dev and accept dev branch for the conflicts) |
f1bd65b
to
d0da84a
Compare
The error is only on your GitHub branch because you don't have a publishing key setup to create GitHub releases. You can ignore the error. This PR branch is building locally for me without any issues. |
Ok, so as I understand, it is ready to be merged :) |
override fun execute(context: BytecodeContext) { | ||
LoginFingerprint.result?.mutableMethod?.addInstruction( | ||
0, | ||
"const/4 p2, 0x0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pisek The parameter seems still to be hardcoded
Force English locale
patch
Force English locale
patchForce English locale
and `Fix login´ patch
Force English locale
and `Fix login´ patchForce English locale
and Fix login
patch
Thank you for contributing to ReVanced. Join us on Discord to receive a role for your contribution. |
# [4.4.0](v4.3.0...v4.4.0) (2024-03-27) ### Bug Fixes * **TikTok:** Hook application context earlier to prevent crash ([#2893](#2893)) ([395ccda](395ccda)) * **YouTube - Client spoof:** Spoof all user agents ([44a8a13](44a8a13)) * **YouTube - Downloads:** Use new task context ([#2841](#2841)) ([6d88cb4](6d88cb4)) * **YouTube - Hide ads:** Prevent app crash if hiding fullscreen ads is not possible ([#2910](#2910)) ([9f50470](9f50470)) * **YouTube Music:** Fix compatibility with latest versions ([#2924](#2924)) ([8378c84](8378c84)) * **YouTube:** Fix video playback by switching to ReVanced GmsCore vendor ([#2907](#2907)) ([33ea122](33ea122)) * **YouTube:** Move setting to correct screen ([a16eda8](a16eda8)) ### Features * **Instagram - Hide timeline ads:** Make compatible with latest versions ([a212f29](a212f29)) * **Mi Fitness:** Add `Force English locale` and `Fix login` patch ([#2734](#2734)) ([7a25791](7a25791)) * **Sync for Lemmy:** Add `Disable ads` patch ([#2872](#2872)) ([0785819](0785819)) * **YouTube - Downloads:** Use external downloader when selecting 'Download' in home feed flyout menu ([#2881](#2881)) ([10afc8c](10afc8c)) * **YouTube - External downloader:** Add ability to use in-app download button ([d900011](d900011)) * **YouTube - Hide layout components:** Filter home/search results by keywords ([#2853](#2853)) ([5916204](5916204)) * **YouTube - Hide Shorts components:** Hide like and dislike buttons ([2df0892](2df0892)) * **YouTube - Hide Shorts components:** Hide sound metadata label ([ea7d1e0](ea7d1e0)) * **YouTube - Hide Shorts components:** Hide title and full video link label ([e7b64e1](e7b64e1)) * **YouTube - Hide Shorts components:** Selectively hide Shorts for home / subscription / search ([#2925](#2925)) ([497c067](497c067)) * **YouTube :** Remove `HDR auto brightness` patch ([#2863](#2863)) ([b4c7bf4](b4c7bf4)) * **YouTube Vanced:** Remove `Hide ads` patch ([87887e4](87887e4)) * **YouTube:** Support version `19.05`, `19.06`, `19.07`, `19.08` and `19.09` ([#2862](#2862)) ([f044dde](f044dde))
# [4.4.0](v4.3.0...v4.4.0) (2024-03-27) ### Bug Fixes * **TikTok:** Hook application context earlier to prevent crash ([ReVanced#2893](https://github.com/E85Addict/revanced-patches/issues/2893)) ([395ccda](395ccda)) * **YouTube - Client spoof:** Spoof all user agents ([44a8a13](44a8a13)) * **YouTube - Downloads:** Use new task context ([ReVanced#2841](https://github.com/E85Addict/revanced-patches/issues/2841)) ([6d88cb4](6d88cb4)) * **YouTube - Hide ads:** Prevent app crash if hiding fullscreen ads is not possible ([ReVanced#2910](https://github.com/E85Addict/revanced-patches/issues/2910)) ([9f50470](9f50470)) * **YouTube Music:** Fix compatibility with latest versions ([ReVanced#2924](https://github.com/E85Addict/revanced-patches/issues/2924)) ([8378c84](8378c84)) * **YouTube:** Fix video playback by switching to ReVanced GmsCore vendor ([ReVanced#2907](https://github.com/E85Addict/revanced-patches/issues/2907)) ([33ea122](33ea122)) * **YouTube:** Move setting to correct screen ([a16eda8](a16eda8)) ### Features * **Instagram - Hide timeline ads:** Make compatible with latest versions ([a212f29](a212f29)) * **Mi Fitness:** Add `Force English locale` and `Fix login` patch ([ReVanced#2734](https://github.com/E85Addict/revanced-patches/issues/2734)) ([7a25791](7a25791)) * **Sync for Lemmy:** Add `Disable ads` patch ([ReVanced#2872](https://github.com/E85Addict/revanced-patches/issues/2872)) ([0785819](0785819)) * **YouTube - Downloads:** Use external downloader when selecting 'Download' in home feed flyout menu ([ReVanced#2881](https://github.com/E85Addict/revanced-patches/issues/2881)) ([10afc8c](10afc8c)) * **YouTube - External downloader:** Add ability to use in-app download button ([d900011](d900011)) * **YouTube - Hide layout components:** Filter home/search results by keywords ([ReVanced#2853](https://github.com/E85Addict/revanced-patches/issues/2853)) ([5916204](5916204)) * **YouTube - Hide Shorts components:** Hide like and dislike buttons ([2df0892](2df0892)) * **YouTube - Hide Shorts components:** Hide sound metadata label ([ea7d1e0](ea7d1e0)) * **YouTube - Hide Shorts components:** Hide title and full video link label ([e7b64e1](e7b64e1)) * **YouTube - Hide Shorts components:** Selectively hide Shorts for home / subscription / search ([ReVanced#2925](https://github.com/E85Addict/revanced-patches/issues/2925)) ([497c067](497c067)) * **YouTube :** Remove `HDR auto brightness` patch ([ReVanced#2863](https://github.com/E85Addict/revanced-patches/issues/2863)) ([b4c7bf4](b4c7bf4)) * **YouTube Vanced:** Remove `Hide ads` patch ([87887e4](87887e4)) * **YouTube:** Support version `19.05`, `19.06`, `19.07`, `19.08` and `19.09` ([ReVanced#2862](https://github.com/E85Addict/revanced-patches/issues/2862)) ([f044dde](f044dde)) ### Performance Improvements * Personal Logo && Add upstream sync ([5022724](5022724))
Added patches for MiFitness to get Mi Band CN version to use english language without changing the phone locale to EN