Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

15
Reverse Engineering APK to replicate an API, need help with 'X-Request-Sign5' header
Post Body

I have been reverse engineering an APK in order to create a Desktop client for an app (just for fun to improve my analytical/programming skills). I have, however, hit a snag. Most requests sent to the server have 3 very important headers:

X-Request-ID - Just a random UUID

X-Request-Info5 - JSON representation of request that has been Base64 encoded

X-Request-Sign5 - A SHA1 (HMAC) hash of the X-Request-Info5 header value with 01a6 prepended to it. I am trying to find the secret key used to generate this hash and came across this code:

https://i.stack.imgur.com/bzcLW.png

The dil.a().b((Context)localObject2, str2); snippet calls a function that looks like this:

https://i.stack.imgur.com/h07cs.png

The String a = dim.a(context); snippet gets the device_id from shared preferences, or generates a new one (for new devices) using a random UUID and stores it in shared preferences and returns the result. This is used as the slider-show-session header in requests but as seen from the code above it is also passed to the signWithToken method. The signWithToken method essentially calls a native method in one of the .so libs. I've decompiled them but the decompiler says that it cannot find an entry point and just allows me to see the strings inside the binary. I was trying to figure out what the signing function did so I could replicate it, but the native method that is actually called from Java: doCommandNative is nowhere to be seen in any of the .so files...

Any help from someone more advanced than myself would be great! It's been a great learning experience so far but I have hit this road block.

Author
Account Strength
90%
Account Age
7 years
Verified Email
Yes
Verified Flair
No
Total Karma
3,195
Link Karma
2,282
Comment Karma
761
Profile updated: 6 days ago
Posts updated: 1 day ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
6 years ago