{"id":51126307,"url":"https://github.com/mysticaldevil/fuck_ttnet","last_synced_at":"2026-06-25T08:01:19.917Z","repository":{"id":367185438,"uuid":"1279536555","full_name":"MysticalDevil/fuck_ttnet","owner":"MysticalDevil","description":"TikTok TTNet 3011076 no-network fix for ERR_TTNET_TRAFFIC_CONTROL_DROP / -555 on KernelSU","archived":false,"fork":false,"pushed_at":"2026-06-24T23:08:09.000Z","size":41,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-25T00:09:46.934Z","etag":null,"topics":["3011076","android-root","kernelsu","tiktok","ttnet"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MysticalDevil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-24T19:29:02.000Z","updated_at":"2026-06-24T23:08:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/MysticalDevil/fuck_ttnet","commit_stats":null,"previous_names":["mysticaldevil/fuck_ttnet"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MysticalDevil/fuck_ttnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MysticalDevil%2Ffuck_ttnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MysticalDevil%2Ffuck_ttnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MysticalDevil%2Ffuck_ttnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MysticalDevil%2Ffuck_ttnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MysticalDevil","download_url":"https://codeload.github.com/MysticalDevil/fuck_ttnet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MysticalDevil%2Ffuck_ttnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34765322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3011076","android-root","kernelsu","tiktok","ttnet"],"created_at":"2026-06-25T08:01:19.039Z","updated_at":"2026-06-25T08:01:19.911Z","avatar_url":"https://github.com/MysticalDevil.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fuck TTNet: TikTok TTNet 3011076 Network Fix\n\nTargeted KernelSU module for TikTok international edition no-network failures\ncaused by TTNet rule `3011076`, `ERR_TTNET_TRAFFIC_CONTROL_DROP`, and\n`InternalErrorCode=-555`.\n\n[中文文档](README.zh-CN.md)\n\nDetailed investigation: [docs/investigation.md](docs/investigation.md)\n\nSearch terms: TikTok no network, TikTok TTNet 3011076, TTNet traffic control\ndrop, `ERR_TTNET_TRAFFIC_CONTROL_DROP`, `InternalErrorCode=-555`,\n`DISPATCH_DROP`, `com.zhiliaoapp.musically`.\n\n## Module Purpose\n\nFuck TTNet removes a cached TTNet traffic-control rule that makes TikTok drop\nrequests locally before DNS, TCP, or TLS starts.\n\nTarget package:\n\n```text\ncom.zhiliaoapp.musically\n```\n\nTarget files:\n\n```text\n/data/data/com.zhiliaoapp.musically/files/server.json\n/data/data/com.zhiliaoapp.musically/files/tt_net_config.config\n```\n\nTarget rule:\n\n```text\nrule_id=3011076\nservice_name=\"drop flow\"\nhost_group=[\"*\"]\ncontain_group=[\"/\"]\ndrop=1\npossibility=100\n```\n\nIn plain terms: all hosts, all paths, dropped 100% of the time.\n\nThis is the specific `3011076` / `-555` TikTok TTNet failure where logcat shows\nlocal traffic-control drops before DNS, connect, or SSL timing is recorded.\n\nThis module does not spoof SIM, device model, locale, timezone, store region,\naccount region, or proxy settings. It does not clear TikTok data. It only\nremoves the known local TTNet drop rule and restores TikTok file owner, mode\n`0600`, and SELinux context after patching.\n\nBefore replacing a file, the module creates a one-time backup next to it with\nthe suffix `.fuck_ttnet.bak`.\n\n## Module Usage\n\nBuild a module zip from this repo:\n\n```sh\nscripts/package.sh\n```\n\nInstall the module zip in KernelSU Manager and reboot.\n\nAfter boot, force-stop and reopen TikTok:\n\n```sh\nadb shell am force-stop com.zhiliaoapp.musically\n```\n\nIf the manager supports module actions, run the action manually to patch and\nprint status. It reports rule hit counts before and after patching.\n\nDisable or uninstall the module from KernelSU Manager when it is no longer\nneeded.\n\n## Manual Fix\n\nThe module does not hook TikTok or spoof the device. Its logic is intentionally\nsmall:\n\n1. Wait until TikTok data exists.\n2. Back up the target files once with the `.fuck_ttnet.bak` suffix.\n3. Remove the exact global `3011076` drop action from `server.json`.\n4. Remove `3011076` from the dispatch rule-ID list in `tt_net_config.config`.\n5. Restore TikTok file owner, mode `0600`, and SELinux context.\n\nIf you do not want to install the module, you can apply the same fix manually\nwith root. First force-stop TikTok and back up the files:\n\n```sh\nadb shell am force-stop com.zhiliaoapp.musically\nadb shell su -c 'cd /data/data/com.zhiliaoapp.musically/files \u0026\u0026\n  cp server.json server.json.manual.bak 2\u003e/dev/null;\n  cp tt_net_config.config tt_net_config.config.manual.bak 2\u003e/dev/null'\n```\n\nThen remove only the known bad rule:\n\n- In `server.json`, delete the complete JSON object whose `rule_id` is\n  `3011076` and whose body contains `action=\"tc\"`, `service_name=\"drop flow\"`,\n  `host_group=[\"*\"]`, `contain_group=[\"/\"]`, `drop=1`, and\n  `possibility=100`.\n- In `tt_net_config.config`, remove `3011076` from the cached `dispatch:` rule\n  list if it is present.\n\nAfter editing, fix ownership/context and restart TikTok:\n\n```sh\nadb shell su -c 'ls -ldn /data/data/com.zhiliaoapp.musically/files'\n```\n\nUse the numeric owner/group shown by `ls -ldn` for `APP_UID:APP_GID` below:\n\n```sh\nadb shell su -c 'cd /data/data/com.zhiliaoapp.musically/files \u0026\u0026\n  chown APP_UID:APP_GID server.json tt_net_config.config 2\u003e/dev/null;\n  chmod 600 server.json tt_net_config.config 2\u003e/dev/null;\n  restorecon server.json tt_net_config.config 2\u003e/dev/null'\nadb shell am force-stop com.zhiliaoapp.musically\n```\n\nDo not delete unrelated TTNet rules. Do not publish full TTNet config files\nwithout removing private account, token, cookie, or device identifiers.\n\nModule log:\n\n```text\n/data/adb/modules/fuck_ttnet/fuck_ttnet.log\n```\n\nUseful checks:\n\n```sh\nadb shell su -c 'grep -Rsn 3011076 /data/data/com.zhiliaoapp.musically/files'\nadb logcat -d -v time |\n  grep -E 'ERR_TTNET|TRAFFIC_CONTROL|InternalErrorCode=-555|http code=200'\n```\n\nUse this module only when TikTok shows no network while the device network\nworks and logcat contains the TTNet local-drop signature:\n\n```text\nERR_TTNET_TRAFFIC_CONTROL_DROP\nInternalErrorCode=-555\ndns=-1, connect=-1, ssl=-1\n```\n\nIf the error is DNS failure, TLS failure, proxy failure, Android network policy,\nor an HTTP response from TikTok servers, this module is not the right fix.\n\n## Why It Happens\n\nTTNet is TikTok's in-app network stack. It loads runtime TNC configuration from\nlocal cache and applies URL dispatch actions before a request reaches the\nnormal network path.\n\nNormal request path:\n\n```text\nTikTok -\u003e DNS -\u003e TCP connect -\u003e TLS -\u003e HTTP request\n```\n\nThis failure:\n\n```text\nTikTok -\u003e TTNet URL dispatch -\u003e local drop (3011076) -\u003e -555\n```\n\nThat is why the failing logs show `dns=-1`, `connect=-1`, and `ssl=-1`: the\nrequest never leaves TikTok.\n\n**Trigger**: TikTok's TNC service issues or retains rule `3011076` based on\nserver-side region detection. When TikTok traffic exits through a Hong Kong\nproxy node, TikTok's servers see `carrier_region=HK` (or\n`carrier_region_v2=454`) and may deliver this global drop rule. MCC/MNC\nand SIM region mismatches with the proxy exit region appear to contribute to\nthe trigger — `mcc_mnc=46011` (China Mobile) combined with a Hong Kong\nproxy exit has been observed to reproduce this.\n\nPublic decompiled TTNet code matches the observed behavior:\n\n- Local TNC is loaded from `ttnet_tnc_config` / `server.json`.\n- `ttnet_dispatch_actions` is parsed into ordered dispatch actions.\n- `action=\"tc\"` parses `host_group`, `contain_group`, `drop`, `drop_code`,\n  `possibility`, and `service_name`.\n- A matching `tc` action with `drop=1` returns `DISPATCH_DROP`.\n- The OkHttp path turns an empty dispatched URL plus matched rule IDs into\n  `ERR_TTNET_TRAFFIC_CONTROL_DROP`, defaulting to `-555`.\n\n`3011076` is best understood as a TTNet/TNC dispatch rule ID. It is not an\nAndroid error code, SIM/MCC code, or proxy code. The ID labels the server-side\ndispatch policy; the actual blocking behavior comes from the rule body\n(`drop=1`, wildcard host, path contains `/`, probability 100).\n\nWhat is proven:\n\n- The device had a cached global drop action with `rule_id=3011076`.\n- Removing that action changed TikTok from local `-555` drops to real network\n  responses.\n- A white-box model of the decompiled TTNet dispatch logic produces the same\n  `DISPATCH_DROP`, empty output URL, matched rule ID, and `-555` result for\n  the observed rule body.\n- TikTok traffic routed through a Hong Kong proxy exit node can trigger the\n  server-side TNC service to issue or retain rule `3011076`. This is confirmed\n  by observing `carrier_region=HK` / `carrier_region_v2=454` in request\n  parameters along with `mcc_mnc=46011` (China Mobile SIM), and the rule\n  appearing in local TTNet cache after proxy use.\n\nWhat is not proven:\n\n- Whether other proxy exit regions or SIM/carrier combinations can also\n  trigger `3011076`.\n- Whether the deciding signal is solely the proxy exit region, or a combination\n  of SIM MCC/MNC mismatch, account region, store region, or device history.\n- Scoped public code searches found TTNet traffic-control code and TNC samples,\n  but no public hit for the exact `3011076` rule.\n\n## White-Box Mechanism Check\n\nThe repository includes a local-only model of the relevant TTNet dispatch\nlogic:\n\n```sh\npython3 scripts/ttnet_dispatch_model.py --self-test\npython3 scripts/ttnet_dispatch_model.py \\\n  --config samples/3011076_drop_rule.json \\\n  --url 'https://api16-normal-c-useast1a.tiktokv.com/aweme/v2/feed/'\npython3 scripts/extract_ttnet_rule.py \\\n  --input samples/observed_3011076_drop_rule.json --sample |\n  python3 scripts/ttnet_dispatch_model.py \\\n    --config - \\\n    --url 'https://api16-normal-c-useast1a.tiktokv.com/aweme/v2/feed/'\n```\n\nThis is not a full reproduction of TikTok selecting rule `3011076`. It only\nvalidates the client-side mechanism after such a rule exists in local TNC\nconfig.\n\nTo repeat the public-source search used by the investigation:\n\n```sh\nscripts/search_public_evidence.sh\n```\n\n## Scope And Limits\n\n- Only TikTok international edition is targeted.\n- Only the known `3011076` global drop flow is removed.\n- TikTok may rewrite TTNet config after launch, so the service script checks\n  repeatedly in the background.\n- If TikTok changes the rule ID or config format, the matcher may need an\n  update.\n- If a request reaches TikTok servers and the server rejects it, this module\n  cannot bypass that response.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmysticaldevil%2Ffuck_ttnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmysticaldevil%2Ffuck_ttnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmysticaldevil%2Ffuck_ttnet/lists"}