[Miscellaneous Android Development] Need4Sneed:
I AM NOT RESPONSIBLE FOR ANY DAMAGE DONE TO YOUR PHONE BY IMPLEMENTING THIS MODIFICATION!!

IMPORTANT: THIS IS A RELATIVELY NEW TWEAK I HAVE IMPLEMENTED ON A DEVICE I DO NOT USE AS A DAILY DRIVER. I HAVE ONLY BEEN USING THIS ARISTO AS A TEST FOR 4 DAYS WITH THIS MOD IN PLACE (AT THE TIME OF THIS WRITING). I DO NOT KNOW HOW STABLE THIS IS, OR IF ANYTHING WILL RANDOMLY KNOCK OUT MY TWEAKS, BUT SO FAR SO GOOD. BUT . . . . ALWAYS REMEMBER, YOUR MILAGE MAY VARY!! PLEASE SHARE YOUR EXPERIENCE WITH THIS TWEAK SO WE CAN IMPROVE ON IT'S STABILITY!!

So here's the story . . . .

My girlfriend got a free LG Aristo from MetroPCS when she switched carriers, which was a damn good deal IMHO. After using it for a month or so, she's pretty happy with it, aside from the usual gripes that come with low-midrange devices. I repair phones and computers for a living so I wanted to tinker with it and see what, if anything, could be done to give it that little bit of extra 'oomph' in performance, battery life, etc. Since it's her only device I didn't wanna risk depriving her of her phone if anything went sideways, so I kept my eyes open for an Aristo to pop up, and the other day, one did! One of my clients texted me asking if I wanted to buy a broken Aristo for parts, and considering the only thing wrong with it is a cracked screen, I jumped on it.

So, now that I have the guinea pig Aristo to play with, I did a quick search to see what kind of dev community this device had here, and on XDA. I stumbled accross

this post

with a working TWRP v3 (BTW, mad props to messi2050 for the TWRP v3, no-verity-opt-encrypt script link, and tutorial! MANY THANKS!).

I was a little surprised that the Aristo has an easily unlockable bootloader, so I give credit to LG for giving folks the option to do what they want with THEIR device.

With the bootloader unlocked and TWRP installed, I went ahead and formatted the /data partition to disable encryption (AFTER MAKING A NANDROID OF CORSE!!). After rebooting back into TWRP, I transfered the no-verity-opt-encrypt script and Magisk v13.2 and flashed them (IN THAT ORDER).

Magisk was a must since my girl plays Super Mario Run, and a few other games/apps that check Safety Net, and I'm happy to report that with Magisk v13.2 installed, Safety Net passes without issue.

Now comes the issue of LG underclocking the Snapdragon 425. Looking at it from LG's perspective, I understand the logic behind this implementation; a lower max_freq is definitely gonna give you a bit of extra battery life, and since low-midrange devices like the Aristo are unlikely to be used for anything more than calling/SMS/MMS, web browsing, YouTube, and light gaming, they probably figured that that bit of extra performance wouldn't be missed by most people buying this device.

The Snapdragon 425 has a max CPU clock speed rated at 1.4GHz, however, the LG Aristo tops out at 1.25GHz (1.248GHz). Using flar2's EX Kernel Manager (I use ElementalX on ALL of my other devices, but his kernel manager app works with ANY kernel), I couldn't get the max-freq to stick at 1401MHz. Strangely, it would max out at either 1248MHz, or 1094MHz, and even setting it to apply on boot proved futile. Then, I noticed that the frequency range in CPU-Z was '960MHz - 1.25MHz', so then I headed for the source:

/sys/devices/system/cpu

In this folder you will see the following folders:

cpu0

cpu1

cpu2

cpu3

Interestingly enough, the max rated frequency of '1401000' is listed in the 'scaling_available_frequencies' file of each core, meaning that specific frequency can be controlled by the kernel (CPU governor) if directed via each core's 'cpuinfo_max_freq' file.

(NOTE: This guide will walk you through changing the max_freq only for cpu0, however, the method for cpu0 is identical for cpu1, cpu2, and cpu3, so just repeat the steps for each cpu core)

Step 1.) Open the folder 'cpu0' [/sys/devices/system/cpu/cpu0]

Step 2.) Inside the 'cpu0' folder, find the folder 'cpufreq' [/sys/devices/system/cpu/cpu0/cpufreq]

Step 3.) Inside the 'cpufreq' folder, find the file 'cpuinfo_max_freq' [/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq]

Step 4.) Open it with a text editor (I am using Solid File Explorer w/ Root add-on which has a built in text editor, but ES File Explorer, Root Explorer, etc. all have built in text editors)

Step 5.) Change the value from '1248000' to '1401000' (WITHOUT ' ' MARKS OF COURSE!!)

Step 6.) Save the file after making the changes.

Step 7.) Repeat the above steps for the remaining 3 A53 cores. If you need to follow the guide for each core, just change the 'cpu0' in STEP 1 to 'cpu1', then 'cpu2', etc.

Step 8.) After making the changes to each core and saving your edits, exit out of your file manager and reboot (Now, if you go back to look at your edit after saving the cpuinfo_max_freq, it will appear as if your edit did not stick, but trust me, it will stick when you reboot).

Step 9.) After rebooting, open your root file explorer and check the edits you made to each core's 'cpuinfo_max_freq' file. They should now all read '1401000'.

Step 10.) Open your preferred kernel editor/auditor app and change the max frequency to 1401MHz, and this time it will stick. If it does not stick, simply change your CPU governor to 'Performance', then set the max to 1401MHz and that should make it stick. After that, close your kernel tweaking app and open CPU-Z or some other app that shows the current CPU frequency and check that it's locked at 1401MHz. Once you see that it's locked at 1401MHz, go back into your kernel tweaking app and change the governor back to your desired setting (I'm using Interactive), then check to see that the CPU max frequency is still locked at 1401MHz.

Step 11.) DON'T FORGET TO SET YOUR KERNEL EDITOR/AUDITOR TO APPLY THE CHANGES ON BOOT!! For some reason, if you don't set on boot it will randomly change the max speed between 1094MHz and 1248MHz.

Step 12.) PROFIT!!

NOTES:

- Solid File Explorer automatically mounts /system -rw when you open it. I'm not sure about other root file explorers, so make sure you mount /system -rw or your edits will not save/stick

- This is a relatively new tweak, so if anyone can expand on what I've covered here, please do!!