mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Adjust ipadiff to the latest App Store changes and cleanup
This commit is contained in:
parent
f7bf6f1143
commit
a239070a89
@ -24,12 +24,16 @@ def remove_codesign_dirs(dirs):
|
|||||||
for dir in dirs:
|
for dir in dirs:
|
||||||
if dir == 'SC_Info':
|
if dir == 'SC_Info':
|
||||||
continue
|
continue
|
||||||
if re.match('Watch/.*\\.appex/SC_Info', dir):
|
if re.match('^Watch/.*\\.appex/SC_Info', dir):
|
||||||
continue
|
continue
|
||||||
if re.match('PlugIns/.*\\.appex/SC_Info', dir):
|
if re.match('^PlugIns/.*\\.appex/SC_Info', dir):
|
||||||
continue
|
continue
|
||||||
if re.match('Frameworks/.*\\.framework/SC_Info', dir):
|
if re.match('^Frameworks/.*\\.framework/SC_Info', dir):
|
||||||
continue
|
continue
|
||||||
|
if re.match('^Watch(/.*)?', dir):
|
||||||
|
continue
|
||||||
|
if re.match('^com\\.apple\\.WatchPlaceholder(/.*)?', dir):
|
||||||
|
continue
|
||||||
result.add(dir)
|
result.add(dir)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@ -39,18 +43,20 @@ def remove_codesign_files(files):
|
|||||||
for f in files:
|
for f in files:
|
||||||
if f == 'embedded.mobileprovision':
|
if f == 'embedded.mobileprovision':
|
||||||
continue
|
continue
|
||||||
if re.match('.*/.*\\.appex/embedded.mobileprovision', f):
|
if re.match('^.*/.*\\.appex/embedded.mobileprovision', f):
|
||||||
continue
|
continue
|
||||||
if f == '_CodeSignature/CodeResources':
|
if f == '_CodeSignature/CodeResources':
|
||||||
continue
|
continue
|
||||||
if f == 'CrackerXI':
|
if f == 'CrackerXI':
|
||||||
continue
|
continue
|
||||||
if re.match('Watch/.*\\.app/embedded.mobileprovision', f):
|
if re.match('^Watch/.*\\.app/embedded.mobileprovision', f):
|
||||||
continue
|
continue
|
||||||
if re.match('PlugIns/.*\\.appex/_CodeSignature/CodeResources', f):
|
if re.match('^PlugIns/.*\\.appex/_CodeSignature/CodeResources', f):
|
||||||
continue
|
continue
|
||||||
if re.match('Frameworks/.*\\.framework/_CodeSignature/CodeResources', f):
|
if re.match('^Frameworks/.*\\.framework/_CodeSignature/CodeResources', f):
|
||||||
continue
|
continue
|
||||||
|
if re.match('^Frameworks/libswift*', f):
|
||||||
|
continue
|
||||||
result.add(f)
|
result.add(f)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@ -59,8 +65,10 @@ def remove_watch_files(files):
|
|||||||
result = set()
|
result = set()
|
||||||
excluded = set()
|
excluded = set()
|
||||||
for f in files:
|
for f in files:
|
||||||
if re.match('Watch/.*', f):
|
if re.match('^Watch/.*', f):
|
||||||
excluded.add(f)
|
excluded.add(f)
|
||||||
|
elif re.match('^com\\.apple\\.WatchPlaceholder/.*', f):
|
||||||
|
excluded.add(f)
|
||||||
else:
|
else:
|
||||||
result.add(f)
|
result.add(f)
|
||||||
return (result, excluded)
|
return (result, excluded)
|
||||||
@ -70,7 +78,7 @@ def remove_plugin_files(files):
|
|||||||
result = set()
|
result = set()
|
||||||
excluded = set()
|
excluded = set()
|
||||||
for f in files:
|
for f in files:
|
||||||
if False and re.match('PlugIns/.*', f):
|
if False and re.match('^PlugIns/.*', f):
|
||||||
excluded.add(f)
|
excluded.add(f)
|
||||||
else:
|
else:
|
||||||
result.add(f)
|
result.add(f)
|
||||||
@ -81,7 +89,7 @@ def remove_asset_files(files):
|
|||||||
result = set()
|
result = set()
|
||||||
excluded = set()
|
excluded = set()
|
||||||
for f in files:
|
for f in files:
|
||||||
if re.match('.*\\.car', f):
|
if re.match('^.*\\.car', f):
|
||||||
excluded.add(f)
|
excluded.add(f)
|
||||||
else:
|
else:
|
||||||
result.add(f)
|
result.add(f)
|
||||||
@ -92,7 +100,7 @@ def remove_nib_files(files):
|
|||||||
result = set()
|
result = set()
|
||||||
excluded = set()
|
excluded = set()
|
||||||
for f in files:
|
for f in files:
|
||||||
if re.match('.*\\.nib', f):
|
if re.match('^.*\\.nib', f):
|
||||||
excluded.add(f)
|
excluded.add(f)
|
||||||
else:
|
else:
|
||||||
result.add(f)
|
result.add(f)
|
||||||
@ -125,7 +133,7 @@ def is_binary(file):
|
|||||||
|
|
||||||
|
|
||||||
def is_xcconfig(file):
|
def is_xcconfig(file):
|
||||||
if re.match('.*\\.xcconfig', file):
|
if re.match('^.*\\.xcconfig', file):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
@ -161,7 +169,7 @@ def is_plist(file1):
|
|||||||
|
|
||||||
|
|
||||||
def diff_plists(file1, file2):
|
def diff_plists(file1, file2):
|
||||||
remove_properties = ['UISupportedDevices', 'DTAppStoreToolsBuild', 'MinimumOSVersion', 'BuildMachineOSBuild', 'CFBundleVersion']
|
remove_properties = ['UISupportedDevices', 'DTAppStoreToolsBuild', 'MinimumOSVersion', 'BuildMachineOSBuild', 'CFBundleVersion', 'ITSDRMScheme']
|
||||||
|
|
||||||
clean1_properties = ''
|
clean1_properties = ''
|
||||||
clean2_properties = ''
|
clean2_properties = ''
|
||||||
@ -250,12 +258,12 @@ def ipadiff(self_base_path, ipa1, ipa2):
|
|||||||
clean_ipa1_files = remove_codesign_files(ipa1_files)
|
clean_ipa1_files = remove_codesign_files(ipa1_files)
|
||||||
clean_ipa2_files = remove_codesign_files(ipa2_files)
|
clean_ipa2_files = remove_codesign_files(ipa2_files)
|
||||||
|
|
||||||
diff_dirs(ipa1, clean_ipa1_dirs, ipa2, clean_ipa2_dirs)
|
|
||||||
diff_files(ipa1, clean_ipa1_files, ipa2, clean_ipa2_files)
|
|
||||||
|
|
||||||
clean_ipa1_files, watch_ipa1_files = remove_watch_files(clean_ipa1_files)
|
clean_ipa1_files, watch_ipa1_files = remove_watch_files(clean_ipa1_files)
|
||||||
clean_ipa2_files, watch_ipa2_files = remove_watch_files(clean_ipa2_files)
|
clean_ipa2_files, watch_ipa2_files = remove_watch_files(clean_ipa2_files)
|
||||||
|
|
||||||
|
diff_dirs(ipa1, clean_ipa1_dirs, ipa2, clean_ipa2_dirs)
|
||||||
|
diff_files(ipa1, clean_ipa1_files, ipa2, clean_ipa2_files)
|
||||||
|
|
||||||
clean_ipa1_files, plugin_ipa1_files = remove_plugin_files(clean_ipa1_files)
|
clean_ipa1_files, plugin_ipa1_files = remove_plugin_files(clean_ipa1_files)
|
||||||
clean_ipa2_files, plugin_ipa2_files = remove_plugin_files(clean_ipa2_files)
|
clean_ipa2_files, plugin_ipa2_files = remove_plugin_files(clean_ipa2_files)
|
||||||
|
|
||||||
|
@ -78,6 +78,9 @@ static bool cleanArch(std::vector<uint8_t> &archData, bool &isEncrypted) {
|
|||||||
if (encryptionInfoCommand->cryptid != 0) {
|
if (encryptionInfoCommand->cryptid != 0) {
|
||||||
isEncrypted = true;
|
isEncrypted = true;
|
||||||
}
|
}
|
||||||
|
// The App Store has begun to change offsets in LC_ENCRYPTION_INFO
|
||||||
|
memset(archData.data() + offset + offsetof(encryption_info_command_64, cryptoff), 0, sizeof(uint32_t));
|
||||||
|
memset(archData.data() + offset + offsetof(encryption_info_command_64, cryptsize), 0, sizeof(uint32_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
offset += commandSize;
|
offset += commandSize;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user