Added R.java generator and executing scripts

This commit is contained in:
Vologhat
2022-10-14 22:14:56 +03:00
parent d678ff5e9b
commit a05865c6a8
3 changed files with 71 additions and 0 deletions
Binary file not shown.
+36
View File
@@ -0,0 +1,36 @@
@echo off
cd scripts
echo.
echo Decompile release APK...
echo.
call java -jar apktool.jar d VTLite.apk -f -o tmp -s --use-aapt2 -p ../scripts/framework/
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo Generate R.java
echo.
call java -jar rclass-generator.jar -f tmp/res/values/public.xml -o ..\app\src\main\java\com\vtosters\lite\R.java -p com.vtosters.lite --comments
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo Clean temp dir
echo.
call rmdir /s/q tmp
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
+35
View File
@@ -0,0 +1,35 @@
#!/bin/bash
RED='\033[31m'
GREEN='\033[92m'
NC='\033[0m'
BOLD='\033[1m'
UNDERLINE='\033[4m'
cd ../
echo -e "${BOLD}${UNDERLINE}Decompile release APK...${NC}\n"
java -jar ../scripts/apktool.jar d VTLite.apk -f -o tmp -s --use-aapt2 -p ../scripts/framework/
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Regenerate R.java file...${NC}\n"
java -jar ../scripts/rclass-generator.jar -f ../scripts/tmp/res/values/public.xml -o ../scripts/app/src/main/java/com/vtosters/lite/R.java -p com.vtosters.lite --comments
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Clean temp dir...${NC}\n"
rm -rf ../scripts/tmp
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi