necessary: add script to get us some extra function space

also adjusting ctcci and patchport to account for this sort of versioned
scripts
This commit is contained in:
ave 2019-10-08 05:08:26 +03:00
parent 9f5058ed0c
commit 5569efefa0
No known key found for this signature in database
GPG Key ID: 09356ABAA42C842B
3 changed files with 19 additions and 0 deletions

View File

@ -205,6 +205,13 @@ for patch_name in PATCHES:
"font", font))
# Apply any other patches
else:
patch_script = os.path.join(REPO_FOLDER, "patches",
patch_name, f"{VERSION}.sh")
if os.path.exists(patch_script):
subprocess.run(f"bash {patch_script}",
shell=True,
cwd=WORK_APK_PATH)
patch(patch_file, WORK_APK_PATH, patch_name)
# Pack the APK

2
patches/necessary/968.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
mv smali/com/crashlytics smali_classes2/com/

View File

@ -130,6 +130,16 @@ for patch in os.listdir(os.path.join(cutthecord_folder, "patches")):
f"{to_versioncode}.patch")
readme_path = os.path.join(cutthecord_folder, "patches", patch, "README.md")
# Handle copying of versioned scripts, untested and dirty!
script_path = os.path.join(cutthecord_folder, "patches", patch,
f"{from_versioncode}.sh")
if os.path.exists(script_path):
script_out_path = os.path.join(cutthecord_folder, "patches", patch,
f"{to_versioncode}.sh")
with open(script_path) as f:
with open(script_out_path, "w") as f2:
f2.write(f.read())
# Check if patch exists for from_version, if it doesn't, warn user
if not os.path.isfile(patch_path) and patch not in ["necessary"]:
# Don't warn on instructional patches