Is it possible for an Android app to kill its own process? Say, as an anti-tampering feature, the app detects that its integrity has been breached, say by checking the app signer cert. It then exits the app, but the app process still lingers in memory. If an attacker had changed AndroidManifest.xml to set android:debuggable="true", he could still view it in Android Device Monitor and debug/analyze the app if the process still exists.
Asked
Active
Viewed 454 times
1 Answers
0
you can kill process by using this code
This will kill the process, but it won't necessarily kill the task in memory. So when the app is restarted, the activity stack (task) will just get re-created from last time Please use this code in Main Activity (Please don't use in every activities or sub Activities):
@Override
public void onBackPressed() {
android.os.Process.killProcess(android.os.Process.myPid());
// This above line close correctly
}

lllllllllllllll
- 77
- 10
-
you should avoid this method, it kills all the pending tasks too – Ege Kuzubasioglu Jun 07 '18 at 06:12