[Miscellaneous Android Development] Death Mask Salesman:
Introduction​

Hello, everyone. For a long time have I been lurking around XDA, and plenty of knowledge have I gathered. I feel that it's now my turn to thank the community for all this, and I've chosen to do so by publishing a project that I kept for personal use: Nemris, my Python 3.5+ APK extractor.

License​

Nemris is licensed under the WTFPL license, so you're free to do WTF you want to it and its source. Don't even bother asking.

Disclaimer​

By using this piece of software, you agree that I, the original author, am not to be considered liable of any damage to your data, phone or dog. Using it is your choice; I'm not forcing you to do so.

Requirements​

Nemris is to be ran on a rooted phone. It does need Python 3.5 or greater to run, and has been tested on CM12.1 (Lollipop), CM13 (Marshmallow) and AICP12.1 (Nougat). To make things easier, install Python from within the Termux app (available on F-Droid - I'm not affiliated with it) and run Nemris from there. It also needs aapt or aopt to be installed in /system/bin. To summarize:

Root permissions (systemless root is not supported);

aapt or aopt in /system/bin;

Python 3.5+.

Overview of the features​

This tool's scope is to be freely customizable on the fly, which is allowed by its Python nature.

It leverages root permissions in order to read from the /data/system/packages.xml file, in order to create an index of paths corresponding to the installed apps, which is way faster than using pm path. Root permissions are also used in case you want to store your extracted APKs on the external SD, but your Android version is equal or greater than 6.0, by exploiting the privileged nature of the system shell.

Furthermore, Nemris is able to discern between user, system and disabled apps, and to ignore Substratum overlays and Arcus theme variants.

In the end, thanks to a MD5 checksums dictionary, it can avoid making unneccessary extractions by comparing the MD5 of the inspected app to said dictionary.

Fantastic, but how do I run the thing?​

You run it by using python /path/to/the/script.py. Actually, running it without arguments returns a short usage message, but running it with argument -h will give you a clear outline of the allowed arguments.

Can I exclude/extract only specific apps?​

Not at the moment, and it's not something I'm interested to include. You can extract only apps pertaining to a specified group, though. The allowed groups are User, System, Disabled and All apps.

But I want to extract my Substratum overlays/Arcus variants!​

That's what the arguments --keep-substratum and --keep-arcus are for.

I want to change my destination directory, but there's no setting to do so!​

To save time and spare you from entering yard-long arguments, Nemris asks for the chosen destination directory exactly once, at the first run. It then saves this preference, along with the MD5 dictionary and other info inside a file called nemris_config.pkl, which is in a binary format you can't edit. You can make Nemris delete this file by using the -r argument, though, and make the tool run as if in its first launch.

I want feature X to be included!​

You're free to contribute to Nemris' development and add the feature yourself. I'm kind of lazy, so asking me wouldn't probably help you.

I would like a detailed explanation of the arguments!​

Head over to the project's source and read the README.md, which should be clearer than this post.

Nemris doesn't delete old APKs!​

This is done under the assumption that you might need them. So, no, it won't delete them.

Have fun with my tool!

XDA:DevDB Information

Nemris, Tool/Utility for all devices (see above for details)

Contributors

Death Mask Salesman

Source Code: https://github.com/DMSalesman/Nemris

Version Information

Status: Testing

Beta Release Date: 2017-02-09

Created 2017-02-17

Last Updated 2017-02-17