mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 12:35:33 -04:00
vendor_detect: convert to python3 script
* Binaries are subject to os env
This commit is contained in:
parent
da01e6dcbe
commit
59ed1a0d66
3 changed files with 28 additions and 35 deletions
25
universal7885-common/vendor_detect/main.py
Normal file
25
universal7885-common/vendor_detect/main.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import os
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-d", help="Debug", type=int)
|
||||
args = parser.parse_args()
|
||||
var = vars(args)
|
||||
DEBUG = var['d'] == 1
|
||||
blacklist = ["qcom", "nxp", "samsung", "gapps", "google", "gms", "codeaurora"]
|
||||
vendors = os.listdir("vendor")
|
||||
for vendor in vendors:
|
||||
if DEBUG:
|
||||
print("Found vendor " + vendor)
|
||||
if vendor in blacklist:
|
||||
if DEBUG:
|
||||
print("Vendor " + vendor + " in blacklist. Skipping...")
|
||||
else:
|
||||
if DEBUG:
|
||||
print("Vendor " + vendor + " not in blacklist. Writing...")
|
||||
f = open("device/samsung/universal7885-common/vendor_name", "a")
|
||||
f.write(vendor)
|
||||
f.close()
|
||||
break
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in a new issue