Follow: https://t.me/touchingcode
- Obtain the query string using the standard
urllib.parselibrary:
- Use
urlparse()if you already have a URL with query parameters- Use
urlencode()if your parameters are stored in a dict
- Encode the request body using
urlencode(), or pass an empty string if the request has no body - Obtain your User-Agent by any available method
- Call the
get_x_gnarly()method from/web/x_gnarly.py
- Before using install JavaScript dependencies:
cd web/js
npm i- Obtain the full URL including all query parameters
- Obtain your User-Agent
- Call the
get_sign_params()method from/web/sign_params.py
- Run:
python register_device/register_device.pyor call the
register_device()method from the same file in your code
- Obtain the query string using the standard
urllib.parselibrary:
- Use
urlparse()if you already have a URL with query parameters- Use
urlencode()if your parameters are stored in a dict
- Collect your request headers
- Call the
get_sign_params()method from/web/sign_params.py
-
Mobile API endpoints are kinda sensitive. The payload used for device registration is encoded using Java modules located in
/register_device/java. The encoding process relies onunidbg.jar, which contains aTTEncrypt.class. In some cases, you may need to modify hardcoded values in payload. -
To do that:
- Update the required values in
TTEncrypt.java - Extract
unidbg.jarinto the same directory - Compile the file:
javac -cp "unidbg.jar" com/bytedance/frameworks/core/encrypt/TTEncrypt.java- Replace the original
.classfile:
com/bytedance/frameworks/core/encrypt/TTEncrypt.class
- Compile
unidbg.jar