Refine relocate heuristics

This commit is contained in:
Mygod
2022-05-20 21:18:48 -04:00
parent 1adf767607
commit 3fea5cc1dd
4 changed files with 18 additions and 17 deletions

View File

@@ -71,6 +71,13 @@ object AppProcess {
"/system/bin/app_process"
}
/**
* Try to guess whether enabling relocation would work best.
* It seems some Android 5-7 devices give random permission denials without relocation.
* See also VPNHotspot#173.
*/
val shouldRelocateHeuristics get() = Build.VERSION.SDK_INT < 26 || myExeCanonical.startsWith("/data/")
/**
* To workaround Samsung's stupid kernel patch that prevents exec, we need to relocate exe outside of /data.
* See also: https://github.com/Chainfire/librootjava/issues/19