美文网首页
签名脚本

签名脚本

作者: that_is_this | 来源:发表于2018-07-18 11:27 被阅读21次

1. sign.bat

@echo off
set PATH=%CD%;%PATH%;
python "%~dp0\sign.py" debug.apk

2. sign.py

import subprocess
import shutil
from  xml.dom import  minidom
import zipfile 
import os
import re
import glob
import sys
import codecs
import random
import string
import time

def main(filepath = None):
    if filepath:
        input_filename = filepath
    else:
        input_filename = sys.argv[1]
    shutil.copyfile(input_filename, 'forsign.apk')
    print 'input file_name in : ' + input_filename
    output_filename = 'signed_' + input_filename
    subprocess.Popen('java -jar signapk.jar testkey.x509.pem testkey.pk8 forsign.apk ' + output_filename, stdout=subprocess.PIPE).stdout.read()
    print 'output file_name : ' + output_filename
    subprocess.Popen('adb install -t ' + output_filename, stdout=subprocess.PIPE).stdout.read()
    print 'install success !'
    os.remove('forsign.apk')
    
if __name__ == '__main__':
    start = time.time()
    main()
    end = time.time()
    print "Total time running %s seconds" %(str(end - start))

3. ApkScan.bat

@echo off
set PATH=%CD%;%PATH%;
java -jar "%~dp0\ApkScan-anlShell.jar" %1 %2 %3 %4 %5 %6 %7 %8 %9

相关文章

网友评论

      本文标题:签名脚本

      本文链接:https://www.haomeiwen.com/subject/ylkopftx.html