Skip to content

Commit

Permalink
Kill 不杀自身.
Browse files Browse the repository at this point in the history
  • Loading branch information
xingda920813 committed Aug 29, 2017
1 parent 937ea32 commit 75d41fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Binary file modified Kill.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ protected void onCreate(Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) return;
new Thread(() -> {
try {
ActivityManager am = getSystemService(ActivityManager.class);
String thisApp = getPackageName();
Method m = ActivityManager.class.getMethod("forceStopPackage", String.class);
ActivityManager am = getSystemService(ActivityManager.class);
getPackageManager().getInstalledPackages(0)
.stream()
.filter(i -> (i.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0)
.filter(i -> (i.applicationInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) == 0)
.map(i -> i.packageName)
.filter(n -> !thisApp.equals(n))
.forEach(n -> {
try { m.invoke(am, n); } catch (Exception e) { e.printStackTrace(); }
});
Expand Down

0 comments on commit 75d41fc

Please sign in to comment.