julkali / makedebuggable Goto Github PK
View Code? Open in Web Editor NEWA script to make a release Android APK debuggable
A script to make a release Android APK debuggable
Hello!
I try to make debuggable version of some release app with
apktool d -o output-dir com.app.apk
python3 makeDebuggable.py xml ./output-dir/AndroidManifest.xml ./output-dir/AndroidManifest.xml
But I have that error message
Traceback (most recent call last):
File "***/makeDebuggable.py", line 606, in <module>
patchManifestByFilename(sys.argv[2], sys.argv[3])
File "***/makeDebuggable.py", line 528, in patchManifestByFilename
patchManifest(fIn, tmp)
File "***/makeDebuggable.py", line 463, in patchManifest
raise Exception("File header not of size 8!")
And if I try
python3 makeDebuggable.py apk com.app.apk com.app_debuggable.apk resign.keystore alias_name
with key, generated with
keytool -genkey -v -keystore resign.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
I have output
Patching AndroidManifest.xml ...
Found application tag at 19892 !
Debuggable not present, need to update string pool, res map and attributes ...
Injecting 'debuggable' at index 47 ...
Copying rest of files
zipalign not found in path, aborting.
and file com.app_debuggable.apk.tmp with correct size.
But I think, it's not signed.
Please say what are you thinking about it. Thanks a lot!
When I try to run the script against an apk-file, I get following log:
$ python3 makeDebuggable.py apk app.apk app.debug.apk ../resign.keystore alias_name
Patching AndroidManifest.xml ...
Found application tag at 73296 !
Debuggable not present, need to update string pool, res map and attributes ...
Injecting 'debuggable' at index 49 ...
Copying rest of files
Signing ...
USAGE: apksigner <command> [options]
apksigner --version
apksigner --help
EXAMPLE:
apksigner sign --ks release.jks app.apk
apksigner verify --verbose app.apk
apksigner is a tool for signing Android APK files and for checking whether
signatures of APK files will verify on Android devices.
COMMANDS
rotate Add a new signing certificate to the SigningCertificateLineage
sign Sign the provided APK
verify Check whether the provided APK is expected to verify on
Android
lineage Modify the capabilities of one or more signers in an existing
SigningCertificateLineage
version Show this tool's version number and exit
help Show this usage page and exit
apksigner version
$ apksigner --version
0.9
$ apt-cache policy apksigner
apksigner:
Installed: 0.9-1
Candidate: 0.9-1
Version table:
*** 0.9-1 500
500 http://fi.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
500 http://fi.archive.ubuntu.com/ubuntu focal/universe i386 Packages
I got the application working by manually executing following to sign it:
apksigner sign --ks resign.keystore app.debug.apk
https://github.com/julKali/makeDebuggable/blob/master/makeDebuggable.py#L210
(strBytes, bytesRead2) = decodeLength(1)
shouldn't it be decodeLength(fs, 1)
?
https://github.com/julKali/makeDebuggable/blob/master/makeDebuggable.py#L19
DEBUGGABLE_STRING_LENGTH_UTF16 = 24 # 2 + 10 + 2
It should be 2 + 20 + 2 = 24
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.