SystemUI.apk and framework-res.apk causes bootloop after being modified Hi I'm using a stock LineageOS rom specifically android Pie (LineageOS 16) and I've been modifying system applications, such as SystemUI, framework, gallery, sms etc. before (on samsung ROMS) and so far I haven't got any problem aside from forgetting to set the correct permissions on each apk.

Though when I switched to LineageOS, it seems that I can't simply modify the framework and systemui. I tried the usual way of decompiling and compiling an apk using apktool, then, to sign the apk with its previous/original key, I use the files from the "original" folder in the decompiled apk then build the apk again. Somehow, when I try to replace the apk in my phone, set the correct permissions, and reboot, it will result to bootloop. 

Did I miss anything? Do i need to sign it with another key? Do I need to disable signature-check on my Android?
Signing won't work by just copying the files from the original folder. You could try building the ROM yourself then you'd have the signatures, but I believe there's a much better solution that I've described below.

If you're modifying things that are in res/ and assets/ overlays are most definitely the way to go. They don't require any signature tricks and they can be easily added/removed without you having to even touch the SystemUI or framework. You can use cmd overlay to enable and disable them easily. Building the overlays isn't really easy, so you'd have to get some knowledge related to aapt in order to understand how to build them, or you could use a theme engine like Substratum. There's a template that you can modify and you can manage the overlays within the app.