[Android Themes] Raiz:
VII-Installing the apk

​

Your theme should be ready by now, but how do you want to install it?

There are several ways to get an apk inside your phone, I’ll go over the ones I think are the most common.

A)Regular apk install:

​

Just install it duh… (here you go if you need a little help).

B)Flashable zip:

​

I do recommend making flashable zips, because they’re pretty useful when installing modded system apps. So what is it?

1-Folders:

​

A flashable zip contains 2 folders: META-INF and a folder which will mimic the path to the apk we want to install. Inside that succession of folders, we’ll put our modified apk, and when flashing, the modded apk (inside the zip) will replace the original one inside your phone.

Once you get those folders done (and the apk inside of it), it’s time to write the edify script that’ll flash the zip file.

2-Edify Script:

​

Edify is the language the script will be written in.

The file containing the script is located in /META-INF/com/google/android/updater-script (the name of the file is updater-script, naming it something else would make it ignored by your custom recovery)

Open this document with a text editor, and start coding!

We want to copy/paste the content of our zips onto the system (and replace files), so here’s the precise things we’ll do:

a-(OPTIONAL)Your “intro”:

Using the ui_print(" "); command, we can make some really cool looking ASCII art. You can write comments at whatever steps you want with this command, it’s pretty handy!

ui_print("Your Message here");​

b-Mount the system partition

:

​

run_program("/sbin/busybox", "mount", "/system");​

c-Extract the content of the zip to /system

:

package_extract_dir("system", "/system");​

d-Unmount the system partition

:

unmount("/system");​

This is very basic, you can do so much more with edify script! Set the progress bar progress, set permissions to certain files, delete folders and/or files,...

3-Sign your zip:

​

You need to sign your zip after compressing it! The process looks like the one with key.pk8 and certificate.pem files, so I'll refere again to the same thread for that. (In the Credits)

I've covered the basics, now it's index time, you can go further with the links in the credits, and you can suggest me more!

Credits:

[WIP] How to Write an Updater-Script with Edify Code by @Karadorde

That one covers how to sign your zip:

[TUTORIAL] Making Flashable ZIPs, EDIFY Script, ZIP Signing & Key Creation [19.01.13] by @wilskywalker

My Very Own Script by Me

More Links:

[GUIDE] Create your own Flashable ZIP with custom updater-script and addon.d script by @Primokorn

[TUTORIAL] The updater-script completely explained by @KINGbabasula

Spoiler content hidden.

C)ADB sideload:

​

Adb allows one to flash zips through command line using a custom recovery.

How to install adb​

Now how to sideload an apk using adb:

Make sure your phone is plugged, and your PC allowed to use adb on your device. (the last steps of the guide I linked on how to install adb on your pc)

Reboot to recovery

For TWRP : Advanced → ADB Sideload For CWM : Install → Install Zip from Sideload

Code: adb sideload path/to/flashable.zip

And that’s it, congrats

D)Aroma Installer:

​

They’re very cool, yet I’m not really familiar with those.

This concept origins from XDA Inactive Recognized Developer @amarullz , and is used by the OpenGApps team for their Aroma package. Needless to say its work eased the task for many others, feel free to leave a thank on the threads:

Q’n’A about Aroma Installers: [Q&A] AROMA Installer - [Dev Move To DevDB]

Q’n’A about Edify and Aroma: (by @Dblfstr) Aroma, Edify, updater script Question and Answer thread

A tool to create them: [TOOL][3-10-13] Aroma App Package Creator v1.3.2 (by @commandersafi)