-
Description Since I have to work on an Android project which doesn't use Gradle as a build tool, so I always have to find the aar library and extract the classes.jar file from it. Doing it manually was very boring. So I decided to write my own Python (because it's interpreted) script to do this task. The code I have written works very well, but it can be improved by making it cross-platform, efficient, etc.
So let's start to improve it.
Gist: https://gist.github.com/pavi2410/b1ba0ae03e4b459846c72453204394a6
Note that you have to run this script on your PC, unfortunately.
Code import zipfile, os cd = os.getcwd() for file in os.listdir(cd): if file.endswith(".aar"): print("Got aar: " + file) with zipfile.ZipFile(cd + "\\" + file) as aar: aar.extract("classes.jar", cd) print("Extracted aar") os.rename("classes.jar", os.path.splitext(file)[0] + ".jar")
Output:
-
- All
- {{group.name}} ({{group.count}})
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Remove
- Remove comment & replies
- Report