-
Notifications
You must be signed in to change notification settings - Fork 2
/
_transfer.bat
52 lines (40 loc) · 1.21 KB
/
_transfer.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
::
:: LiQuID NiNJa TRaNsFeR
::
@echo off
FOR %%F IN (%~dp0*.apk) DO (call :transfer "%%F")
:transfer
IF %1 == () goto end
:: defines tools folder
set parent="ninjatools"
:: makes working folders
md "%~dp0transfered"
md "%~dp0liquid_otemp_%~n1"
md "%~dp0liquid_ntemp_%~n1"
:: defines tools location
set szip="%parent%\7za.exe"
:: check if the current apk exists
IF EXIST "%~dp0transfered\%~n1.apk" (
:: uncompressing contents of apks
%szip% x -o"%~dp0liquid_otemp_%~n1" %1 *.png -r > nul
%szip% x -o"%~dp0liquid_ntemp_%~n1" %1 *.png -r > nul
:: check if the original apk exists
IF EXIST "%~n1.apk" (
:: gets name of current image folder
FOR /F %%E IN ('dir "%~dp0liquid_otemp_%~n1\res\*" /A:D /S /B') DO (
:: gets name of current png image
FOR %%G IN ("%~dp0liquid_otemp_%~n1\res\**\*.png") DO (
:: check if the current image exists
IF NOT EXIST "%~dp0liquid_ntemp_%~n1\res\**\*.png" (
del /q "%~dp0liquid_otemp_%~n1\res\**\*.png"
)
)
)
)
)
:: -mx* (0-9) indicates the compression level used for all working apks
%szip% a -tzip "%~dp0transfered\%~n1.apk" "%~dp0liquid_otemp_%~n1\*" -mx9 -mmt *.png > nul
rd /s /q "%~dp0liquid_otemp_%~n1"
rd /s /q "%~dp0liquid_ntemp_%~n1"
del /q %1
:end