Git Product home page Git Product logo

xiaomiwearablepatch's Introduction

XiaoMiWearablePatch

This Xposed module patches the Mi Fitness application (com.xiaomi.wearable) to work around a bug where it will fail to list your devices.

Technical Details

Xiaomi uses the Android Room library for handling storage; however, their implementation (as of version 3.5.1i) has a bug where they access it too early. This means that when Room internally tries to get the package name, it fails because it couldn't find the application context. This patch catches this and returns the context it has (which happens to be a partially initialized Application) to work around the issue.

The relevant stack looks something like:

FATAL EXCEPTION: Thread-2
Process: com.xiaomi.wearable:device, PID: 5467
java.lang.ExceptionInInitializerError
	at com.xiaomi.fitness.settingitem.DeviceSettingManager.getDatabase(SourceFile:1)
	at com.xiaomi.fitness.settingitem.DeviceSettingManager.readSettingItemValue(SourceFile:1)
	at com.xiaomi.fitness.health.curse.CurseManager.readSetting(SourceFile:1)
	at com.xiaomi.fitness.health.curse.CurseManager.initSetting(SourceFile:2)
...
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
	at android.content.ComponentName.<init>(ComponentName.java:131)
	at android.content.Intent.<init>(Intent.java:6875)
	at kk0.<init>(SourceFile:13)
	at jk0.n(SourceFile:2)
	at androidx.room.RoomDatabase.init(SourceFile:17)
	at androidx.room.RoomDatabase$a.d(SourceFile:30)
...

xiaomiwearablepatch's People

Contributors

mook avatar

Stargazers

Dirk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.