[Android Apps and Games] AnonVendetta:
For a long time I've been using 3Minit Battery Mod on my Galaxy Note 4 running Marshmallow. It always worked fine, but i could never use a secure lockscreen alongside 3Minit. Anything like PIN/pattern/fingerprint etc just wouldnt work, the device would always fail to unlock. Eventually I figured out that it was a signature issue, that I had to use the signature of the original SystemUI, instead of resigning. But for the longest time I couldnt figure out why I couldnt use a secure lockscreen, only "swipe" unlocking worked.

Today I found this post which pretty much resolves everything:

[THEME][MOD][6.0.1][5.1.1][5.0.1][4.4.4] Customize Your Galaxy Note 4 (N910F) [25/07]

Hello! This Thread is about modifying the TouchWiz UI. In various categories you have the choice between interesting Themes and Mods. And thanks to the VR-Theme-Method you can change a lot just with a few clicks. If you have questions or...

xdaforums.com

Especially the part about "You could also (this might work better) move the res, classes.dex, and resources.arsc files from the new apk to the old one. The latter method is what I prefer.", which turned out to be the silver lining for me. Now I have a working 3Minit, and I can use any secure unlock method without it failing.

So basically, the gist of it is, do the 3Minit mod like it is listed in the first post of this thread. Once you have recompiled it, extract the res folder, classes.dex/resources.arsc from your modded apk, then use something like 7-Zip and merge them over the top of the contents of the original unmodded apk. I dont know why this works, but it does, at least for me. Finally, the solution to a problem that had been nagging me for several yrs.

The only problem of the above approach is that you will have an apk that isn't zipaligned for best performance. I'm sure there's a way to do it on PC, but on mobile I used Apktool M by maximoff. I just selected to optimize and zipalign the apk, WITHOUT RESIGNING. You must not resign or it will break the original signature. After that I pushed the apk into system partition and rebooted. Battery mod working, secure unlock working, everything.

I'm pretty sure the Note 4 Marshmallow firmware only uses signigature verification scheme v1. But there are higher protection schemes out there now, which protect even more and make it harder than ever to mod an apk. This advice might not work so well on higher Android versions that use higher signature verification protection schemes.

I also had to recompile with AAPT v1 instead of AAPT v2, I guess this old device doesnt support v2. But I'm pretty sure that on newer devices you would need to recompile with v2 or you'll get errors.

And dont forget to import the framework-res.apk of your ROM into apktool before recompiling, you will probably get errors if you dont.

You may or may not need to disable Android's signature verification in your ROM. Not sure on that or if it has any effect on 3Minit, but my ROM's signature verification was already patched before i figured this out.

Another thing, you may still have the stock battery icon even after doing the 3Minit mod. To hide it, just decompile the SystemUI and go to /res/values/dimens.xml. search that file for "battery" and carefully edit. It's best to just do this while doing the battery mod. There are a lot of entries, I didn't have to edit all of them. Just "battery level height", " battery level width", "battery text size", and " battery percent text size". All set to either "0.0dip" or "0.0sp". Now I only have the 3Minit battery but no stock battery icon.