Add a post-script to notrack and make pre/post scripts automatically get
ported
This commit is contained in:
		
							parent
							
								
									51f1e9079b
								
							
						
					
					
						commit
						1f69ccf301
					
				
					 2 changed files with 22 additions and 0 deletions
				
			
		
							
								
								
									
										3
									
								
								patches/notrack/1006-post.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										3
									
								
								patches/notrack/1006-post.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -0,0 +1,3 @@
 | 
				
			||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					mv smali/com/crashlytics smali_classes2/com/
 | 
				
			||||||
 | 
					mv smali/com/facebook smali_classes2/com/
 | 
				
			||||||
							
								
								
									
										19
									
								
								patchport.py
									
										
									
									
									
								
							
							
						
						
									
										19
									
								
								patchport.py
									
										
									
									
									
								
							| 
						 | 
					@ -124,6 +124,15 @@ for patch in os.listdir(os.path.join(cutthecord_folder, "patches")):
 | 
				
			||||||
            print(f"patch is not a folder, skipping: {patch}")
 | 
					            print(f"patch is not a folder, skipping: {patch}")
 | 
				
			||||||
        continue
 | 
					        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,
 | 
					    patch_path = os.path.join(cutthecord_folder, "patches", patch,
 | 
				
			||||||
                              f"{from_versioncode}.patch")
 | 
					                              f"{from_versioncode}.patch")
 | 
				
			||||||
    out_path = os.path.join(cutthecord_folder, "patches", 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}.")
 | 
					            print(f"SKIPPED: No {from_versionname} version found for {patch}.")
 | 
				
			||||||
        continue
 | 
					        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.
 | 
					    # Create necessary instead of porting it.
 | 
				
			||||||
    if patch == "necessary":
 | 
					    if patch == "necessary":
 | 
				
			||||||
        patch_contents = make_necessary(to_versioncode, to_versionname)
 | 
					        patch_contents = make_necessary(to_versioncode, to_versionname)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue