|
1 |
| -# F-Parameter-API |
| 1 | +# f API |
| 2 | + |
| 3 | +This API is a necessary step in the NSO account authorization process. There is an Android emulator on imink's server with the NSO client installed in it, and the f-parameters are generated by this client. It is completely free, you just need to tell me what project you use it in. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +You can use the f API already used in imink. |
| 8 | + |
| 9 | +**URL:** `POST` `https://api.imink.app/f` |
| 10 | + |
| 11 | +**Header:** You must send the correct `User-Agent` to let me know that you are requesting it. I suggest the format is: `{{ Your app name }}/{{ Your app version }}`. |
| 12 | + |
| 13 | +**Body:** `JSON` |
| 14 | + |
| 15 | +* token : `String`, **Required**. Get it from NSO api |
| 16 | +* hash_method : `Number or String`, **Required**. 1 or 2 |
| 17 | +* timestamp : `Number or String`, Optional. It is not recommended to use this parameter |
| 18 | +* request_id : `String`, Optional. It is not recommended to use this parameter |
| 19 | + |
| 20 | +NOTE: timestamp and request_id will be generated by the server if not submitted. It is recommended to use the api generated timestamp and request_id. If you try to submit your own timestamp, it may cause the NSO api to return a 9599 error. |
| 21 | + |
| 22 | +**Example:** |
| 23 | + |
| 24 | +``` |
| 25 | +curl -X "POST" "https://api.imink.app/f" \ |
| 26 | + -H 'User-Agent: {{ Your app name }}/{{ Your app version }}' \ |
| 27 | + -H 'Content-Type: application/json; charset=utf-8' \ |
| 28 | + -d $'{ |
| 29 | + "token": "{{ token }}" |
| 30 | + "hash_method": {{ 1 or 2 }}, |
| 31 | +}' |
| 32 | +``` |
| 33 | + |
| 34 | +**Response:** |
| 35 | +``` |
| 36 | +{ |
| 37 | + "request_id": "c6e9d62d-7c05-4c9a-8f1a-b6d799fdd5ff", |
| 38 | + "timestamp": 1661355877196, |
| 39 | + "f": "543f7e9c4f3d3b5254a3772d211a8c093888b32991002c353f278bc8766face4b548f1bdaea24c9a58e5012b" |
| 40 | +} |
| 41 | +``` |
| 42 | + |
| 43 | +## Deploy your own f API |
| 44 | + |
| 45 | +### Download |
| 46 | + |
| 47 | +I modified the official version of NSO to make a new APK. It is easy to let you create your own f API. you can download the latest version from [Releases](https://github.com/imink-app/f-API/releases). |
| 48 | + |
| 49 | +### How to use |
| 50 | + |
| 51 | +1. Install the APK you downloaded into your Android system and it will show up as the NSO icon. |
| 52 | +2. Launch it. |
| 53 | + |
| 54 | +Now you can access it via `http://ip:9000`. ip needs to be replaced with the ip address of your Android device. The request parameters are exactly the same as `api.imink.app/f`. |
| 55 | + |
| 56 | +Yes, it's that simple! |
| 57 | + |
| 58 | +* You don't need to root your Android. |
| 59 | +* You don't need to connect to a computer. |
| 60 | + |
| 61 | +## How is this APK made |
| 62 | + |
| 63 | +1. Cracking the signature verification of NSO. |
| 64 | +2. Decompile apk to smali code. |
| 65 | +3. Insert HTTP Server code and call libvoip.so to compute the f code in smali code. |
| 66 | +4. Repackage as apk. |
| 67 | +5. Re-sign. |
| 68 | + |
| 69 | +The tools used are: jarsigner, Apktool, Xpatch, Android Studio. |
| 70 | + |
| 71 | +Now here is just a simple description of the steps. More code and actions I will update in the future. |
0 commit comments