private static void installAppExitInfoTracker0(Object ams) {
        XLog.i("AppExitInfoTrackerHooks installAppExitInfoTracker");
        // final ProcessList mProcessList
        Object processList = XposedHelpers.getObjectField(ams, "mProcessList");
        XLog.i("AppExitInfoTrackerHooks installAppExitInfoTracker, processList: %s", processList);
        if (processList == null) {
            return;
        }
        // final AppExitInfoTracker mAppExitInfoTracker
        Object appExitInfoTracker = XposedHelpers.getObjectField(processList, "mAppExitInfoTracker");
        XLog.i("AppExitInfoTrackerHooks installAppExitInfoTracker, appExitInfoTracker: %s", appExitInfoTracker);
        if (appExitInfoTracker == null) {
            return;
        }

        // private KillHandler mKillHandler;
        Handler killHandler = (Handler) XposedHelpers.getObjectField(appExitInfoTracker, "mKillHandler");
        XLog.i("AppExitInfoTrackerHooks installAppExitInfoTracker, killHandler: %s", killHandler);
        if (killHandler == null) {
            return;
        }

        Handler.Callback cb = new XKillHandler(killHandler);
        XposedHelpers.setObjectField(killHandler, "mCallback", cb);
    }
We use this hook to track app process kill event and report to thanox service.
Tested on Android12.
android/android_framework/patch-magisk/patch-framework/src/main/java/github/tornaco/thanox/android/server/patch/framework/hooks/am/AppExitInfoTrackerHooks.java