Issue
val newInput = "pm uninstall --user 0 $input"
val process = Runtime.getRuntime().exec(newInput)
process.waitFor()
'input' is the package name that want to remove. I signed the application to make it a system app. When I try to run this code I get:
2020-12-23 11:39:18.313 19993-19993/? E/cutils-trace: Error opening trace file: Permission denied (13) 2020-12-23 11:39:18.489 19993-19993/? E/memtrack: Couldn't load memtrack module (No such file or directory) 2020-12-23 11:39:18.489 19993-19993/? E/android.os.Debug: failed to load memtrack module: -2
How can I remove an application from another application with permission?
Solution
For other application removal, you have to get approval from the user. You can perform this process by using intent.
Uri packageURI = Uri.parse("package:"+"some.package.to.remove");
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
startActivity(uninstallIntent);
Answered By - Arda Kazancı
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.