{"id":20390435,"url":"https://github.com/timvisee/apbf","last_synced_at":"2025-06-28T04:33:31.989Z","repository":{"id":66230100,"uuid":"185673116","full_name":"timvisee/apbf","owner":"timvisee","description":"Tool to brute force Android security pattern through TWRP recovery. https://gitlab.com/timvisee/apbf","archived":false,"fork":false,"pushed_at":"2023-07-26T16:13:06.000Z","size":1409,"stargazers_count":118,"open_issues_count":4,"forks_count":24,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-12T11:37:53.631Z","etag":null,"topics":["adb","android","brute-force","decrypt","pattern-lock","twrp"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timvisee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["timvisee"],"custom":["https://timvisee.com/donate"],"patreon":"timvisee","ko_fi":"timvisee"}},"created_at":"2019-05-08T20:12:53.000Z","updated_at":"2025-04-09T12:53:13.000Z","dependencies_parsed_at":"2024-11-15T03:25:42.191Z","dependency_job_id":"596f0f15-2187-4fb4-b56e-fbf74aac47d1","html_url":"https://github.com/timvisee/apbf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/timvisee/apbf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timvisee%2Fapbf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timvisee%2Fapbf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timvisee%2Fapbf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timvisee%2Fapbf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timvisee","download_url":"https://codeload.github.com/timvisee/apbf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timvisee%2Fapbf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262376079,"owners_count":23301342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["adb","android","brute-force","decrypt","pattern-lock","twrp"],"created_at":"2024-11-15T03:24:54.818Z","updated_at":"2025-06-28T04:33:31.965Z","avatar_url":"https://github.com/timvisee.png","language":"Rust","readme":"[![Pipeline status on GitLab CI][pipeline-badge]][pipeline-link]\n\n# Android Pattern Brute Force\nA tool for brute forcing an Android security pattern through TWRP recovery.\n\n![Screenshot](./res/screenshot.png)\n\nOne day I forgot what security pattern I used on my phone. Therefore I build a\ntool which brute forces the pattern.\n\nI succeeded to crack my 3x3 pattern in about 1.9 hours.\n\n## Requirements\n- A pattern lock\n- Android 8.0 (Nougat) or above\n- [TWRP][twrp] recovery\n- [`adb`][adb] (with connectivity to phone in TWRP)\n- [`git`][git]\n- [`rust`][rust] `v1.32` or higher (install using [`rustup`][rustup])\n\n## Speed\nTWRP recovery enforces a hidden timeout of 10 seconds for each pattern attempt,\nall consecutive attempts within that time fail with no warning. Because of this\na brute force attempt will take a long while when the pattern search space is\nlarge.\n\nIt is highly recommended to constrain the search space as much as possible if\nyou partially know the pattern to greatly improve the brute force duration.\n\nIn the [`config.rs`](./src/config.rs) file you can tweak a few constants for:\n- Minimum pattern length\n- Maximum pattern length\n- Maximum distance between dots in a pattern\n- Dots to attempt patterns on (eliminate all dots that are definitely not used)\n- Grid size (as chosen while setting up the pattern, usually `3`)\n\nThis tool does brute forcing on the actual device. A brute force attempt could\nprobably be greatly sped up by performing the attempt locally on a computer,\nto work around the timeouts. That's however a lot more work to implement (if\neven possible), so it's outside the scope of this project.\n\n## Usage\n- Make sure you meet the [requirements](#requirements)\n- Clone the repository, and build the project\n  ```bash\n  # Clone repository\n  git clone git@github.com:timvisee/apbf.git\n  cd apbf\n\n  # Build project\n  cargo build --release\n  ```\n\n- Tweak properties for brute force attempt in [`config.rs`](./src/config.rs):\n  ```bash\n  # Edit constants\n  vim src/config.rs\n  ```\n\n  Constrain it as much as possible to reduce pattern search space, which greatly\n  improves brute force speed. See [speed](#speed).\n\n- Freshly boot phone into TWRP recovery\n- Make sure your phone is connected through ADB\n  ```bash\n  # Device must be visible in list\n  adb devices\n  ```\n\n- Start brute forcing\n  ```bash\n  # Run tool\n  cargo run --release\n  ```\n\n- Wait for a successful attempt, this may take a long while\n\n## License\nThis project is released under the GNU GPL-3.0 license.\nCheck out the [LICENSE](LICENSE) file for more information.\n\n[adb]: https://developer.android.com/studio/command-line/adb\n[git]: https://git-scm.com/\n[rust]: https://rust-lang.org/\n[rustup]: https://rustup.rs/\n[twrp]: https://twrp.me/\n[pipeline-badge]: https://gitlab.com/timvisee/apbf/badges/master/pipeline.svg\n[pipeline-link]: https://gitlab.com/timvisee/apbf/pipelines\n","funding_links":["https://github.com/sponsors/timvisee","https://timvisee.com/donate","https://patreon.com/timvisee","https://ko-fi.com/timvisee"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimvisee%2Fapbf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimvisee%2Fapbf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimvisee%2Fapbf/lists"}