finds.dev← search

// the find

guolindev/PermissionX

★ 3,665 · Kotlin · Apache-2.0 · updated Aug 2024

An open source Android library that makes handling runtime permissions extremely easy.

PermissionX is an Android library that wraps the runtime permissions API into a fluent builder chain. It handles the three annoying cases — first request, rationale dialog, and 'never ask again' → settings redirect — without you having to write the state machine yourself. Aimed at any Android developer who doesn't want to manually implement the permissions flow from scratch.

The chain API is genuinely clean: onExplainRequestReason and onForwardToSettings compose naturally and the callback parameters make it obvious what to do with the denied list. The invisible fragment trick to avoid Activity lifecycle coupling is the right approach and it handles special-case permissions (MANAGE_EXTERNAL_STORAGE, SYSTEM_ALERT_WINDOW, notification, background location) as separate RequestChain tasks rather than bolting them onto normal permissions — that's the correct separation. Dark theme support comes for free since it keys off the system theme. Java interop is present, which matters for legacy codebases.

Last push was August 2024 and Android 15 shipped in late 2024, so there's real risk that newer permission categories (like the health permissions introduced in recent API levels) aren't covered. The library mixes Java and Kotlin in the same module with no apparent reason — callbacks are Java interfaces, core logic is Kotlin — which makes the source harder to follow and contribution messier than it needs to be. The built-in dialogs are functional but not themeable beyond dark/light; any app with a design system will end up reimplementing the custom dialog path anyway. Documentation is almost entirely on a Chinese blog, so anything beyond the README requires either translation or guessing.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →