FORUMS
Remove All Ads from XDA

[DEV][TOOL] Shadow53's Flashable Zip Builder

456 posts
Thanks Meter: 517
 
By Shadow53, Senior Member on 10th September 2017, 10:01 PM
Post Reply Email Thread
Making flashable zip files for Android devices can be… frustrating.

For those who have never tried, here are some of the more irritations:
  • You use a very limited scripting language called edify to write your install scripts. So limited, that some people replace the binary (update-binary) used to parse the script (updater-script) with a normal shell script that performs the installation instead. What’s the point of having update-binary and updater-script, then?
  • Any app installed to /system/ with bundled libraries in the apk need to have those libraries extracted in order to not crash.
  • Various system files need to be created to grant certain permissions to apps by default, and you need to know the syntax of each one (usually some dialect of XML).
  • If the correct permissions are not set on an installed file, it can cause the system to bootloop.

The Solution:

I’ve created a program in Go that reads entries from a configuration file and builds a flashable zip for you, while taking care of the implementation for you. The name is simple: Zip Builder.

Features:
  • Configuration files can be written in JSON, YAML, or TOML.
  • Supports Android versions since 5.0 Lollipop
  • Automatic generation of updater-script and an addon.d persistence script.
  • Automatically extracts libraries from apps being installed under /system/.
  • Can specify different file or app sources for different versions of Android and/or CPU architectures. updater-script will only install the files for that particular system.
  • Validate downloaded files with md5, sha1, and/or sha256.
  • F-Droid interoperability: Specify the repo URL and app’s package name, and zip-builder automatically gets the rest of the app’s information from F-Droid’s repository, including a download link for the latest version of the app.
  • Remove any files you specify, e.g. apps that you are replacing with your own version or apps/files you just don’t want on your system.
  • Standalone binaries available for Mac OS X, Linux, and Windows. Android binaries (to use in a terminal app) coming soon.
    • Linux binaries may be usable with Termux on Android, though this is not tested or supported.

Links

Zips built with this tool
  • EmojiOne Emojis - Replace the NotoSans emojis with the ones from EmojiOne
  • F-Droid installer - Includes the F-Droid privileged extension, allowing F-Droid to perform automatic installs and updates.
  • Hacker bundle - Includes the F-Droid builds of Termux with API, Float, and Widget addons, and Hacker's Keyboard.
  • Google swipe libs - Includes the swipe libraries for the AOSP keyboard. One zip for all Android versions since 5.0 on all architectures.
  • microG - Installs the FOSS replacement for Google Play Services, microG. Optionally install the Play Store for downloading apps, using the patched version from NanoDroid.
  • Google Play Store - choose between the vanilla Google Play Store or the patched one from NanoDroid.
  • Google Sync Adapters - install the Google sync adapters for use with microG. Install contacts sync, calendar sync, or both.
  • UnifiedNlp - If you want network-based location without Google Play Services or microG, install this zip. Comes with the Mozilla location backend and Nominatim geocoder backend.
  • No GAPPS app packs - FOSS replacements for Google Apps packages, provides basic system apps for ROMs running without Google Play Services.. There are multiple tiers of zips you can download, matching the OpenGapps flavors. Click on the link to view the contents of each zip.
The Following 17 Users Say Thank You to Shadow53 For This Useful Post: [ View ] Gift Shadow53 Ad-Free
 
 
14th September 2017, 07:47 PM |#2  
kurtn's Avatar
Senior Member
Flag Small town in Bavaria
Thanks Meter: 923
 
More
microg.zip doesn't flash anything in my redmi 2 oreo aosp. log attached
Attached Files
File Type: log recovery.log - [Click for QR Code] (252.6 KB, 54 views)
16th September 2017, 03:44 PM |#3  
OP Senior Member
Thanks Meter: 517
 
More
Quote:
Originally Posted by kurtn

microg.zip doesn't flash anything in my redmi 2 oreo aosp. log attached

I'm currently working on polishing up a new release of a different project of mine, then I'll have time to look it over.

Per your PM, though, you said busybox wasn't in the location that the zip assumed it was. Can you search through your system and tell me which directories contain either busybox or toybox? (I believe busybox was found in two different folders when I flashed Lineage before)
18th September 2017, 06:42 PM |#4  
kurtn's Avatar
Senior Member
Flag Small town in Bavaria
Thanks Meter: 923
 
More
Quote:
Originally Posted by Shadow53

I'm currently working on polishing up a new release of a different project of mine, then I'll have time to look it over.

Per your PM, though, you said busybox wasn't in the location that the zip assumed it was. Can you search through your system and tell me which directories contain either busybox or toybox? (I believe busybox was found in two different folders when I flashed Lineage before)

