0
0
Fork 0
mirror of https://github.com/YTVanced/Vanced synced 2024-11-10 12:55:07 +00:00
Vanced/apk2bsdiff.py
2022-02-16 23:45:56 +00:00

18 lines
830 B
Python

import bsdiff4
import shutil
from pathlib import Path
for path in Path('./nonroot/Arch').rglob('*.apk'):
bsdiff4.file_diff(str(path).replace('nonroot', 'root'), path, './patches/Arch/' + path.name.replace('.apk','.bsdiff'))
for path in Path('./nonroot/Language').rglob('*.apk'):
bsdiff4.file_diff(str(path).replace('nonroot', 'root'), path, './patches/Language/' + path.name.replace('.apk','.bsdiff'))
for path in Path('./nonroot/Theme').rglob('*.apk'):
bsdiff4.file_diff('base.apk', path, './patches/Theme/' + path.name.replace('.apk','.bsdiff'))
for path in Path('./root/Theme').rglob('*.apk'):
bsdiff4.file_diff('base.apk', path, './patches/root/' + path.name.replace('.apk','.bsdiff'))
for path in Path('./patches').rglob('*.bsdiff'):
shutil.copy(path, './patches/' + str(path).replace('/', '-')[8:])