Error when adding toast message.

LiquidGold

New User
11
03/30/17
0
Thread Author
So I got this error when trying to recompile my apk and I'm not sure why when I followed the tut.

Log For : WWEChampionsMOD.apk

Log Type : Recompiling

Log Recorded At : 2017-04-04 -- 6:18:40.05

Log Recorded By : Advanced ApkTool v4.2.0 By BDFreak

------------------------------------------------------

..\3-Out\WWEChampionsMOD.apk\smali\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,0] required (...)+ loop did not match anything at input 'Searching'
..\3-Out\WWEChampionsMOD.apk\smali\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[3,2] Error for input '\': Invalid text
..\3-Out\WWEChampionsMOD.apk\smali\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[3,18] Error for input '\': Invalid text
..\3-Out\WWEChampionsMOD.apk\smali\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[3,24] Error for input '\': Invalid text
..\3-Out\WWEChampionsMOD.apk\smali\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[3,40] Error for input '.apk\smali\com\kungfufactory\androidplugin\KFFUnityPlayerActivity': Invalid directive
..\3-Out\WWEChampionsMOD.apk\smali\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[3,105] Error for input '.smali': Invalid directive
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/kungfufactory/androidplugin/KFFUnityPlayerActivity.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:77)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:61)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:38)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:405)
at brut.androlib.Androlib.buildSources(Androlib.java:336)
at brut.androlib.Androlib.build(Androlib.java:292)
at brut.androlib.Androlib.build(Androlib.java:264)
at brut.apktool.Main.cmdBuild(Main.java:227)
at brut.apktool.Main.main(Main.java:84)

------------------------------------------------------

The code I put under locals
const/4 v0, 0x1

const-string v1, "YOUR MESSAGE"

invoke-static {p0, v1, v0}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

move-result-object v0

invoke-virtual {v0}, Landroid/widget/Toast;->show()V

#OTHER CODE THAT YOU MAY NOT TOUCH IT
 

icry4u

If you want an injection go to the doctor...!!!
Exclusive Modding Team
2,993
11/05/15
3,541
Thread Author
Please take a screen shot where you pout your code
 

Choi Sun Er

Advance Member
302
12/24/16
356
Thread Author
First of all, you're doing it wrong lol
The code is just

const/4 v0, 0x1

const-string v1, "YOUR MESSAGE"

invoke-static {p0, v1, v0}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

move-result-object v0

invoke-virtual {v0}, Landroid/widget/Toast;->show()V

and in "YOUR MESSAGE" is the place where you're supposed to put your name or whatever you want like "Modded by LiquidGold"

then i should say that this kind of toast doesn't need to be under .locals, use ctrl+F to search for OnCreate and you will see
.method public onCreate(Landroid/os/Bundle;)V'
under this you'll find Register 5 or 6, you can put this cod under this
 

Choi Sun Er

Advance Member
302
12/24/16
356
Thread Author
Another thing, if you want to add a Toast to a game you don't need to decompile the whole apk, just drag classes.dex outside and use URET Android Reverser Toolkit v1.4 to decompile the dex file (mark Resurces first) and you are fine to edit it and then compile again.
 

iAlex

Join: https://t.me/updatenewsialex
Cracking Team
7,657
03/11/16
12,049
Thread Author
apktool d -r xxx.apk
Edit
apktool b xxx
 

LiquidGold

New User
11
03/30/17
0
Thread Author
Capture.JPG


That's how I have the code.
 

icry4u

If you want an injection go to the doctor...!!!
Exclusive Modding Team
2,993
11/05/15
3,541
Thread Author
[Attachment removed from Quotes]

That's how I have the code.
Nothing wrong with the code maybe your apktool acting weird .. try baksmali from XDA .. add your toast then smali back
 

LiquidGold

New User
11
03/30/17
0
Thread Author
I thought I had it in the right spot , I'll try what you suggested and get back to you.
 

LiquidGold

New User
11
03/30/17
0
Thread Author
Nothing wrong with the code maybe your apktool acting weird .. try baksmali from XDA .. add your toast then smali back
So I have tried Baksmali and URET Android Reverser Toolkit v1.4 but it's still the same, I would place the code just like it is shown above , try to re compile the .dex file and I would still get the same error(below) I know this is the correct smali file so I don't know why it's acting like this. Any suggestions?

2017-04-05 8:31:17
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,0] required (...)+ loop did not match anything at input 'C'
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,2] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,14] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,22] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,29] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,33] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,47] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,61] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,84] Error for input '.smali': Invalid directive
 

icry4u

If you want an injection go to the doctor...!!!
Exclusive Modding Team
2,993
11/05/15
3,541
Thread Author
So I have tried Baksmali and URET Android Reverser Toolkit v1.4 but it's still the same, I would place the code just like it is shown above , try to re compile the .dex file and I would still get the same error(below) I know this is the correct smali file so I don't know why it's acting like this. Any suggestions?

2017-04-05 8:31:17
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,0] required (...)+ loop did not match anything at input 'C'
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,2] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,14] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,22] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,29] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,33] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,47] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,61] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,84] Error for input '.smali': Invalid directive
weird i've used that same code of urs and it compiled fine
 

LiquidGold

New User
11
03/30/17
0
Thread Author
weird i've used that same code of urs and it compiled fine
Right. It's really aggravating , It's always something in my way. First it was re compling errors in general , now this. I can't catch a break , and I don't want to release this mod in till I add creds. Not sure if that sounds tacky or not..don't want to make a big deal out of it but I would like ppl to know who modded ya know.
 

icry4u

If you want an injection go to the doctor...!!!
Exclusive Modding Team
2,993
11/05/15
3,541
Thread Author
Right. It's really aggravating , It's always something in my way. First it was re compling errors in general , now this. I can't catch a break , and I don't want to release this mod in till I add creds. Not sure if that sounds tacky or not..don't want to make a big deal out of it but I would like ppl to know who modded ya know.
i know what you mean .. some will leech and put their credits ... try to search that error on internet might pop up something
 

Jasi2169

New User
6
06/13/17
0
Thread Author
So I have tried Baksmali and URET Android Reverser Toolkit v1.4 but it's still the same, I would place the code just like it is shown above , try to re compile the .dex file and I would still get the same error(below) I know this is the correct smali file so I don't know why it's acting like this. Any suggestions?

2017-04-05 8:31:17
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,0] required (...)+ loop did not match anything at input 'C'
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,2] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,14] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,22] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,29] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,33] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,47] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,61] Error for input '\': Invalid text
classes\Source\com\kungfufactory\androidplugin\KFFUnityPlayerActivity.smali[1,84] Error for input '.smali': Invalid directive

check the row 1st and then coloum 2,14,22,29,33 whatever it is saying if you are using some texts which are not supported then use either escape sequence or add \ before that special character or i suggest use base64 and then decode it at runtime

Best Regards,
Jasi2169
 

stelauAR

EMT
Exclusive Modding Team
4,617
09/02/15
6,366
Thread Author
Bro use notpadd++ search for .method protected oncreate reason search for that has you get less resualts im smali than just searching oncreate. The place you need to edit is under unitynativeactivityplayer or unityactiveplayer line 60. Use tryownme decompile tool simple but one of the best out there and problem should be resolved
 
Top Bottom