Look this Amazing tool :
https://forum.xda-developers.com/showthread.php?t=1633333&page=785
Envoyé de mon MIX 2S en utilisant Tapatalk
I just took a look, but it seems that tool just provides a more user friendly wrapper to apktool which is what I used manually.
It's possible that it does something slightly different or uses a slightly different version of apktool or something, but for what it's worth I had no problems decompiling, modifying the resource file, and recompiling manually then inserting the modified
resource.asrc
file into the original APK and the setting change worked, reverse-portrait rotation was prevented.
However I think just modifying that file at all somehow may have caused it to fail some kind of validation by MIUI or something like that causing the notifications to break. When I have some time later I'll try going through the same process again using this tool and see if my notifications still work, but I have a feeling it will be the same. I'll report back if it does work.
I was hoping to use Privset to modify the setting without messing with the
framework-res.apk
file directly, but it didn't work (maybe not compatible with Android Q or just MIUI in general, who knows).
Really annoying that this change was made at all in this rom as the stock MIUI roms prevent that orientation and it's easy enough to use an app to re-enable it if you want it. However, no app I have found can prevent only that one orientation. They either allow all orientations or lock to one specific orientation. All I want to do is allow whatever orientation would normally be allowed by whatever app I'm using, except reverse-portrait (e.g. exactly what setting
config_allowAllRotations
to
false
does. Unfortunately, the creators of the Xiaomi.eu rom decided to modify it themselves to be
true
when creating this rom (or perhaps the developer versions they use as a base has it set to
true
by default, who knows). Actually I don't really care
why it is set, I just want it unset