Exemple #1
0
def reinstall(apk_path):

    cmd = "aapt dump badging %s" % apk_path
    ret, out, err = popen(cmd)
    # print ret, out, err

    pt_package_name = "package: name='"
    pt_launch_activity = "\nlaunchable-activity: name='"
    package_name = trivia.extract(out, pt_package_name, "'")
    launch_activity_name = trivia.extract(out, pt_launch_activity, "'")

    cmds = [
        "adb uninstall %s" % package_name,
        "adb install %s" % apk_path,
        "adb shell am start -n %s/%s" % (package_name, launch_activity_name),
    ]
    for cmd in cmds:
        run(cmd)
Exemple #2
0
def extract_sha1(content):
    return trivia.extract(content, "SHA1: ", "\n")
Exemple #3
0
def extract_sha256(content):
    return trivia.extract(content, "SHA256: ", "\n")
Exemple #4
0
def extract_target_sdk(content):
    return trivia.extract(content, "targetSdkVersion:'", "'")
Exemple #5
0
def extract_md5(content):
    return trivia.extract(content, "MD5: ", "\n")
Exemple #6
0
def extract_min_sdk(content):
    return trivia.extract(content, "sdkVersion:'", "'")
Exemple #7
0
def extract_version_name(content):
    return trivia.extract(content, "versionName='", "'")
Exemple #8
0
def extract_version_code(content):
    return trivia.extract(content, "versionCode='", "'")
Exemple #9
0
def extract_launchable_activity(content):
    return trivia.extract(content, "\nlaunchable-activity: name='", "'")
Exemple #10
0
def extract_package_name(content):
    return trivia.extract(content, "package: name='", "'")