Skip to content

Instantly share code, notes, and snippets.

@zaidw21
Last active January 27, 2020 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zaidw21/3cab32204f1c4022e63b5bf71818d069 to your computer and use it in GitHub Desktop.
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 ----------------------------------------
@zaidw21
Copy link
Author

zaidw21 commented Jan 27, 2020

@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 ----------------------------------------

@zaidw21
Copy link
Author

zaidw21 commented Jan 27, 2020

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 ----------------------------------------

@zaidw21
Copy link
Author

zaidw21 commented Jan 27, 2020

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.

@zaidw21
Copy link
Author

zaidw21 commented Jan 27, 2020

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 ----------------------------------------

@zaidw21
Copy link
Author

zaidw21 commented Jan 27, 2020

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 ----------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment