Help me to understand what is going on with this mod!

Sbenny.com is trusted by 1,313,206 happy users since 2014.
Register

Ysar

Hardcore Lv9️⃣
Happy birthday to me
Member for 3 years
Hi all,

I wanted to take a swing at learning how to mod games so I've been reading the stuff in here and I tried giving it a shot. The first game I tried worked fine! I was able to install a toast screen and use LP to approve IAP, but then I found out someone else had already uploaded a better mod here.

So I downloaded another game from the play store and this one turned out to be a unity 3d game. I was able to use LP and reinstall the game and it worked great, but if I modified the .smali files to add a toast screen, the game would close instantly.

Any ideas on how to prevent this?

Thanks,
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
Unity3d games tend to not support toast often. You need to use Alert dialog ... 😊

Maybe this code help you .. 😊
Java:
    new-instance v0, Landroid/app/AlertDialog$Builder;

    invoke-direct {v0, p0}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    const-string p0, "\u26a0 Make sure this mod apk file is safe \u26a0"

    invoke-virtual {v0, p0}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    const-string p0, "This mod apk file is provided by GOUROV, only for sbenny.com users! If you downloaded it from other sources, please uninstall it immediately because it might damage your device as other sites inject malicious code to steal your personal information and data. Therefore visit sbenny.com to download the genuine mod apk file!"

    invoke-virtual {v0, p0}, Landroid/app/AlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    const-string p0, "Thanks \u263a"

    const/4 p1, 0x0

    invoke-virtual {v0, p0, p1}, Landroid/app/AlertDialog$Builder;->setPositiveButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    const/4 p0, 0x0

    invoke-virtual {v0, p0}, Landroid/app/AlertDialog$Builder;->setCancelable(Z)Landroid/app/AlertDialog$Builder;

    move-result-object v0

    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->show()Landroid/app/AlertDialog;
 

Ysar

Hardcore Lv9️⃣
Happy birthday to me
Member for 3 years
That's what I tried first, adding the dialog window, then I tried just a toast. Either modification led to the game shutting down as soon as it started. But LP patched it no prob. I was wondering if there is some check that it was failing, but now I am just trying to learn more forward engineering before I work on reverse engineering lol.
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
That's what I tried first, adding the dialog window, then I tried just a toast. Either modification led to the game shutting down as soon as it started. But LP patched it no prob. I was wondering if there is some check that it was failing, but now I am just trying to learn more forward engineering before I work on reverse engineering lol.
If it's Unity3d game then you will obviously find a UnityPlayerActivity.smali file. Open that file and try to find this line ...
Java:
 invoke-virtual {v0}, Lcom/unity3d/player/UnityPlayer;->requestFocus()Z
And try to add toast code or dialog code after this line.
 

Ysar

Hardcore Lv9️⃣
Happy birthday to me
Member for 3 years
If it's Unity3d game then you will obviously find a UnityPlayerActivity.smali file. Open that file and try to find this line ...
Java:
 invoke-virtual {v0}, Lcom/unity3d/player/UnityPlayer;->requestFocus()Z
And try to add toast code or dialog code after this line.
That did the trick! This should be added to the custom toast instructions :)
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
That did the trick! This should be added to the custom toast instructions :)
It worked ? And What you mean by that " This should be added to the custom toast instructions" ?
 

Ysar

Hardcore Lv9️⃣
Happy birthday to me
Member for 3 years
@Sbenny has a sticky post here to explain how to add a toast, dialog, or splash screen when modding a game, by putting the code at the start of the onCreate method. It appears that in this case that doesn't work, but putting the code after the requestFocus call did. I patched the game with LP, added a dialog and the game started up and played fine.
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
@Sbenny has a sticky post here to explain how to add a toast, dialog, or splash screen when modding a game, by putting the code at the start of the onCreate method. It appears that in this case that doesn't work, but putting the code after the requestFocus call did. I patched the game with LP, added a dialog and the game started up and played fine.
That thread is pretty outdated tbh .... Now we use improved method. We dont use either that one or this one.
 

Daniel

Hunter of Sbennytopia
From the Hell
Verified 18+ user
The Cleaner 🧹
Member for 3 years
if you have a computer then you could have tried the auto toaster given by AndnixSH
 
Top