JorgenPhi / php-snapchat

A PHP library for the Snapchat API - With Commit History
MIT License
259 stars 73 forks source link

SnapTag_Download Image Key? #87

Closed KyleBoyer closed 9 years ago

KyleBoyer commented 9 years ago

The new update(from January 27, 2015) has introduced Snaptags. Doing some research online(only found one thing about it) and some decompiling, I've found the following: /bq/snaptag_download (POST) Request Data: {"image": "qr-add/6ba8bcc94beab846813625522c7e3d2f", "req_token": "3a897d9eed9139d547384e3be5f89cd4ccf040fb7b11ad9aa9950ea3404a483a", "timestamp": 1422412632422, "username": "neuegram"} Return's your snaptag, but obviously you'd replace the req_token/username/timestamp/etc.

Now, it looks pretty straight forward until I look at the image key for the POST request. I cannot tell what type of hash it is, or what it is a hash of. I'm not a java programmer so looking inside the new decompiled Snapchat apk is doing me little to no good to figuring it out... Has anyone looked into this, or can anyone else give me a second pair of eyes to figure out how to get my snaptag programmatically?

Edit: More information from me will be posted below this line until someone comments.

Looks like the hash could be some ImageId, as I'm looking at some code in SnapTagDownloadOperation.java and it says b = intent(variable passed through function).getStringExtra("ImageId");

This ImageId is set inside the function:

 public int d(Context context, String s)
    {
        Intent intent = f(context);
        intent.putExtra("op_code", 1010);
        intent.putExtra("ImageId", s);
        return b(context, intent);
    }

inside SnapchatServiceManager.java, still looking what call's that function.

That above function is called by this function:

    protected void b(String s)
    {
        SnapchatServiceManager.a().d(mUser.H(), s);
    }

inside SyncAllTask.java, now digging more to see what calls that. Problem solved... I'm pretty dumb, qrpath is sent to you when getting all updates --

Snowlav commented 9 years ago

what exactly is this function what does it do?

KyleBoyer commented 9 years ago

what exactly is this function what does it do?

In the new snapchat update, user's have a 'snaptag', but rather it is simply a snapchat logo with a qr_code built in. An example here: https://pbs.twimg.com/media/B8Y_xlOIMAEHIs8.jpg

I was just finding how to retrieve it.