📖 Tutorial How to add Custom Toast Messages, Dialogs & Splash Screens in MOD APK Files

Sbenny.com is trusted by 1,324,048 happy users since 2014.
Register

Nardo7

APK Fanatic Lv5️⃣
Member for 5 years
Responding because you also went to try out ModIDE (my project), which has a tool to auto inject a toast with html tags accepted. My best guess is you didnt put the toast in the correct smali (some apks have multiple onCreate methods, if the main activity is a subclass). Look for a line near the top saying ".super", if it has that check the directory and file it mentions, see if that has an onCreate method as well. Toasts work sometimes when placed in the subclass while html tagged toasts usually only work if placed in the topmost onCreate method.

Alternatively, when testing out my project, you can use the add/edit toast feature to store a toast that when you build an apk project in it, will inject the toast in the correct file, and permits html.
Ok thanks for your answer, i place the toast message in "UnityPlayerActivity" and "UnityPlayerNativeActivity" but i get the same result on using html tags.
I will try your tool =)
Thanks again.
 

Turbos

Apprentice Lv2️⃣
Member for 5 years
In sometimes in some games the unity3d folder is not there if some game the unity3d folder is there but i don't see the player folder only see the ads folder what is the reason and where i can use this Toast message in the type of games
 

s810car

In Love Lv4️⃣
Member for 7 years
In sometimes in some games the unity3d folder is not there if some game the unity3d folder is there but i don't see the player folder only see the ads folder what is the reason and where i can use this Toast message in the type of games
Theres a few ways to find the location to add the toast, most common tutorials have you go thru the AndroidManifest.xml, which works, but theres a couple (imo easier) ways:
1. my ModIDE project has the ability to search and inject your toast msg in the proper place, jest save a toast message in the tools menu option then when you build a new modded apk itll add the toast in.
2. do the same method it uses to inject: run aapt, an android tool used to get information from an apk, google it and run the command from shell with "badging", look for the line that says "launchable", "main", and "label". thats the file to go thru,

good luck!
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
Hi guys.
There are some problems. I can't see .locals , there is only .registers . Anyway, I did the same thing but the pop up not showing. Please check if there's anything wrong.(I created that .prologue)
Screenshot_20181216-110930.png
 

kryo

APK Fanatic Lv5️⃣
Member for 7 years
try to swap this way

const-string v0, "your toast"

const/4 v1, 0x1
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
You mean

First, const-string v0, "your toast"

Then, const/4 v1, 0x1

Then, all others ?
 

kryo

APK Fanatic Lv5️⃣
Member for 7 years
Yes, try that way
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
Now keeps stoping. Any problem ? Please help.
Screenshot_20181216-202222.png
 

s810car

In Love Lv4️⃣
Member for 7 years
Now keeps stoping. Any problem ? Please help.
I believe you need to keep the double spacing between instructions, add a blank line after method (might double check other smali files first to make sure, it might not require in the beginning)

also, i saw another issue which may help, this screenshot has "invoke-super" in it, that tells me its the child class, you may have more luck in the super constructor (parent class). Go to android/app/NativeActivity and search for onCreate there, you may be able to inject a toast there if your current class isn't working
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
There no app folder in android only have support.
 

s810car

In Love Lv4️⃣
Member for 7 years
There no app folder in android only have support.
like i said its a possibility, double check up top of the smali file for a .super and check for that file if it exists. I don't have my code open but my app ModIDE basically does this for the auto inject toast: it uses aapt to determine the starting file (main activity/start method, the one with onCreate), travels up the super constructors until at the top, then injects into the onCreate method there as thats the most reliable way it works. It may work in the file the manifest supplies as well (im assuming the file you are trying on is the main activity on the manifest file), so you can try either way, most apps its pretty easy to add to just have to find the right location. Good luck!
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
You mean your app can auto inject toast in a app ?
Post automatically merged:

like i said its a possibility, double check up top of the smali file for a .super and check for that file if it exists. I don't have my code open but my app ModIDE basically does this for the auto inject toast: it uses aapt to determine the starting file (main activity/start method, the one with onCreate), travels up the super constructors until at the top, then injects into the onCreate method there as thats the most reliable way it works. It may work in the file the manifest supplies as well (im assuming the file you are trying on is the main activity on the manifest file), so you can try either way, most apps its pretty easy to add to just have to find the right location. Good luck!
Where can I find your app ?
 
Last edited:

KentCave

~• Philosopher Poet •~
From the Hell
Member for 5 years
Any alternative app to APK Tool that will work on low-RAM Phones?
The APK Tool app for mobiles that I found wouldn't work on 500 MB RAM Phone.

Need a Decompiler to finally see a smali extension.
As of currently, just manually searching & modifying values by text-editor. Needed much Patience & Focus with those million lines of codes. Ruining my eyesight at 8 size font. lol
<3
Therefore..currently using only same size png images to replace the original splash screen and app-icon.
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
Have you yet tried APK editor pro ?
 

KentCave

~• Philosopher Poet •~
From the Hell
Member for 5 years
Have you yet tried APK editor pro ?
The one available at Play Store? Installed it but didn't see a Toast-insert features. Will check again.
Thanks & Merry Xmas! <3
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
Can anyone please tell me how to deal with split files in unity 3D apps to modify splash image ?
 

Sbenny

A crazy scientist
Staff member
Admin
SB Mod Squad ⭐
✔ Approved Releaser
Active User
Tutorial updated with new info and new methods.
 
Top