-
-
Save zaidw21/3cab32204f1c4022e63b5bf71818d069 to your computer and use it in GitHub Desktop.
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION | |
@echo off | |
for /f %%G in ('dir *.apk /b') do set filename=%%~G | |
set filename=%filename:~0,-4% | |
ECHO -------------------------------------------------- Creating folder started --------------------------------- | |
apktool b %filename% | |
ECHO -------------------------------------------------- Creating folder completed ------------------------------- | |
ECHO -------------------------------------------------- Copying dist to SignApk --------------------------------- | |
move %filename%\dist\%filename%.apk SignApk | |
ECHO -------------------------------------------------- Copying Completed --------------------------------------- | |
ECHO -------------------------------------------------- Creating signed APK ------------------------------------- | |
cd SignApk | |
java -jar signapk.jar certificate.pem key.pk8 %filename%.apk %filename%_new.apk | |
ECHO -------------------------------------------------- Process Complete ---------------------------------------- |
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
@echo off
for /f %%G in ('dir *.apk /b') do set filename=%%~G
set filename=%filename:~0,-4%
ECHO -------------------------------------------------- Creating folder started ---------------------------------
apktool b %filename%
ECHO -------------------------------------------------- Creating folder completed -------------------------------
ECHO -------------------------------------------------- Copying dist to SignApk ---------------------------------
cd %filename%\dist
move %filename%.apk SignApk
ECHO -------------------------------------------------- Copying Completed ---------------------------------------
ECHO -------------------------------------------------- Creating signed APK -------------------------------------
cd SignApk
java -jar signapk.jar certificate.pem key.pk8 %filename%.apk %filename%_new.apk
ECHO -------------------------------------------------- Process Complete ----------------------------------------
We will be using to batch files decompile.bat and recompile.bat.
Put both the files in the same package as the apk file.
Open command prompt at the root folder in which you have put the batch and the apk file.
Run decompile.bat
It will start the process to decompile the apk file into relavant smali files
Make the the changes that you want to make in the respective smali files to tweak the apk
Once done
Run recompile.bat
It will start by fetching automatically fetching the folder name and creating the dist folder inside the decompiled folder.
It will Recompile the code into an apk and sign it with the help of the script.
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
@echo off
for /f %%G in ('dir *.apk /b') do set filename=%%~G
set filename=%filename:~0,-4%
ECHO -------------------------------------------------- Creating folder started ---------------------------------
apktool b %filename%
ECHO -------------------------------------------------- Creating folder completed -------------------------------
ECHO -------------------------------------------------- Copying dist to SignApk ---------------------------------
move %filename%\dist%filename%.apk SignApk
ECHO -------------------------------------------------- Copying Completed ---------------------------------------
ECHO -------------------------------------------------- Creating signed APK -------------------------------------
cd SignApk
java -jar signapk.jar certificate.pem key.pk8 %filename%.apk %filename%_new.apk
ECHO -------------------------------------------------- Process Complete ----------------------------------------
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
@echo off
for /f %%G in ('dir *.apk /b') do set filename=%%~G
set filename=%filename:~0,-4%
ECHO -------------------------------------------------- Creating folder started ---------------------------------
apktool b %filename%
ECHO -------------------------------------------------- Creating folder completed -------------------------------
ECHO -------------------------------------------------- Copying dist to SignApk ---------------------------------
move %filename%\dist%filename%.apk SignApk
ECHO -------------------------------------------------- Copying Completed ---------------------------------------
ECHO -------------------------------------------------- Creating signed APK -------------------------------------
cd SignApk
java -jar signapk.jar certificate.pem key.pk8 %filename%.apk %filename%_new.apk
ECHO -------------------------------------------------- Process Complete ----------------------------------------
@echo off
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
for /f %%G in ('dir *.apk /b') do set filename=%%~G
set filename=%filename:~0,-4%
ECHO -------------------------------------------------- Creating folder started ---------------------------------
ECHO -------------------------------------------------- Creating folder completed -------------------------------
ECHO -------------------------------------------------- Copying dist to SignApk ---------------------------------
cd %filename%\dist
move %filename%.apk SignApk
ECHO -------------------------------------------------- Copying Completed ---------------------------------------
ECHO -------------------------------------------------- Creating signed APK -------------------------------------
cd SignApk
java -jar signapk.jar certificate.pem key.pk8 %filename%.apk %filename%_new.apk
ECHO -------------------------------------------------- Process Complete ----------------------------------------