ArtistGui icon indicating copy to clipboard operation
ArtistGui copied to clipboard

Remember user and group for app oat

Open schrnz opened this issue 7 years ago • 2 comments

Before we delete the original oat when recompiling an app, we probe its user and group to later be able to set those accordingly for the freshly compiled, new oat file. However, if compilation fails once (e.g., during debugging) or there is no oat (e.g., we removed it with #10 or the system never created it in the first place), we cannot set user and group properly and the compiled file might be ignored by art.

To fix this, we should be able to determine the correct user and group without having to query the oat each time. This can be solved partially by probing the oat file once in the beginning and persisting the result. However, a superior solution would be to learn per Android OS version (!) what the user and group should be, for example by asking a middleware service such as the package manager or AMS.

schrnz avatar Aug 24 '17 09:08 schrnz

We can't query the PackageManager for API 23. It has two methods PackageManager.getPackageUid() and PackageManager.getPacakgeGids() which where introduced in API 24.

partipan-dot avatar Nov 24 '17 13:11 partipan-dot

Hm, that's bad news =/
If we really cannot find a "clean" solution, we have to probe it once before(!) the first instrumentation, store it in the database, and update it after OS upgrades.

schrnz avatar Nov 24 '17 13:11 schrnz