-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Full Android/Termux support #4563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add Android platform support - Android-compatible CPU affinity - Automatic platform detection in build system - Comprehensive Android build documentation - Tested on POCO X6 Pro with proven performance
Fixed build detection to properly distinguish between Android/Termux and regular Linux environments. Android systems report as "Linux" in kernel checks but require different compiler flags and libraries. The fix ensures: · Android builds get Termux-compatible flags (-D__ANDROID__, iconv linking) · Regular Linux builds get standard flags (-DWITH_HWMON) · Proper library linking for each platform · No flag conflicts between environments Detection order is critical since both systems identify as Linux at kernel level.
|
Tested: ❯ ./hashcat -a 3 -m 0 -w 4 -O ~/hash.hc0 "?l?l?l?l?l?d?d?d?d"
hashcat (v7.1.2) starting
OpenCL API (OpenCL 3.0 v1.r44p1-01eac0.999bbcba36b4ca04774e2b05d5802dc0) - Platform #1 [ARM]
============================================================================================
* Device #01: Mali-G615 MC6 r1p3, 5644/11289 MB (5644 MB allocatable), 6MCU
Minimum password length supported by kernel: 0
Maximum password length supported by kernel: 55
Counting lines in /data/data/com.termux/files/home/hash.hc0.Hashes: 1 digests; 1 unique digests, 1 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
Optimizers applied:
* Optimized-Kernel
* Zero-Byte
* Precompute-Init
* Meet-In-The-Middle
* Early-Skip
* Not-Salted
* Not-Iterated
* Single-Hash
* Single-Salt
* Brute-Force
* Raw-Hash
Watchdog: Hardware monitoring interface not found on your system.
Watchdog: Temperature abort trigger disabled.
Initializing backend runtime for device #1. Please be patienHost memory allocated for this attack: 2036 MB (4240 MB free)
[s]tatus [p]ause [b]ypass [c]heckpoint [f]inish [q]uit => s
Session..........: hashcat
Status...........: Running
Hash.Mode........: 0 (MD5)
Hash.Target......: 2ea36474d9f262de6063437b0ce5dc27
Time.Started.....: Sat Nov 1 22:25:11 2025 (2 secs)
Time.Estimated...: Sat Nov 1 22:28:02 2025 (2 mins, 49 secs)
Kernel.Feature...: Optimized Kernel (password length 0-55 bytes)
Guess.Mask.......: ?l?l?l?l?l?d?d?d?d [9]
Guess.Queue......: 1/1 (100.00%)
Speed.#01........: 694.6 MH/s (481.55ms) @ Accel:54 Loops:1024 Thr:1024 Vec:1
Recovered........: 0/1 (0.00%) Digests (total), 0/1 (0.00%) Digests (new)
Progress.........: 1019215872/118813760000 (0.86%)
Rejected.........: 0/1019215872 (0.00%)
Restore.Point....: 0/6760000 (0.00%)
Restore.Sub.#01..: Salt:0 Amplifier:3072-4096 Iteration:0-1024
Candidate.Engine.: Device Generator
Candidates.#01...: ageer1234 -> gocgc1745
2ea36474d9f262de6063437b0ce5dc27:ahmed2025
Session..........: hashcat
Status...........: Cracked
Hash.Mode........: 0 (MD5)
Hash.Target......: 2ea36474d9f262de6063437b0ce5dc27
Time.Started.....: Sat Nov 1 22:25:11 2025 (1 min, 19 secs)
Time.Estimated...: Sat Nov 1 22:26:30 2025 (0 secs)
Kernel.Feature...: Optimized Kernel (password length 0-55 bytes)
Guess.Mask.......: ?l?l?l?l?l?d?d?d?d [9]
Guess.Queue......: 1/1 (100.00%)
Speed.#01........: 694.0 MH/s (460.54ms) @ Accel:54 Loops:1024 Thr:1024 Vec:1
Recovered........: 1/1 (100.00%) Digests (total), 1/1 (100.00%) Digests (new)
Progress.........: 54859825152/118813760000 (46.17%)
Rejected.........: 0/54859825152 (0.00%)
Restore.Point....: 2985984/6760000 (44.17%)
Restore.Sub.#01..: Salt:0 Amplifier:6144-7168 Iteration:0-1024
Candidate.Engine.: Device Generator
Candidates.#01...: dikho6925 -> egbnv7733
Started: Sat Nov 1 22:25:02 2025
Stopped: Sat Nov 1 22:26:32 2025 |
ahmed-alnassif
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested
❯ make
Android environment detected - enabling Termux compatibility
❯ hashcat -I
hashcat (v7.1.2) starting in backend information mode
OpenCL Info:
============
OpenCL Platform ID #1
Vendor..: ARM
Name....: ARM Platform
Version.: OpenCL 3.0 v1.r44p1-01eac0.999bbcba36b4ca04774e2b05d5802dc0
Backend Device ID #01
Type...........: GPU
Vendor.ID......: 2147483648
Vendor.........: ARM
Name...........: Mali-G615 MC6 r1p3
Version........: OpenCL 3.0 v1.r44p1-01eac0.999bbcba36b4ca04774e2b05d5802dc0
Processor(s)...: 6
Preferred.Thrd.: 32
Clock..........: 1400
Memory.Total...: 11289 MB (limited to 5644 MB allocatable in one block)
Memory.Free....: 5644 MB
Memory.Unified.: 1
Local.Memory...: 32 KB
OpenCL.Version.: OpenCL C 3.0 v1.r44p1-01eac0.999bbcba36b4ca04774e2b05d5802dc0
Driver.Version.: 3.0
ahmed-alnassif
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Android/Linux Detection Order Explanation
The Android detection must come before Linux because:
- Android reports as "Linux" in
UNAME(uname -s) but contains "Android" inuname -aoutput - Different library requirements: Android needs
-liconvand-D__ANDROID__flags - Hardware monitoring: Regular Linux uses
-DWITH_HWMONwhich Android doesn't support - Library paths: Android uses Termux's
$PREFIX/lib, Linux uses system paths
Detection priority logic:
- First check for Android via
uname -a(more specific) - Then check for generic Linux via
UNAME(fallback)
This ensures Android/Termux builds get the correct compatibility flags and library linking without affecting regular Linux builds.
Performance Update: 857.9 MH/s on Battery Saver ModeJust discovered that hashcat achieves 857.9 MH/s MD5 even with battery saver enabled on my POCO X6 Pro! This demonstrates:
The Android port continues to exceed expectations! 🚀❯ hashcat -b -m 0 -w 4 -O
hashcat (v7.1.2) starting in benchmark mode
OpenCL API (OpenCL 3.0 v1.r44p1-01eac0.999bbcba36b4ca04774e2b05d5802dc0) - Platform #1 [ARM]
============================================================================================
* Device #01: Mali-G615 MC6 r1p3, 5644/11289 MB (5644 MB allocatable), 6MCU
Benchmark relevant options:
===========================
* --backend-devices-virtmulti=1
* --backend-devices-virthost=1
* --optimized-kernel-enable
* --workload-profile=4
-------------------
* Hash-Mode 0 (MD5)
-------------------
Speed.#01........: 857.9 MH/s (463.35ms) @ Accel:64 Loops:1024 Thr:1024 Vec:1
Started: Sun Nov 2 17:22:55 2025
Stopped: Sun Nov 2 17:23:11 2025 |
|
I cannot understand about this
…On Sun, Nov 2, 2025, 19:53 Ahmed Al-Nassif ***@***.***> wrote:
*ahmed-alnassif* left a comment (hashcat/hashcat#4563)
<#4563 (comment)>
Performance Update: 857.9 MH/s on Battery Saver Mode
Just discovered that hashcat achieves *857.9 MH/s MD5* even with *battery
saver enabled* on my POCO X6 Pro!
This demonstrates:
- *Excellent power efficiency* - max performance even with power
restrictions
- *Superior optimization* - no thermal throttling issues
- *Production-ready stability* - works reliably under normal phone
usage conditions
The Android port continues to exceed expectations! 🚀
❯ hashcat -b -m 0 -w 4 -O
hashcat (v7.1.2) starting in benchmark mode
OpenCL API (OpenCL 3.0 v1.r44p1-01eac0.999bbcba36b4ca04774e2b05d5802dc0) - Platform #1 [ARM]
============================================================================================* Device #1: Mali-G615 MC6 r1p3, 5644/11289 MB (5644 MB allocatable), 6MCU
Benchmark relevant options:
===========================* --backend-devices-virtmulti=1* --backend-devices-virthost=1* --optimized-kernel-enable* --workload-profile=4
-------------------* Hash-Mode 0 (MD5)
-------------------
Speed.#1........: 857.9 MH/s (463.35ms) @ Accel:64 Loops:1024 Thr:1024 Vec:1
Started: Sun Nov 2 17:22:55 2025
Stopped: Sun Nov 2 17:23:11 2025
—
Reply to this email directly, view it on GitHub
<#4563 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BR7IVN46XCZYS6CV6J7HA3L32YLGTAVCNFSM6AAAAACK37CSC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINZYGAZDCMZTGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
See: https://github.com/ahmed-alnassif/hashcat/blob/master/BUILD_Android.md Replace step 4 with (since it hasn't merged to hashcat yet): Test it Comment here if it worked for you. |
src/Makefile
Outdated
| LFLAGS_NATIVE += -lrt | ||
| LFLAGS_NATIVE += -lm | ||
| # Android detection | ||
| ifneq (,$(findstring Android,$(shell uname -a))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please declare some android macro like we do with other systems:
ifeq ($(UNAME),Darwin)
...
|
Cool work. What's the issue with WPA? |
ahmed-alnassif
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready to merge.
Your phone has 12GB total RAM (my situation), but the GPU only gets 5.6GB for computations. WPA2 needs more than 5.6GB to run - it's like trying to pour 8 liters of water into a 5.6-liter bucket. The extra system RAM can't help because GPU and CPU memory are separate pools that can't share for this type of work. Bottom line: Mobile GPU memory limits are hardware constraints that more system RAM can't fix.Real-world test: ❯ hashcat -b -m 22000 \
--backend-devices-keepfree=80 \
--backend-devices-virtmulti=1 \
-w 1 \
-n 1 \
-u 1 \
--force
hashcat (v7.1.2) starting in benchmark mode
You have enabled --force to bypass dangerous warnings and errors!
This can hide serious problems and should only be done when debugging.
Do not report hashcat issues encountered when using --force.
OpenCL API (OpenCL 3.0 v1.r44p1-01eac0.999bbcba36b4ca04774e2b05d5802dc0) - Platform #1 [ARM]
============================================================================================
* Device #01: Mali-G615 MC6 r1p3, 1128/11289 MB (5644 MB allocatable), 6MCU
Benchmark relevant options:
===========================
* --force
* --backend-devices-virtmulti=1
* --backend-devices-virthost=1
* --kernel-accel=1
* --kernel-loops=1
* --workload-profile=1
-------------------------------------------------------------
* Hash-Mode 22000 (WPA-PBKDF2-PMKID+EAPOL) [Iterations: 4095]
-------------------------------------------------------------
mmap failed: Out of memory
[1] 26728 abort hashcat -b -m 22000 --backend-devices-keepfree=80 -w 1 -n 1 -u 1 --force |
During WPA2 benchmark, system memory usage was monitored:
Analysis: WPA2 exhausts all available system RAM (12GB + swap) despite OpenCL's 5.6GB GPU limit, triggering Android's OOM killer. This demonstrates WPA2's fundamental incompatibility with mobile memory management, not a port limitation. Evidence: Memory gradually consumed until system intervention, then immediately freed after process termination.Test while it was running: ❯ free -h
total used free shared buff/cache available
Mem: 11Gi 4.9Gi 3.1Gi 56Mi 3.1Gi 6.8Gi
Swap: 8.0Gi 1.5Gi 6.5Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 5.7Gi 2.3Gi 56Mi 3.1Gi 5.9Gi
Swap: 8.0Gi 1.5Gi 6.5Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 6.0Gi 2.0Gi 56Mi 3.1Gi 5.7Gi
Swap: 8.0Gi 1.5Gi 6.5Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 6.3Gi 1.7Gi 56Mi 3.1Gi 5.3Gi
Swap: 8.0Gi 1.5Gi 6.5Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 6.6Gi 1.4Gi 56Mi 3.1Gi 5.0Gi
Swap: 8.0Gi 1.5Gi 6.5Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 7.1Gi 910Mi 56Mi 3.1Gi 4.5Gi
Swap: 8.0Gi 1.5Gi 6.5Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 7.5Gi 538Mi 56Mi 3.1Gi 4.2Gi
Swap: 8.0Gi 1.5Gi 6.5Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 7.8Gi 184Mi 56Mi 3.1Gi 3.8Gi
Swap: 8.0Gi 1.5Gi 6.5Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 8.0Gi 69Mi 56Mi 3.0Gi 3.3Gi
Swap: 8.0Gi 1.5Gi 6.5Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 8.9Gi 48Mi 56Mi 2.1Gi 2.3Gi
Swap: 8.0Gi 1.5Gi 6.5Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 10Gi 17Mi 54Mi 970Mi 935Mi
Swap: 8.0Gi 1.8Gi 6.2Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 10Gi 17Mi 30Mi 676Mi 530Mi
Swap: 8.0Gi 2.7Gi 5.3Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 10Gi 18Mi 30Mi 722Mi 575Mi
Swap: 8.0Gi 3.3Gi 4.7Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 5.9Gi 4.4Gi 30Mi 782Mi 5.0Gi
Swap: 8.0Gi 2.5Gi 5.5Gi
❯ free -h
total used free shared buff/cache available
Mem: 11Gi 3.2Gi 6.9Gi 33Mi 950Mi 8.0Gi
Swap: 8.0Gi 2.2Gi 5.8Gi |
|
Is there anything from my side required before merging my changes? |
|
@jsteube What else do I need to do to merge my changes? |
|
Should be fine, please fix the open comments. |
|
@jsteube Ready to merge. |
Add Android Platform Support
Overview
Adds comprehensive Android/Termux support with automatic platform detection and mobile-optimized performance.
Changes
src/affinity.c: Android-compatible CPU affinity usingsched_setaffinitysrc/Makefile: Automatic Android detection and library linkingdocs/BUILD_Android.md: Complete Android build documentationTested Results (POCO X6 Pro)
Benefits