Skip to main content

A tool to inject toasts in Android applications.

Project description

InjecToast

A tool to inject toasts in Android applications.

injectoast-logofinal

This script uses android application decompilation tools and the FinderZ library in order to function properly. HUGE credits to the authors of the tools that are able to decompile android applications.

This tool is made for educational purposes only!

A command line application that provides you with the ability to inject toasts in Android Applications, written in Python


CHANGELOG: 1.1.6

  • Release Version 1.1.6
  • Fixed comptaibility issue with FinderZ V2.

Tool Information (IMPORTANT)

  • Before you proceed, make sure to install my FinderZ library at: FinderZ This is used in order to manage files properly.
  • It is important to understand that a decompilation tool is required. You MUST decompile the .apk file before using the injector, you can not just give the injector the .apk file, you need to decompile it first.
  • Concerning which tools to use, HUGE credits to those who decompile android applications:
  • Apktool, and ApkToolM.
  • Here are the links:
  • ApkTool
  • ApkToolM (For Android Devices only)
  • FOR ANDROID DEVICES, READ BELOW:
  • If you are on an android device, ApkTool M is a useful application that lets you decompile applications on your device. In order to use InjecToast, however, you also need Termux
  • With Termux, you can emulate a terminal, making it very useful. You can run pip commands, run packages, do anything, which is why if you are on an Android device, you need to have this in order to execute InjecToast.

Installation

Install with pip:

pip3 install InjecToast

Usage

Parameters/Arguments:

-t TOASTMESSAGE
-d DECOMPILEDAPPDIRECTORY
-m METHOD

Concerning the Arguments, -t is for the toast message (Important, make sure to put your toast in between quotation marks!), -d is for the decompiled application directory, and -m is optional at a default of onCreate (MainActivity). If you want to inject a custom method, use -m and put the name of the method after the -m. Please note that the toast message and directory arguments are required.

Execute From Command Line:

InjecToast

Execute from Command Line with arguments:

InjecToast -t "ToastMessage" -d /path/to/decompiledapp/ -m Method #This is optional, default = onCreate / MainActivity.

Full steps:

  • Decompile the app using apktool (if you are on android, you can use ApkTool M. More information above under Tool Information)
  • Copy the directory of the decompiled app.
  • Go to your terminal, and enter:
InjecToast -t "YourMessageHere" -d TheAppDirectory #Please note that the toast message NEEDS to be in between quotes!
  • Once the Log and process has finished, you can recompile the app with apktool of ApkToolM (For Android).
  • Once it is compiled, make sure the apk is signed, and you will be good to go!

Features

  • Inject toasts in Android Applications.
  • Error catching, ability to try and attempt to inject the toast even if something fails
  • Inject a toast message in any method of the application.
  • Very easy to use.
  • Command line interface helps save time, rather than having a menu to choose options from..
  • Logs to print out at what stage the execution is.
  • Cross-platform support, works on Android devices, Mac, PC, Linux, you name it!
  • Fast and efficient, no time lost. Just inject, compile, and you are good to go.

Why?

  • I wanted to showcase how one can easily create a tool that edits other things based off of different code. It was really cool and fun doing this project.
  • Toast messages are a way to decorate an android app, or even debug it. Say, for example, you had your android phone on you, and you experience a bug. You then decompile your app, inject a toast in any method, and look at what happened.
  • Not only that, but many more reasons, one of them being for fun and to showcase how one can easily edit other code by programming in a different language.

How?

  • Using the FinderZ library created by myself, everything was much easier to do. Dealing with files was no longer painful. 20 to 30 lines of code, really only became one, thanks to the FinderZ library.
  • Concerning the code, the summary of what it does is that it basically searches the files for the method, gets the smali contents, and then writes those contents to the line number after the ".locals" of the method.
  • In case you did not know, smali is a code that is semi human-readable, and you get the code when decompiling android applications.

User notice

  • This tool is made for educational purposes only!
  • Please note that you need to know what you are going when it comes to decompiling, recompiling, and signing an android application.
  • When dealing with the toast message, -t, put your toast message in between two quotes!
  • You MUST have the FinderZ library installed in order for this to function. This provides the application with the needed functions to search for files and file content in the app directory.
  • For the application to work, you can use apktool, or, if you are on an Android phone, you can use ApkToolM. More information above under the Tool Information section!
  • This project is under MIT license! Enjoy :)

DEALING WITH ERRORS:

  • If you encounter an error in the compilation of an application, it means that the application is not supported. Overall, the injector works for around 90-95 percent of applications. Sometimes, a compilation tool such as apktool will give you register errors. This means that the application code conflicts with the injector's code.
  • If you get other errors, script wise, such as parsing errors, file finding errors, etc, feel free to create an issue on the GitHub page.

Services used (Credits):


Make sure to leave a star!

  • If you like this project, leaving a star is what motivates me in doing more. Thank you, and I hope this is useful to all.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

InjecToast-1.1.6.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

InjecToast-1.1.6-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file InjecToast-1.1.6.tar.gz.

File metadata

  • Download URL: InjecToast-1.1.6.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for InjecToast-1.1.6.tar.gz
Algorithm Hash digest
SHA256 bdf830863dd7dfad79d25f0eff18ef4b8d7e853cca8f060c9e3521db23c8600d
MD5 bbc1f2f26f8b7c22e693593b00bc4ef2
BLAKE2b-256 ed286049fad060f0ad98a1f209a0938c7fdc1bdde8aed53f37963070c8c5c8b0

See more details on using hashes here.

File details

Details for the file InjecToast-1.1.6-py3-none-any.whl.

File metadata

  • Download URL: InjecToast-1.1.6-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for InjecToast-1.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d86c1b5c6bcbb3d49fefed9cd1cc25a674ec4a94bce1bd940d1b9aef49b35100
MD5 b1c5b02709e28220ecda3748fa04ce6e
BLAKE2b-256 f7395636f36a9bf9987929e98c8b6cb4da9c3b875fcc7874b62b89f17a3731f6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page