forked from TeamVanced/Vanced
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apk2bsdiff.py
18 lines (13 loc) · 830 Bytes
/
apk2bsdiff.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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:])