Last active
March 14, 2024 21:50
-
-
Save devnoname120/9edbb503a67add7fd9b8f881e93942c0 to your computer and use it in GitHub Desktop.
XPrivacyLua Pro — Override system locale/language — java.util.Location.getDefault()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"script": [ | |
{ | |
"name": "Privacy.Locale.getDefault", | |
"code": "function after(hook, param)\n local myLocale = luajava.newInstance(\"java.util.Locale\", \"fr\", \"FR\")\n\tparam:setResult(myLocale)\n\treturn true\nend" | |
} | |
], | |
"definition": [ | |
{ | |
"builtin": false, | |
"collection": "Privacy", | |
"group": "Get.Locale", | |
"name": "Locale.getDefault", | |
"author": "devnoname120", | |
"version": 1, | |
"description": "Overrides the system locale for a specific app", | |
"className": "java.util.Locale", | |
"methodName": "getDefault", | |
"parameterTypes": [], | |
"returnType": "java.util.Locale", | |
"minSdk": 1, | |
"maxSdk": 99, | |
"minApk": 0, | |
"maxApk": 2147483647, | |
"enabled": true, | |
"optional": false, | |
"usage": true, | |
"notify": false, | |
"luaScript": "@Privacy.Locale.getDefault" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I couldn't find this on the internet so I built a hook for changing the system locale / language of specific apps. I'm overriding
java.util.Locale.getDefault()
for that purpose.I hardcoded French (France) inside but you can easily change it, and even make it appear in the XPrivacyLua Pro settings.
It only hooks one method because the app that I needed to target (SNCF Connect) doesn't use the other
java.util.Locale
methods.