Just have to search with the right tool. In twrp I see busybox in the expected location.
19th October 2017, 10:31 PM |#5  
OP Senior Member
Thanks Meter: 517
 
More
Quote:
Originally Posted by kurtn

Just have to search with the right tool. In twrp I see busybox in the expected location.

I had a little bit of time to flash a beta Oreo ROM for my phone and had no issues with things getting copied to my system correctly. If busybox is in the location that the script expects it to be, it's not obvious what the problem is.

The log you gave me seems to show that it mounted your system and data partitions correctly, detected that a folder did not exist, and then exited normally.

Have you tried an updated zip recently? A little while back I had the script output the found values for Android version and CPU architecture. It's possible it got fixed along with whatever I was working on at the time.
The Following User Says Thank You to Shadow53 For This Useful Post: [ View ] Gift Shadow53 Ad-Free
20th October 2017, 06:37 AM |#6  
kurtn's Avatar
Senior Member
Flag Small town in Bavaria
Thanks Meter: 923
 
More
Re-downloaded microg.zip from @Shadow53's page. Now it works as expected.
The Following User Says Thank You to kurtn For This Useful Post: [ View ] Gift kurtn Ad-Free
17th November 2017, 06:09 AM |#7  
OP Senior Member
Thanks Meter: 517
 
More
Pushed a commit that should hopefully fix the issue @marcdw reported in the MicroG thread at https://forum.xda-developers.com/and...5#post74531435
@marcdw, I rebuilt the zips with a build containing the fix. Can you confirm that the libraries are now loading correctly? Things are working on my end, except for the patched Play Store requiring a reboot before working.
The Following User Says Thank You to Shadow53 For This Useful Post: [ View ] Gift Shadow53 Ad-Free
17th November 2017, 07:06 AM |#8  
rottenwheel's Avatar
Senior Member
Thanks Meter: 398
 
Donate to Me
More
As read on the microG thread:

Quote:
Originally Posted by Shadow53

The reason you haven't seen many posts about it is probably because most people use NanoMod as the installer and not my zips.

Although XDA community and most Android modders tend to side with Xposed-based solutions, I need to emphasize this is not the absolute case. I rather to stay away from it as much as I can, because it's given unstability to my devices as soon as I start tinkering with some modules; as soon as I get it removed from my setup, bugs are gone. I don't want to engage in unrelated discussions here, I just wanted to let you know your zip solutions have been working like a charm and many of us will miss if you lose enthusiasm about it. Keep it up and rocking. Thanks to you, getting microG onto our handsets is easier.
The Following 3 Users Say Thank You to rottenwheel For This Useful Post: [ View ] Gift rottenwheel Ad-Free
17th November 2017, 08:25 AM |#9  
kurtn's Avatar
Senior Member
Flag Small town in Bavaria
Thanks Meter: 923
 
More
@rottenwheel do you really mean xposed? I have the impression magisk gets more attention.
17th November 2017, 02:42 PM |#10  
marcdw's Avatar
Senior Member
Flag Baldwin Park
Thanks Meter: 2,893
 
More
@Shadow53,
I had actually edited the updater and add-on.d scripts to use the short names on most of your zips and all was good.
After work I'll start anew using your rebuilds. 👍


ZTE Axon 7 A2017U, Dark ROM, microG (NoGAPPS), Tapatalk 4.9.5
The Following User Says Thank You to marcdw For This Useful Post: [ View ] Gift marcdw Ad-Free
18th November 2017, 06:17 PM |#11  
OP Senior Member
Thanks Meter: 517
 
More
Quote:
Originally Posted by rottenwheel

As read on the microG thread:



Although XDA community and most Android modders tend to side with Xposed-based solutions, I need to emphasize this is not the absolute case. I rather to stay away from it as much as I can, because it's given unstability to my devices as soon as I start tinkering with some modules; as soon as I get it removed from my setup, bugs are gone. I don't want to engage in unrelated discussions here, I just wanted to let you know your zip solutions have been working like a charm and many of us will miss if you lose enthusiasm about it. Keep it up and rocking. Thanks to you, getting microG onto our handsets is easier.

NanoMod is optionally a Magisk module and has nothing to do with Xposed, though I appreciate the sentiment.

*If* I were to lose interest in this project or in providing scripts, the code for the zip-builder is open source and contains the build recipes I use for all of the zips I provide, so it shouldn't be too hard for someone to pick up if they wanted to.

That said, I have no intention of stopping providing zips any time soon, though development on the zip-builder itself is slow because university is keeping me busy. I use my zips too, so I gotta be at least a little invested
The Following 6 Users Say Thank You to Shadow53 For This Useful Post: [ View ] Gift Shadow53 Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes