[Android Software/Hacking General [Developers Only]] pikachu01:
Sorry for the late reply. Lots of activities nearing Christmas ;) I only had the time to look at the replies via Tapatalk and can't get a hold of my laptop.

It's comparing the ADJ not the memory. Take this code for example:

static int oomAdjToImportance(int adj, ActivityManager.RunningAppProcessInfo currApp) {
if (adj >= ProcessList.HIDDEN_APP_MIN_ADJ) {
if (currApp != null) {
currApp.lru = adj - ProcessList.HIDDEN_APP_MIN_ADJ + 1;
}
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_BACKGROUND;
} else if (adj >= ProcessList.SERVICE_B_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_SERVICE;
} else if [B](adj >= ProcessList.HOME_APP_ADJ)[/B] {
if (currApp != null) {
currApp.lru = 0;
}
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_BACKGROUND;
} else if (adj >= ProcessList.SERVICE_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_SERVICE;
} else if (adj >= ProcessList.HEAVY_WEIGHT_APP_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_CANT_SAVE_STATE;
} else if (adj >= ProcessList.PERCEPTIBLE_APP_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_PERCEPTIBLE;
} else if (adj >= ProcessList.VISIBLE_APP_ADJ) {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_VISIBLE;
} else {
return ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND;
}
}

If HOME_APP_ADJ is 1, almost every app that is evaluated will practically be returned an LRU (least recently used) of 0 and be kept in memory the same priority as the launcher. This would practically nullify the goodness of having an ADJ of 1 at all.

if (app.nonStoppingAdj >= ProcessList.HOME_APP_ADJ
&& app.nonStoppingAdj != ProcessList.SERVICE_B_ADJ
&& !app.killedBackground) {
numTrimming++;
}

It's compares the ADJ, not the memory level of the ADJ.

smali files are disassembled files that can be assembled to be directly read as bytecode operations by Dalvik (that much I've read and understood and now fully understand what you meant by changings in the smali that won't affect trimmings etc). However, if you choose some to be applied as 0x6 (the default HOME_APP_ADJ) and some as 0x1 (the modified HOME_APP_ADJ), you basically won't get the goodness of a "Hard to Kill" Launcher. This is because the algorithm itself that makes it harder to kill is also the one that effectively disable Android LMK.

Note that the HIDDEN_APP_MIN_ADJ did not get compiled as a constant when compiled into Dex largely because Dex compiler might've noticed that the value might change or can be subjected to change later in other functions (maybe). the point of bytecode operations and constants is so that Dex can be loaded faster/ran faster.

You do know that memory trimmings/ OOM/ LRU adjusts are the ones that directly make the Launcher hard to kill right?

I.e.

You change the HOME_APP_ADJ in ProcessList but you don't change the HOME_APP_ADJ in ActivityManagerService. This literally mean that the value in ProcessList only exists there. It doesn't get called like HIDDEN_APP_MIN_ADJ does. If you decide to change it in ActivityManagerService, you'll get a half-baked LMK. That's because some values will be evaluated in a nested if/else then the others are skipped. It's basically like this code

if (a >= 1)
return 1;
else if (a >= 2)
return 2;
else if (a >= 3)
return 3;

The problem is when you changed a to become 1, you'll basically render the other conditions invalid ALL THE TIME.

You don't need Supercharger. You just need a "Keep App in Memory" option in most major launchers out there. This will effectively make the launcher harder to kill. Though, if you Supercharge your phone, you'll break this functionality as "Keep App in Memory" relies on the original OOM adjustments to work.

I forgot to tell you, yes, it's possible to customize the minfrees in ProcessList.smali. You'll have to make sure that Low is 0KB in all of them and then set the high:

mOomMinFree[i] = (long)(low + ((high-low)*scale));

You can't however, adjust the ADJs without breaking something in the end.

After some very long winded discussion with you, I find that you really don't know what you're doing nor you have much knowledge about how Android LMK really works. I'm pretty saddened to learn about this. Nonetheless, I appreciate your tenacity and if you're interested to better the experience of Android phones, you should learn to own up to your mistakes and accept criticisms, especially the ones that questions your own self imposed principles, the ones that you tell other people to follow but don't follow it yourself.

Let me know if you need help in what edits to make in your smali. I may have only learned about it, but I do think that I now know much more about it than you judging from your replies from the past few days that pretty much shows how much you know about it.