[Android Apps and Games] Fusseldieb:
Haha, thanks.

That's nice to know.

I must confess two things...

1. I haven't had time to buy your app yet (shame on me), hopefully it has still its lower price. I will see if I go to a store today and pick some Play Card.

2. I meanwhile "hacked" your app a bit and with some things like "APK-Multi-Tool" I managed to decompile it (sort of).

Maybe someone want to accomplish the same as I did, so here is some background what I did and how it works.

Analyzing the .smali files, I found the string which makes the GET request with Dialogflow, which is following:

const-string v4, "https://api.dialogflow.com/v1/query?v=20150910&lang="
invoke-virtual {v12, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v12, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v2, "&query="
invoke-virtual {v12, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v12, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v2, "&sessionId="
invoke-virtual {v12, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v12, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v12}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

I then changed the value of "const-string v4" to my server.

Later I discovered that the app was crashing due to Dialogflows HTTPS. I then searched for "https" occurences and in some file I found a couple of them.

The request is being sent with

Ljavax/net/ssl/HttpsURLConnection

. Knowing that, I searched for it and found this, but also this, which is exactly what I wanted.

After changing all occurences to

Ljava/net/HttpURLConnection

(Note that it's not javax anymore), I compiled the apk and signed it with my own key.

(Are you still reading...? Oh, that's nice...)

After uploading it to my phone and installing it, I waited and when I got the first message, something popped up in the server log:

"GET /autoresponder/receiver.php?lang=en&query=Olha+isso+aqui&sessionId=JonnathanQuindos HTTP/1.1" 200 204 "-" "Dalvik/2.1.0 (Linux; U; Android 7.0; SM-G935F Build/NRD90M)"

I also noted that you cut all spaces, special characters and emojis out of the contact names, which really makes things easier later on.

Now, the journey of the "php super bot" begins. Haha :)

Some basic documentation for... ummm... I don't know:

lang: The string that is defined within the app in that "Language" box in some rule. Can be used as placeholder for now.

query: The received message as seen in the notification of your phone

sessionId: The name of the contact who's texting, without any emojis or special characters (with some exceptions such as ? or !).

The server needs to send following back (JSON):

{
"result": {
"fulfillment": {
"messages": [
{
"speech": "One message"
},
{
"speech": "Another following message"
}
]
}
}
}

I think the above is self explaining.

Note: All the other values as stated in here are not used (until now).

And for those who want 'dat apk', I'll let you know that you need to make this mod/hack yourself, as I don't spit full versions around for obvious reasons.

I know that's a lot of a mess, but right now I can play around without having to wait. It would be better in a more official way, but for now it's something nice to hack/have.

Keep it up, you've done some really nice work there.