Exploit database

GH-5f8101aebf9f68f19f227a3c3c95b21b

satheesh575555/packages_apps_settings_aosp10_r33_cve-2020-0416

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2020-0416

2 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files17

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

wrap_alpha.py

Python · 1,310 bytes
#!/usr/bin/python

import os

# assume everything needs alpha suffixes
for root, dirs, files in os.walk('.'):
    if "res/drawable-" not in root: continue

    for before in files:
        if "_alpha.png" in before: continue
        if not before.startswith("ic_settings_"): continue

        after = before.replace(".png", "_alpha.png")
        os.rename(os.path.join(root, before), os.path.join(root, after))

# build xml redirection
for root, dirs, files in os.walk('.'):
    if "res/drawable-" not in root: continue

    for src in files:
        if not src.endswith(".png"): continue
        src = src[0:-4]

        src_clause = '\n    android:src="@drawable/%s"' % (src)

        alpha = src.endswith("_alpha")
        if alpha:
            src = src[0:-6]
            alpha_clause = '\n    android:tint="?android:attr/colorAccent"'
        else:
            alpha_clause = ''

        am = src.endswith("_am")
        if am:
            src = src[0:-3]
            am_clause = '\n    android:autoMirrored="true"'
        else:
            am_clause = ''

        with open("res/drawable/%s.xml" % (src), 'w') as xml:
            xml.write("""<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"%s%s%s />
""" % (src_clause, alpha_clause, am_clause))