This commit is contained in:
aliveoutside
2022-03-24 19:37:43 +03:00
commit aa972fa5b3
37643 changed files with 6680801 additions and 0 deletions
+97
View File
@@ -0,0 +1,97 @@
#!/bin/bash
#
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Set up prog to be the path of this script, including following symlinks,
# and set up progdir to be the fully-qualified pathname of its directory.
prog="$0"
while [ -h "${prog}" ]; do
newProg=`/bin/ls -ld "${prog}"`
newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
if expr "x${newProg}" : 'x/' >/dev/null; then
prog="${newProg}"
else
progdir=`dirname "${prog}"`
prog="${progdir}/${newProg}"
fi
done
oldwd=`pwd`
progdir=`dirname "${prog}"`
cd "${progdir}"
progdir=`pwd`
prog="${progdir}"/`basename "${prog}"`
cd "${oldwd}"
jarfile=apksigner.jar
libdir="$progdir"
if [ ! -r "$libdir/$jarfile" ]; then
# set apksigner.jar location for the SDK case
libdir="$libdir/lib"
fi
if [ ! -r "$libdir/$jarfile" ]; then
# set apksigner.jar location for the Android tree case
libdir=`dirname "$progdir"`/framework
# also include the library directory for any provider native libraries
providerLibdir=`dirname "$progdir"`/lib64
fi
if [ ! -r "$libdir/$jarfile" ]; then
echo `basename "$prog"`": can't find $jarfile"
exit 1
fi
# By default, give apksigner a max heap size of 1 gig. This can be overridden
# by using a "-J" option (see below).
defaultMx="-Xmx1024M"
# The following will extract any initial parameters of the form
# "-J<stuff>" from the command line and pass them to the Java
# invocation (instead of to apksigner). This makes it possible for you to add
# a command-line parameter such as "-JXmx256M" in your scripts, for
# example. "java" (with no args) and "java -X" give a summary of
# available options.
javaOpts=""
while expr "x$1" : 'x-J' >/dev/null; do
opt=`expr "x$1" : 'x-J\(.*\)'`
javaOpts="${javaOpts} -${opt}"
if expr "x${opt}" : "xXmx[0-9]" >/dev/null; then
defaultMx="no"
elif expr "x${opt}" : "xDjava.library.path=" >/dev/null; then
defaultLibdir="no"
fi
shift
done
if [ "${defaultMx}" != "no" ]; then
javaOpts="${javaOpts} ${defaultMx}"
fi
if [ "${defaultLibdir}" != "no" ] && [ -n $providerLibdir ]; then
javaOpts="${javaOpts} -Djava.library.path=$providerLibdir"
fi
if [ "$OSTYPE" = "cygwin" ]; then
# For Cygwin, convert the jarfile path into native Windows style.
jarpath=`cygpath -w "$libdir/$jarfile"`
else
jarpath="$libdir/$jarfile"
fi
exec java $javaOpts -jar "$jarpath" "$@"
+1
View File
@@ -0,0 +1 @@
36732723e0484a06ee565bd2823ea44aaff52a37
+173
View File
@@ -0,0 +1,173 @@
@echo off
:: ANSI Codes (ONLY windows 10 support)
::RED - [31m
::GREEN - [92m
::NC - [0m
::BOLD - [1m
::UNDERLINE - [4m (Not supporting)
setlocal
call :setESC
cls
echo.
echo %ESC%[1;4mBuild dex...%ESC%[0m
echo.
call gradlew clean
call gradlew versionFile
call gradlew assembleDebug
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo %ESC%[1;4mExport dex...%ESC%[0m
echo.
call gradlew exportDex
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo %ESC%[1;4mMove dex6 to source dir...%ESC%[0m
echo.
move app\classes6.dex smali\
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo %ESC%[1;4mMove dex8 to source dir...%ESC%[0m
echo.
move app\classes8.dex smali\
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo %ESC%[1;4mMove version.properties to source dir...%ESC%[0m
echo.
move app\version.properties smali\assets\
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo %ESC%[1;4mBuild apk...%ESC%[0m
echo.
cd smali\
call java -jar ../scripts/apktool.jar b . -o VTLite.apk --use-aapt2 -p ../scripts/framework/
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
del classes6.dex
del classes8.dex
del assets\version.properties
echo.
echo %ESC%[1;4mSign apk...%ESC%[0m
echo.
call java -jar ../apksigner.jar sign --ks debug.keystore --ks-key-alias androiddebugkey --ks-pass pass:android VTLite.apk
del VTLite.apk
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
:startinstall
SET choice=
SET /p choice=Do you want to install APK?:
IF /i '%choice%'=='Y' GOTO yesinst
IF /i '%choice%'=='yes' GOTO yesinst
IF /i '%choice%'=='Yes' GOTO yesinst
IF /i '%choice%'=='y' GOTO yesinst
IF /i '%choice%'=='N' GOTO noinst
IF /i '%choice%'=='No' GOTO noinst
IF /i '%choice%'=='n' GOTO noinst
IF /i '%choice%'=='no' GOTO noinst
ECHO "%choice%" doesn't exist
ECHO.
GOTO startinstall
:yesinst
echo.
echo %ESC%[1;4mInstall apk...%ESC%[0m
echo.
call adb install VTLite_signed.apk
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
:noinst
:startapp
SET choice=
SET /p choice=Do you want to start app?:
IF /i '%choice%'=='Y' GOTO start
IF /i '%choice%'=='yes' GOTO start
IF /i '%choice%'=='Yes' GOTO start
IF /i '%choice%'=='y' GOTO start
IF /i '%choice%'=='N' GOTO skip
IF /i '%choice%'=='No' GOTO skip
IF /i '%choice%'=='n' GOTO skip
IF /i '%choice%'=='no' GOTO skip
ECHO "%choice%" doesn't exist
ECHO.
GOTO startapp
:start
echo.
echo %ESC%[1;4mOpen VTL...%ESC%[0m
echo.
call adb shell monkey -p com.vtosters.lite -c android.intent.category.LAUNCHER 1
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
:skip
:setESC
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set ESC=%%b
exit /B 0
)
exit /B 0
+89
View File
@@ -0,0 +1,89 @@
#!/bin/bash
RED='\033[31m'
GREEN='\033[92m'
NC='\033[0m'
BOLD='\033[1m'
UNDERLINE='\033[4m'
echo -e "${BOLD}${UNDERLINE}Сборка dex..${NC}\n"
cd ../
./gradlew versionFile
./gradlew assembleDebug
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Экспорт dex..${NC}"
./gradlew exportDex
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Перенос dex6 в папку с исходным кодом..${NC}"
mv app/classes6.dex smali/
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Перенос dex8 в папку с исходным кодом..${NC}"
mv app/classes8.dex smali/
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Перенос version.properties в папку с исходным кодом..${NC}"
mv app/version.properties smali/assets/
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Сборка apk..${NC}"
cd smali/
java -jar ../scripts/apktool.jar b . -o VTLite.apk --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 "\nПодписывание апк..."
cd ../scripts
./apksigner sign --ks debug.keystore --ks-key-alias androiddebugkey --ks-pass pass:android ../smali/VTLite.apk
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}"
else
echo -e "${RED}Провал.${NC}"
fi
echo -e "${BOLD}VTosters Lite успешно собран! APK находится в папке smali${NC}"
cd ../smali
rm classes6.dex
rm classes8.dex
echo -n "Желаете установить VTosters через adb? (y/n) "
read -n 1 prompt
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
then
echo -e "\n"
adb install VTLite.apk
else
exit 0
fi
Binary file not shown.