Add a post-script to notrack and make pre/post scripts automatically get

ported
This commit is contained in:
ave 2019-12-13 12:38:55 +03:00
parent 51f1e9079b
commit 1f69ccf301
Signed by untrusted user: a
GPG Key ID: 398DD7BD03276F6D
2 changed files with 22 additions and 0 deletions

3
patches/notrack/1006-post.sh Executable file
View File

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

View File

@ -124,6 +124,15 @@ for patch in os.listdir(os.path.join(cutthecord_folder, "patches")):
print(f"patch is not a folder, skipping: {patch}")
continue
pre_in_path = os.path.join(cutthecord_folder, "patches", patch,
f"{from_versioncode}-pre.sh")
post_in_path = os.path.join(cutthecord_folder, "patches", patch,
f"{from_versioncode}-post.sh")
pre_out_path = os.path.join(cutthecord_folder, "patches", patch,
f"{to_versioncode}-pre.sh")
post_out_path = os.path.join(cutthecord_folder, "patches", patch,
f"{to_versioncode}-post.sh")
patch_path = os.path.join(cutthecord_folder, "patches", patch,
f"{from_versioncode}.patch")
out_path = os.path.join(cutthecord_folder, "patches", patch,
@ -149,6 +158,16 @@ for patch in os.listdir(os.path.join(cutthecord_folder, "patches")):
print(f"SKIPPED: No {from_versionname} version found for {patch}.")
continue
# Check if pre-script exists, if it does copy it
if os.path.isfile(pre_in_path):
shutil.copyfile(pre_in_path, pre_out_path)
print(f"PRE COPIED: {patch}'s pre script was copied.")
# Check if post-script exists, if it does copy it
if os.path.isfile(post_in_path):
shutil.copyfile(post_in_path, post_out_path)
print(f"POST COPIED: {patch}'s post script was copied.")
# Create necessary instead of porting it.
if patch == "necessary":
patch_contents = make_necessary(to_versioncode, to_versionname)