Skip to content

rubzo/pka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PKA - mess around with APKs!

Introduction

PKA provides some easy commands to extract, modify and reinstall APKs on your Android device. After running pka extract package name, edit the contents of apk_contents/smali to modify your APK, and then run pka install to reinstall the APK, signing it with your own testing certificate.

Dependencies

  • a rooted Android device
  • apktool, visible in your PATH
  • the Android SDK, all tools installed in your PATH

Ideal installation/usage instructions

  1. Copy the pka directory to somewhere safe.
  2. Edit pka, and set PKA_HOME to the directory it's installed in.
  3. Add a symlink to the pka script from a PATH directory. You do have a ~/bin, right?
  4. Run 'pka' with the following commands in a clean directory to perform some APK surgery.
  5. (Make sure you generate a keystore before you run pka install!)

Commands

makekeystore

Generate your keystore. This is needed in order to install your modified APK.

listapk

Display APKs currently installed on the device.

extract package name

Extract the named APK from the device, and unpackage it in preparation for modification.

install

Install your currently modified APK to the device.

modinstall

Install your currently modified APK to the device, using a version of smali in your PATH to assemble the DEX bytecode, instead of apktool's smali.

addmprof info file

Based on the information in the provided info file, add Debug.startMethodTracing() and Debug.stopMethodTracing() calls to your APK. After running, 'getmprof' can be used to retrieve and read the generated profile information.

addbbprof info file

Based on the information in the provided info file, add counters to a target method to get BB statistics about the method. After running, 'getbbprof' can be used to retrieve and read the generated profile information.

addvalprint info file

Based on the information in the provided info file, add calls to Log.i() to print out the value of a given variable to logcat during app execution.

getmprof

Download and view the profiling information generated by addmprof.

viewmprof

View the profiling information generated by addmprof, that has already been downloaded.

getbbprof

Download and view the profiling information generated by addbbprof.

viewbbprof

View the profiling information generated by addbbprof, that has already been downloaded.

reset

Reset your APK's contents to those found when the APK was first extracted from the device.

backup name

Backup the current APK's contents under the provided name.

restore name

Retrieve an APK's contents that were backed up under the provided name.

clean

Cleanup the current directory of any extracted APKs. Doesn't destroy backups.

cleanbackups

Deletes your backups as well.

nuke

Basically a clean, followed by cleanbackups.

About

PKA - Mess around with APKs!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published