Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9b417e8

Browse files
committedJun 24, 2022
Fixing issue with Android R+
1 parent 948bd2e commit 9b417e8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed
 

‎patch_apk.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def zip_align_apk(apk):
6464
print("Running zipalign...")
6565
tmp_apk = apk.replace(".apk","_tmp.apk")
6666
shutil.move(apk, tmp_apk)
67-
subprocess.call('zipalign -p -f 4 {0} {1}'.format(tmp_apk, apk), stderr=subprocess.STDOUT, shell=False)
67+
subprocess.call('zipalign -p -f 4 {0} {1}'.format(tmp_apk, apk), stderr=subprocess.STDOUT, shell=True)
6868
os.remove(tmp_apk)
6969

7070

@@ -169,10 +169,8 @@ def patch_apk(apk):
169169
apk_out = ZipFile(os.path.join(TEMP_FOLDER, "new_apk.apk"), "w")
170170
files = apk_in.infolist()
171171
for file in files:
172-
if not os.path.exists(os.path.join(TEMP_FOLDER, file.filename)) and not file.filename.startswith("META-INF\\") and not file.filename.startswith("resources.arsc"):
172+
if not os.path.exists(os.path.join(TEMP_FOLDER, file.filename)) and not file.filename.startswith("META-INF\\"):
173173
apk_out.writestr(file.filename, apk_in.read(file.filename), compress_type=file.compress_type, compresslevel=9)
174-
if not os.path.exists(os.path.join(TEMP_FOLDER, file.filename)) and file.filename.startswith("resources.arsc"):
175-
apk_out.writestr(file.filename, apk_in.read(file.filename), compress_type=zipfile.ZIP_STORED, compresslevel=0)
176174
apk_in.close()
177175
libfolder = os.path.join(TEMP_FOLDER, "lib")
178176
for (root, _, files) in os.walk(libfolder, topdown=True):

0 commit comments

Comments
 (0)