Skip to content

Commit

Permalink
Misc Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DHD2280 committed Apr 30, 2024
1 parent eac14b4 commit 505dcae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
hookAllMethods(OnScreenFingerprint, "startFadeOutAnimation", new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
if (hideFingerprint || customFingerprint) param.setResult(null);
if (hideFingerprint || customFingerprint) updateFingerprintIcon(param, true);
}
});
} catch (Throwable t) {
log(TAG + "startFadeInAnimation not found");
log(TAG + "startFadeOutAnimation not found");
}

// Affordance Section
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import it.dhd.oxygencustomizer.R;
import it.dhd.oxygencustomizer.utils.Constants;
import it.dhd.oxygencustomizer.xposed.ResourceManager;
import it.dhd.oxygencustomizer.xposed.XPLauncher;
import it.dhd.oxygencustomizer.xposed.XposedMods;
import it.dhd.oxygencustomizer.xposed.hooks.framework.Buttons;
import it.dhd.oxygencustomizer.xposed.utils.DrawableConverter;
Expand Down Expand Up @@ -305,7 +306,6 @@ private String[] getForegroundApp() {

private void killForegroundApp() {
Handler mainHandler = new Handler(Looper.getMainLooper());
Log.d("KillAppNow", "Killing foreground app");
mainHandler.post(() -> {
try {
ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
Expand All @@ -314,17 +314,13 @@ private void killForegroundApp() {
String foregroundApp = null;
String[] appInfo = getForegroundApp();
foregroundApp = appInfo[0];
String uid = appInfo[1];
log("Foreground app: " + foregroundApp + " with UID: " + uid);


if (foregroundApp != null && !foregroundApp.equals(Constants.Packages.SYSTEM_UI) && !foregroundApp.equals(getDefaultLauncherPackageName())) {
//am.killBackgroundProcesses(foregroundApp);
if (ShellUtils.checkRootPermission()) {
List<String> commands = new ArrayList<>();
commands.add("killall " + foregroundApp);
commands.add("am force-stop " + foregroundApp);
ShellUtils.execCommand(commands, true);
String finalForegroundApp = foregroundApp;
XPLauncher.enqueueProxyCommand(proxy -> proxy.runCommand("killall " + finalForegroundApp));
XPLauncher.enqueueProxyCommand(proxy -> proxy.runCommand("am force-stop " + finalForegroundApp));
}
String appLabel = getApplicationLabel(foregroundApp, mContext.getPackageManager());
Toast.makeText(mContext, "Killed: " + appLabel, Toast.LENGTH_SHORT).show();
Expand Down

0 comments on commit 505dcae

Please sign in to comment.