[ZTE Axon 7 Guides, News, & Discussion] bkores:
So I decided to write up a little guide on how to modify apk and jar files on the Axon 7 for those of you who do not know how and would like to make some modifications such as the ones in my guides.

Prerequisites

A Windows/Linux/Mac computer

A rooted device with TWRP Recovery

USB cable

ADB installed and USB debugging enabled

Java JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html

APKTool: https://ibotpeaches.github.io/Apktool/install/ (Follow all the instructions)

Baksmali: https://bitbucket.org/JesusFreke/smali/downloads/baksmali-2.2.0.jar

7-Zip or another archive manager

1. Install the frameworks to your computer

Open a command window in your working directory and connect your device to your computer with the USB-C cable.

Pull the framework files with

adb pull /system/framework/framework-res.apk
adb pull /system/framework/framework-zte-res.apk

Install them

apktool if framework-res.apk
apktool if framework-zte-res.apk

Depending on which ROM you are on you may need to install other frameworks. The above is for the stock ROM.

2. Decompile the apk/jar file.

Pull the apk/jar you want to decompile with

adb pull path_to_apk_or_jar

Here are paths for some commonly modified apk/jars:

SystemUI: /system/priv-app/SystemUI_ZTE/SystemUI_ZTE.apk

Settings: /system/priv-app/Settings_ZTE/Settings_ZTE.apk

services.jar: /system/framework/services.jar

Decompile the apk with

apktool d <apk/jar>

If you did everything correctly, a folder should now exist with the name of your apk/jar.

3. Decompile the .odex file

You can skip this step if your apk/jar does not have an .odex associated with it or you only need to modify res and not smali.

Pull the odex file

adb pull path_to_odex

For example if you want to pull the odex file for SystemUI you would do

adb pull /system/priv-app/SystemUI_ZTE/oat/arm64/SystemUI_ZTE.odex

Create a folder called "smali" in the directory of your decompiled apk/jar. Then go back to your working directory.

Pull all boot oat files from your device with

adb pull /system/framework/arm64

Move all the oat files inside the arm64 folder on your PC to your working directory.

Using baksmali, decompile the odex file to smali

java -jar baksmali.jar deodex -a <api> filename.odex

where api is 23 for Android 6.0, 24 for Android 7.0, and 25 for Android 7.1

A new folder should now be created called "out". Cut and paste the files and folders inside this folder into the "smali" folder you created earlier.

4. Make your modifications.

5. Recompile the apk/jar

From the working directory (not the directory of the decompiled apk/jar) Recompile the apk/jar with

apktool b name_of_folder

where name_of_folder is the name of the directory of the decompiled apk/jar.

The complied apk/jar should now exist in the "dist" folder in the directory of the decompiled apk/jar.

6. Sign the apk.

Using 7-zip or another archive manager, copy the res folder, resources.arsc file, and the classes.dex file (if you modified smali in steps 3 and 4) from the NEW apk to the ORIGINAL apk.

7. Replace the apk/jar on your device.

Reboot your device into TWRP recovery with

adb reboot recovery

For user apps: Make sure data is mounted in TWRP's mount menu. If you have encryption turned on you must enter your password otherwise data will not be mounted!

For system apps and framework files: Make sure system is mounted in TWRP's mount menu. Uncheck "Mount system read-only" if it is checked.

Push the ORIGINAL apk/jar to the correct directory on your device

adb push <apk/jar> path_to_apk_or_jar

Set correct permissions on the apk/jar

adb shell chmod 0644 path_to_apk_or_jar

If you did step 3, use TWRP's file manager in Advanced<File Manager to navigate to the apk/jar file's directory and delete the existing .oat or .odex file associated with it.

You did it :)