APKTool: A tool for reverse engineering Android APK files

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • jadx

    Dex to Java decompiler

  • Heh, mine's "after I count to infinity twice" :) I can't remember if I cribbed that from somewhere...

    IIUC, the permissions apps request ultimately just enable access to certain APIs; they don't do anything on their own: https://stackoverflow.com/questions/24858462/how-to-check-if... (see comments). So apps like https://play.google.com/store/apps/details?id=sk.styk.martin... and https://play.google.com/store/apps/details?id=com.ubqsoft.se... basically reason about the ceiling of everything an app might use across its lifetime. It can be a tad misrepresentative, like a wall of text devoid of formatting can be scary to reason about.

    To make matters worse, the very orthogonal way permissions are categorized relative to internal API architecture is woefully unintuitive at best, making it next to impossible to come up with good summary judgements of what a given app might be trying to do. For example, a given game might want access to your "cell ID information" because the analytics SDK it uses is overly invasive (while the game itself never needs the info), while a smart-device controller app might request "real-time location information" (I forget exactly what the permission is called) just so it can enable Bluetooth (!) to actually connect to your smart whatever.

    So not only is the mapping from policy to implementation a case of a pile of arrows all pointing at each other, the permissions model is really just about enabling access to APIs ahead-of-time so they can be used when needed. Android's trying to go down a just-in-time model where for example something requests access to storage as and when needed; this contextualizes and thus justifies the request, allowing for more informed consent.

    With the ahead-of-time way things work nowadays... I'd be a bit bullish that APKTool on its own would be useful. You're basically in an equivalent situation to wondering why a given Chrome extensions might be asking for a certain permission, only to download the CRX, unzip it, and find everything minified. Intractable? Check. "Now what?": check. Suspicious? Good question :(

    In practice a reasonable number of Chrome extensions incidentally aren't minified and contain perfectly readable source, sometimes even with comments (which is great for figuring out how other developers have solved certain complex integration problems ;D) - but the bytecode-based nature of the Java runtime means you're always working with some level of minification. Control flow is generally always somewhat permuted in much the same way pseudo-decompiled C code doesn't quite look the same as the original. If a given app isn't using obfuscation, you might be able to see some symbol names however.

    Android Studio adds the Proguard obfuscator (which ships for free with 'Studio) into the build instructions of every new project by default, but switched off by default to make builds faster. Once enabled by just changing a couple build settings to "true", obfuscation Just Works™ without any additional steps. Given this state of commoditization it's often a good question whether an app's symbols are available or not.

    JADX (https://github.com/skylot/jadx) is generally the tool people mostly use to fight their way through this status quo. Like with IDA, you generally need a very good idea of exactly what you want to do when using it. "Find why this wants all these permissions" is a sadly very open-ended question from this low-level perspective. :(

    FWIW, there are "interestinger" obfuscators that Proguard out there; I once wondered how a random Chinese smart-device companion app worked internally, and found that it shipped with a .so (shared library!)-based obfuscation/protection runtime. Frida (https://frida.re/) proved particularly awesome here, as it turned that for all the obfuscation and insanity the runtime brought to the table, it was to hide the application's original .dex files, which it briefly wrote to a temporary location on launch - so that was just a question of winning a race condition in an Android emulator.

    TL;DR: You are sadly fundamentally correct in your gut assumption that this is a generally intractable question to straightforwardly answer. :(

    I think one of the most viable realistic goals in pursuit of ideal privacy is to run all traffic through a captive proxy and install CA certificates on at least all phones to enable MITMing all TLS traffic. I've seen the occasional comment on here by people who have done just that; they just uninstall whatever doesn't cooperate (with certificate pinning etc). I've been wanting to do this myself for quite a while but don't have the hardware to pull it off effectively/seamlessly yet. FWIW, device policy controller apps can install CA certificates and start VPNs without any persistent notifications cluttering up the screen (:D) - and they're surprisingly easy to write.

    If there was a specific angle or takeaway I'd like to focus on here, it's that the ecosystem has organically evolved into a headdesk-inducingly awkward but still so incredibly interesting status quo, that sadly requires a bit of attention-span buy-in to get past all the "...!!! *run away*", but in much the same way that learning about Slackware taught me a tonne about Linux (and sed, incidentally, because it was one of the few things that weren't corrupted on the install CD I used, haha) that I wouldn't have known if I hadn't taken everything apart and gone "ok, now maintain this mess", this provides a great hands-on opportunity to learn about network security. (It's kind of amazing everything fits together (and then disappears!) as well as it does.) I'm looking forward to playing around more when I get the chance.

  • Apktool

    A tool for reverse engineering Android apk files

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • netflix_patch

    Discontinued Patched Netflix App for Android enabling Widevine L1 allowing not certified devices to play HD

  • APKTool is amazing. I used it to reverse engineer an old version of Netflix to allow it running on my Xiaomi projector. I no longer need it now as the projector is now Netflix-certificated but it was incredibly useful to me in the earlier days.

    If your devices support Widevine L1 but not certified to run Netflix, you could use this little patch.

    https://github.com/longseespace/netflix_patch

  • Otto

    Automated tooling for APK modification and injection (by elliottcarlson)

  • I wrote a script a few years back to automate decompiling, and weaving in code in to an APK, then recompiling it using a recipe type structure -- https://github.com/elliottcarlson/Otto -- kind of abandoned it sadly, but figure it's worth sharing in case anyone has value in it.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Reverse Engineering the Facebook Messenger API

    2 projects | news.ycombinator.com | 8 Apr 2023
  • Any legit cracking tutorial?

    2 projects | /r/ApksApps | 13 Feb 2023
  • Is there a way to decompile and rebundle an android bundle?

    2 projects | /r/androiddev | 29 Sep 2022
  • how to modify tiktok app

    2 projects | /r/androiddev | 17 Jul 2022
  • I wrote an open source mod of an Android App

    7 projects | dev.to | 4 Oct 2021