0

I'm struggling with how I can manage updating an APK in a non App-Store deployment model.

Up until recently I was able to use the AndroidManifest.xml decompress method found Here. I'm not sure if it's the new Gradle 4.1, or Android Studio 3, but this no longer is able to parse the XML.

My scenario is that I want to know the versionName and versionCode of the APK without having to download it and inspect it on the device. Our deployment model is such that the app will check the local server each time it starts to see if there is an updated version, and prompt the user to update if there is a newer version to update to. Without the ability to read the AndroidManifest I struggle with how to do this.

I have looked into using aapt.exe I could do something like described Here, but based on my research Here, I can't re-distribute the single exe in my installer. And I don't really want to install the entire SDK on a production server.

Is there another official means of inspecting this that I'm missing?

Brian S
  • 3,096
  • 37
  • 55
  • 1
    Since decompilers still work (AFAIK), I'm sure that there is a recipe for getting the info from the APK's manifest, even if the specific code snippet that you're using isn't working. You might consider asking a separate SO question where you provide your code and explain your symptoms. Personally, I'd consider holding this information in metadata files, akin to how artifact repositories (e.g., Maven) work. – CommonsWare Nov 30 '17 at 16:58
  • The APK can be opened as a Zip, but the issue is that the AndroidManifest.xml where this stuff is stored is either compressed or encrypted somehow, for some reason. The first link I posted points to the Java code that will decrypt an older style of APK, but something has changed and it no longer works. And without knowing the algorithm, I don't know I have the expertise to reverse engineer it. – Brian S Nov 30 '17 at 16:59
  • 1
    It's been that way since Android 1.0 (and probably before that). The manifest and XML resources are stored in a "binary XML" format. Plenty of tools are around to let you access that stuff. – CommonsWare Nov 30 '17 at 17:01
  • it seems something has changed with it though, and I have yet to see anything with an updated solution – Brian S Nov 30 '17 at 17:02
  • With that comment about binary XML, I did search and find this project. I'll give it a try. It was updated 17 days ago https://github.com/xgouchet – Brian S Nov 30 '17 at 17:04

0 Answers0