Repository navigation
Replies: 5 comments
|
Rooted Android does not automatically make a packaged Flet app run as a privileged process. The Python code still runs inside the app sandbox, so I would first test the exact Scapy operation outside Flet: adb shell su -c 'python -c "from scapy.all import IP, Ether; print(Ether()/IP(dst="8.8.8.8"))"'If that fails, Flet cannot bypass it. If it works, keep Flet as the UI and call a small rooted helper with If that clears it up, marking the answer would help others with the same Android/root question. |
|
Thanks! Iv already tested that, and managed to create and even emit custom packet via external wifi card which supports monitor mode. And frankly, that's how my app works right now - it uses termux as a root backend. But it's a crutch. :) |
|
That result actually confirms the boundary: the working part is not "Python can do this on Android", it is "Termux is running the operation in a root-capable shell context". A packaged Flet APK will still be an Android app process with its own UID, SELinux/app sandbox rules, and no direct access to Termux's root session. So I would treat Termux as the prototype backend, not as evidence that the Flet process can be made privileged. The cleaner production shape is usually a small rooted helper/service that owns the packet operation, with the Flet app calling it through a narrow command/API. That keeps the UI unprivileged and limits the root surface area to the exact operation that needs it. |
|
The only way I see is to add some python interpreter to assets, and call modules via it. |
|
Hey! Thanks for the detailed feedback and the great suggestion.
The idea of using a JNI/C++ bridge combined with ctypes makes sense. I'll
check that out more deeply.
ср, 8 июл. 2026 г. в 18:50, Demessmer NGUEDJIO ***@***.***>:
… Hey! @ixenion <https://github.com/ixenion> and @yudin-s
<https://github.com/yudin-s>
I’ve been following your struggle with Scapy and the Android sandbox—the
'root crutch' issue is a classic roadblock.
If you want to move beyond IPC or helper binaries, have you considered
writing a minimal JNI/C++ bridge? Instead of spawning a separate process,
you can write a tiny C module that performs the raw socket/packet
operations, then bind it directly to Python using ctypes. This keeps
everything in-process, avoids the overhead of Termux/IPC, and is much
cleaner for production Android apps. It’s definitely a deeper dive, but it
feels like the 'right' way to handle privileged ops on Android without
breaking the Flet lifecycle.
I’ve been exploring similar low-level approaches with a project I
recently published called Cipher-Forge.
(https://github.com/2messmer/cipher-forge)
It's a crypto visualizer where I had to build custom drawing logic and
handle low-level state matrices to bypass 'black-box' libraries. It really
forced me to push Flet’s limits.
I’m really passionate about building these kind of high-performance tools
on top of Flet.
If you're open to it, I'd love to connect and keep in touch. I think
there’s a lot we could share regarding performance and system-level
integration!
signal-2026-07-07-20-12-18-591.png (view on web)
<https://github.com/user-attachments/assets/4f2cc396-1728-450c-84d2-4ab6d25c3185>
signal-2026-07-07-20-13-11-660.png (view on web)
<https://github.com/user-attachments/assets/3c553062-d6ef-4d7d-abd7-df4bd95518dd>
signal-2026-07-07-20-12-57-128.png (view on web)
<https://github.com/user-attachments/assets/57b30292-1add-4873-9d22-83b207ec73e0>
signal-2026-07-07-20-12-39-403.png (view on web)
<https://github.com/user-attachments/assets/39d537af-4c2e-4977-81ec-d90c37480e1c>
—
Reply to this email directly, view it on GitHub
<#6531?email_source=notifications&email_token=ALUHLGDTRYQHZ2KX3MDNP4D5DZUTDA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZVG42DSMRYUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussioncomment-17574928>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALUHLGEH4UT5PZAG5UWIWTT5DZUTDAVCNFSNUABIKJSXA33TNF2G64TZHM2DOMZWG4YDINRXHNCGS43DOVZXG2LPNY5TCMBRGUYTSMBRUF3AE>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/ALUHLGCVEWXBYLU7EOALFUT5DZUTDA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZVG42DSMRYUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/ALUHLGD33E2GUNUC5ZKRFW35DZUTDA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCNZVG42DSMRYUZZGKYLTN5XKO3LFNZ2GS33OUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Question
Hi! Id like to form packets with scapy, but on android cant even
import scapy.all- it saysPermission denied.How can we bypass that? My phone has root access, but cant understand: how to run flet app with root.
Code sample
Error message
------------------------------------------------------
All reactions