gitwtfhub

wtf is devicecompat?

getactivity/devicecompat — explained in plain English

Analysis updated 2026-07-21 · repo last pushed 2026-02-11

513JavaAudience · developerComplexity · 2/5MaintainedSetup · easy

TL;DR

A tiny Android library that detects which customized phone operating system is running, like MIUI, HyperOS, or HarmonyOS, so your app can adapt its behavior per device instead of guessing from the brand name alone.

Mindmap

mindmap
  root((repo))
    What it does
      Detects phone OS
      One-line checks
      Covers many systems
    Tech stack
      Java
      Android SDK
      Lightweight 21 KB
    Use cases
      Fix per-brand bugs
      Vary permission flows
      Tailor UI per system
    Audience
      Android developers
    Setup
      Drop-in library
      Android 4.0 plus
    Community
      Contribute device data
      Improve detection

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Apply targeted bug fixes for a specific phone system like MIUI or OneUI.

REASON 2

Show different permission-request instructions depending on the detected OS.

REASON 3

Adjust app behavior for Huawei HarmonyOS versus Xiaomi HyperOS.

REASON 4

Check the device OS type and version with a single line of code.

What's in the stack?

JavaAndroid SDK

How it stacks up

getactivity/devicecompatpeng-zhihui/bluetoothtouchszili1994/create-aeronautics-minecraft-mod
Stars513533292
LanguageJavaJavaJava
Last pushed2026-02-112021-07-09
MaintenanceMaintainedDormant
Setup difficultyeasymoderatemoderate
Complexity2/52/52/5
Audiencedevelopergeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Drop-in Android library with no external dependencies or infra required.

The license is not specified in the project materials, so usage terms are unclear.

Wtf does this do

DeviceCompat is a tool for Android app developers that solves a surprisingly tricky problem: figuring out not just what brand of phone someone is using, but what customized operating system is running on it. If your app needs to behave differently on Xiaomi's HyperOS versus Huawei's HarmonyOS, this library tells you exactly what system is in front of you. The core issue it addresses is that checking a phone's brand is unreliable. Someone might own a Xiaomi phone but have replaced its operating system with a different version. Existing tools only check the manufacturer, which leads to incorrect assumptions. This project goes deeper by detecting the actual system software, covering a wide range of platforms including MIUI, ColorOS, OriginOS, MagicOS, OneUI, and many others. Developers can use a single line of code to check the system type, get the system version, or identify the device brand. An Android developer building an app for a wide audience would use this when they need to apply specific fixes or features for certain phone systems. For example, permission-handling can vary significantly between manufacturers, and an app might need to show different instructions or take a different approach on a Samsung device versus an OPPO device. This tool makes those targeted adjustments much more dependable. It is also notably lightweight at just 21 KB, so it will not bloat the app's file size, and it works on any device running Android 4.0 or later. The creator notes this was a difficult project to build and release as open source, not because of complex algorithms, but because it requires tedious testing across thousands of phone models. The accuracy depends heavily on collecting real device data, and the author actively asks the community to contribute system information from their own phones to improve detection precision over time.

Yoink these prompts

Prompt 1
Add the DeviceCompat library to my Android project and write a helper method that returns the current phone's OS name and version using its one-line API.
Prompt 2
Use DeviceCompat to detect if the user is on MIUI or ColorOS, then branch my permission request flow to show manufacturer-specific instructions.
Prompt 3
I need to apply a workaround only on Samsung OneUI devices, show me how to check the system type with DeviceCompat and gate my fix behind that check.
Prompt 4
Help me integrate DeviceCompat into my existing Android app so I can stop relying on Build.BRAND and instead detect the actual customized OS running on the device.

Frequently asked questions

wtf is devicecompat?

A tiny Android library that detects which customized phone operating system is running, like MIUI, HyperOS, or HarmonyOS, so your app can adapt its behavior per device instead of guessing from the brand name alone.

What language is devicecompat written in?

Mainly Java. The stack also includes Java, Android SDK.

Is devicecompat actively maintained?

Maintained — commit in last 6 months (last push 2026-02-11).

What license does devicecompat use?

The license is not specified in the project materials, so usage terms are unclear.

How hard is devicecompat to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is devicecompat for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.