yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy S7 Questions and Answers] A3RNAV:
A few weeks after switching from my old S7 Edge to my old S8 (which I did about a month ago), I tried turning on my S7 Edge only for it to enter recovery mode. Since the power button is broken, I figured I would have to reboot it out of recovery mode using ADB on my PC. When I switched my S7 on again the next day to enter recovery mode and connect it to my PC, I got to the "installing updates" screen that precedes recovery mode. This screen showed up for about three seconds before my screen went black. After 10 seconds my phone rebooted and went back to the "installing updates" screen, went black, rebooted, and so on.

I think my phone might be out of battery so when it charges a little bit, it automatically tries to enter recovery mode, which uses up all the power in the battery and causes it to die, restarting the cycle. Is there any way I can stop my phone from automatically turning on when it is plugged in so that it can charge enough to actually make it to recovery mode?

Thanks!
[Samsung Galaxy S7 Questions and Answers] DavidxxxD:
For some reason, the bootloader on this device remembers if you were last booted into recovery, and will return to it on the next poweron, so - without a working power button - there aren't very many options.

The power button could be an easy fix - depending on if it's stuck or damaged. The outer parts of the volume and power buttons on this device are interchangable, so that could make all boot modes possible again. Opening your device may sound scary, but - with good research and some patience - you will find it is certainly doable using basic tools. And if you don't want to do it yourself, a local repair shop would probably do it for cheap as well.

As far is I know, there isn't any usable software fix without a working power button.
[Android Q&A, Help & Troubleshooting] acdavit:
Greetings.

I and most of my diabetic friends I know have Medtronic braded CGMs for controlling our diabetes. The device is attached to the body and is used to monitor glucose levels in your body.

The problem is that it blacklists the majority of Android phones. There's only a handful of devices it is allowed to work on, and this is the list.

I own a Nokia G20 and as a result, I am unable to use my phone with my CGM. Even if I manually install the APK on it, the app still refuses to run on my phone.

View attachment 5874555

I tried reverse engineering the APK file with a tool to try to remove this restriction, but since I lack the understanding of Android app development, reverse engineering and Java, I was unable to do anything significant, although I did find a folder containing the code for whitelisting various devices.

View attachment 5874567

The only option I have for using my CGM is to replace my current phone (which is pretty expensive, plus the effort of copying all of my files and applications over is not really worth it) or to get an older secondary phone for the sole reason of using it for my CGM (which I did). I end up frequently losing my secondary phone, and having ungodly levels of blood glucose because of it. It would mean a lot for us, diabetics if someone were to reverse engineer this piece of software and bypass the restrictions for the app to run on every android smartphone.

Thanks in advance.
[Android Q&A, Help & Troubleshooting] V0latyle:
I don't understand why they think they need to approve every device. Why can't they be happy with simply using something like the Play Integrity API? They even recommend turning off security updates.

This is the epitome of bad software development. I would suggest looking for an alternative if possible, even better if it's open source.
[Android Q&A, Help & Troubleshooting] acdavit:
Probably because of medical regulations (after the therac-25 incident) but I agree with you, the software is a piece of trash. You have to frequently clear data because it slows down and is barely usable after time. Sadly, there are no alternatives (yet) but I would be welcome to install anything other than this piece of trash. Getting a different CGM is not an option for me, only the Medtronic sensors are covered by my insurance. Would be nice if somebody wrote an open source alternative for Guardian Connect, would even write one if I had the know-how to write Android apps, but it would be great if somebody at least managed to bypass this error screen. It probably wouldn't even be that hard to do it, judging how easy it is to hack other aspects of the app, for example you can reset the one week lifetime of the sensor by just unplugging and plugging it back in to the transmitter.
[Android Q&A, Help & Troubleshooting] V0latyle:
Is this in Canada? The Therac-25 was more than 40 years ago and was a programming issue. I'm not sure of its relevance regarding smart devices, particularly when the medical device in question is a glucose monitor, not an insulin pump.

Good point, laws and politics often do more harm than good in this regard

Well...coming from a bioelectronic perspective, there's a reason why they have a finite lifetime. The accuracy and the error margin of the device suffer with age, which is why they're generally supposed to be replaced every 180 days. I'm assuming you're talking about the implantable sensor here.

As for the app...If you're rooted with Magisk, you may be able to use MagiskHide Props Config to change the fingerprint of your device to match that of one on the "approved" list.
[Android Q&A, Help & Troubleshooting] acdavit:
I know about that but my phone is sadly not rootable. Is there a way to do that with adb perhaps?
[Android Q&A, Help & Troubleshooting] V0latyle:
I'm not familiar with Nokia, but generally no.
[Android Q&A, Help & Troubleshooting] Renate:
First impression: The whitelist gets downloaded from here: https://carelink.minimed.com/api/connect/v1/client/config/gm/android/whitegraylist

{
"3.4.0": {
...
},
"3.4.1": {
...
},
"3.4.2": {
...
},
"3.4.3": {
"MAX_PHONE_SCREEN_CONFIG": 7,
"WHITELIST": {
"SM-N970X": {
"description": "Galaxy Note10",
"supportedOS": ["10.0.0", "11.0.0", "12.0.0"]
},
"SM-N970N": {
"description": "Galaxy Note10",
"supportedOS": ["10.0.0", "11.0.0", "12.0.0"]
},
"SM-N970W": {
"description": "Galaxy Note10",
"supportedOS": ["10.0.0", "11.0.0", "12.0.0"]
},
...
},
"GRAYLIST": {
"SONY": [9, 10, 11],
"XIAOMI": [9, 10, 11],
"LGE": [9, 10],
"SAMSUNG": [7, 8, 9, 10, 11, 12, 13],
"HUAWEI": [9, 10],
"GOOGLE": [10, 11, 12, 13]
},
"BLACKLIST": {}
}
}

Silly way #1 to fix this: Change the URL to your own website with edited JSON. :p
[Android Q&A, Help & Troubleshooting] V0latyle:
@acdavit if you were interested in rooting, I found a couple threads that might be helpful to you:

https://xdaforums.com/t/tutorial-how-to-flash-a-new-boot-img-via-fastboot.1752270/

https://xdaforums.com/t/nokia-g20-boot-img-flashing.4357505/
[Android Q&A, Help & Troubleshooting] acdavit:
https://acdavit.github.io/gc/whitegraylist.json

GitHub - acdavit/gc

Contribute to acdavit/gc development by creating an account on GitHub.

github.com

I made a Github repository for an alternative whitelist JSON. Maybe we could maintain it and add devices with user pull requests?
[Android Q&A, Help & Troubleshooting] Renate:
So, here's how I patched it. It's simple (but obscure).

Start with Guardian Connect_3.4.3_Apkpure.apk (32,517,784 bytes)

Disassemble with apktool d

Modify as below

Assemble with apktool b

Align with zipalign

Sign with apksigner

File smali\com\medtronic\guardian\whitelist\h.smali, line #310:

# virtual methods
.method public a()Lcom/medtronic/guardian/whitelist/WhitelistResult;
.locals 3

iget-object v0, p0, Lcom/medtronic/guardian/whitelist/h;->d:Lc/b/c/h/c/b;

invoke-interface {v0}, Lc/b/c/h/c/b;->g0()Z

move-result v0

# if-eqz v0, :cond_0

const-string v0, "Whitelist"

const-string v1, "Device configuration overrides Whitelist check: All devices accepted..."

Just comment out (with #) if-eqz

There is also an issue with AndroidManifest that I didn't look into. Just change "false" to "true" in it:

<application ... android:extractNativeLibs="true" ... />

I actually have a system for patching APKs without a round trip through apktool but I need to do some fine-tuning to make it work with ProGuard obfuscated files.
[Android Q&A, Help & Troubleshooting] Renate:
It's not ready for prime time, but here's how I like to do it:

C:\>unzip "guardian.apk" classes.dex
C:\>dexdump classes.dex /ccom.medtronic.guardian.whitelist.h > guard.sym
C:\>kpatch classes.dex guard.sym guard.kpc
Profile #1: WhiteList
003b5390 a()
003b53ac 0038 -> 0000
Applied 1 patch

Look, Ma, no apktool!

Next: Get rid of the need to unzip. Erm, not when they compressed the classes.dex

Edit: Oh, well, my framework.jar uses uncompressed classes.dex and I can patch that without unzipping using dexdump/kpatch.
[Android Q&A, Help & Troubleshooting] acdavit:
I feel like if we release a script of some sorts for patching the APK there should also be versions for Linux and (if possible) macOS
[Android Q&A, Help & Troubleshooting] Troxelke:
Wow thanks for this info! So on this URL you mention, at the final end, I see Sony for instance on the greylist being just enabling ALL sony devices as long it is Android 9, or 10, or 11. But not 12 or 13. So, if they just add "13" to the Sony greylist, it should be OK?

I see this is about the Guardian app, but this should be the same for the Minimed Mobile app...
[Android Q&A, Help & Troubleshooting] Renate:
No, I don't think they are. I believe the MM uses a white.json

In any case, I posted in the other thread how to do it.
[Android Q&A, Help & Troubleshooting] Troxelke:
Thanks!

Well I expected MM to use the grey (in newer versions), as my previous Sony Xperia (5 ii) was able to work with MM, which I (for this purpose) downgraded from A12 to A11.

In the white list I cannot find back any Sony device, but on the grey list you find "Sony" for Android versions up to 11. So that is why it made sense by me MM uses the grey list you posted.

Ok, so that tutorial should do the trick, I will look into it (however APK tools etc is very new to me). Does it require that I root my phone etc, as I would like to keep my phone as original as possible ...
[Android Q&A, Help & Troubleshooting] Troxelke:
Sorry to bother you again, but do you mean this tutorial? Should it work for MM you think?
[Android Q&A, Help & Troubleshooting] Renate:
Mods to the MM are already listed in the MM thread and are similar (but unrelated) to this thread.
[Android Q&A, Help & Troubleshooting] szvorion:
Hello Guys, it might be too late for you but I think I found the solution.

I am using a Xiaomi Mi9 6/64 (cepheus) with CrDroid running android 13, which isn't supported.

Firstly you have to hide the Magisk, opened BL and other nasty stuff from the android OS, so get get started you need to install UniversalSafetyNetFix. I used the modded version from kdrag0n:

Here you can download it!

Next step is to hide de magisk app (you can do it in the app), enable DenyList and Zygisk, and check the tickmark near Guardian app.

Here is a detailed tutorial how to do it!

Also you should install a Magisk module called MagiskHidePropsConf from here!

You can find a detailed tutorial on the github page, and then what is important, that you should set a fingerprint to a device, you want to be identified, then check the required Medtronic app's requirement, which device is compatible with the app, and then setup that phone's fingerprint to yours through Termux(IMPORTANT: you should download it from Fdroid, not from play store).

They you should proceed with the third option in termux, where you can simulate other device:View attachment 6029552

Here you have to enable 4,5,6 and 7th option.

Next step is to reboot, and you're ready to rock!
[Android Q&A, Help & Troubleshooting] sockny:
Thanks for this; it worked for me.

However, I need a different app, specifically this one:

https://play.google.com/store/apps/details?id=com.medtronic.diabetes.guardian

I was able to find the APK on APKPure: https://apkpure.com/guardian™/com.medtronic.diabetes.guardian

But I don't know how to "turn off" the whitelist.

If you have any ideas, I would be grateful, and so would some of my friends.
[Android Q&A, Help & Troubleshooting] Conquistadores:
I thank you very much! It is quite a complicated process, requiring a lot of effort and time, but it is rewarding. Guardian Connect now smoothly works on my brand new Samsung Galaxy A54.
[Android Q&A, Help & Troubleshooting] kutya1:
Yeah, it would be good to know something about this app. I have decompiled it, but to me its as if medtronic was now using their time to obfuscate the code as much as possible instead of testing phones so we dont need to tinker with their apps in the first place.
[Android Q&A, Help & Troubleshooting] Andy-007:
Could someone post patched apk, thanks 👍
[Android Q&A, Help & Troubleshooting] acdavit:
You have to do it by yourself as it's illegal to share modified APKs.

It's super simple to do on Linux though, I might post a detailed instruction for people who are not familiar with Linux and computer stuff if I will have free time on the weekends.
[Android Q&A, Help & Troubleshooting] Andy-007:
That would be great. I have to install Linux 🤪
[Android Q&A, Help & Troubleshooting] acdavit:
You can do it without installing Linux, You could use a Live USB (my recommended choice), a VM, or WSL. I will make a full guide for non tech savvy people if I ever get some spare time, I'm too busy at the moment sadly though.
[Android Q&A, Help & Troubleshooting] kutya1:
By any chance you know how to sedate the new Guardian app as well?

Guardian™ APK Download for Android - Latest Version

Download Guardian™ APK (1.4.0) for Android for free. Continuously monitors your glucose levels & alerts you before a high or low.

apkpure.net

The main issue is that, medtronic seemingly have moved the validation mechanisms into the native binary (libapp.so; result of compiling flutter/dart code to machine code). I have tried to replace Build.* method calls with my const strings (mimicing an S21 on android 13), but still I get the unsupported message.
[Android Q&A, Help & Troubleshooting] acdavit:
Oh god no, I have no clue.

If you manage to do something about it please update us in the thread, I am facing the same issue with that app, I couldn't even install the APK on my phone without using the Google Play Store.

Renate is also currently working on a patch for the new app.
[Android Q&A, Help & Troubleshooting] Srbija2012:
My partner is a Type 1 diabetic,. Do you have access to the Dexcom receivers and transmitters instead?
[Android Q&A, Help & Troubleshooting] acdavit:
Nope.
[Android Q&A, Help & Troubleshooting] Renate:
Mmm, working on understanding it. Patching comes after that.

There are five libs.

libflutter.so and libsqlcipher.so are normal JNI libs that use JNI_OnLoad and RegisterNatives

libandroid-sake-lib.so uses the predetermined naming of Java_

libscp.so only uses Java_scp_Loader_l (which takes a hashed 32 bit arg)

libapp.so only exports a few functions (for debugging?)

Spoiler content hidden.
[Android Q&A, Help & Troubleshooting] thefyhn:
First of all: Renate, thank you so much for your work here!

I've successfully followed your steps to patch the Guardian Connect app. Now I'm trying to replicate it on the Minimed Mobile app. The furthest I've gotten is to end up on the same warning screen without any text:

* smali/m6/a.smali

* at the bottom of the file

* switch case 3 (below) seems to be the one that reaches the "Unsupported Device" string (look for 0x7f110223 in the code)

* switch cases 0-6 all reach various "unsupported" strings

* case 7 looks better

So I tried to modify the switch case to hit 7, but it seems to just be a default statement that gives the same blocker screen without an error message. I think this entire function just deals with which message you get, not whether you get the blocker screen. Haven't yet found out where it's called from, which feels like the logical next step.

.line 321
:pswitch_data_0
.packed-switch 0x1
:pswitch_7
:pswitch_6
:pswitch_5
:pswitch_4
:pswitch_3
:pswitch_2
:pswitch_1
:pswitch_0
.end packed-switch
[Android Q&A, Help & Troubleshooting] Renate:
Edit: Sorry, I think I am talking about a different product here.

What am I talking about, @acdavit ?

Oh, so this thing was built with the cross-platform development Flutter/Dart

Flutter is the SDK with widgets and stuff.

Dart is the programming language.

(I'd never heard of this stuff before.)

Here is a list of Guardian Dart files (327 out of 1731 total). Notice the last line.

Spoiler content hidden.
[Android Q&A, Help & Troubleshooting] acdavit:
Yup, we were talking about Guardian, the app for the standalone continuous glucose monitor. thefyhn is talking about the Minimed app, the one used for insulin pumps.
[Android Q&A, Help & Troubleshooting] Renate:
Oh, ok. So this is the right place for com.medtronic.diabetes.guardian and Flutter/Dart/libscp/libapp?
[Android Q&A, Help & Troubleshooting] acdavit:
Originally this thread begun for the older Guardian Connect app, but since a lot of people here have also started talking about the new app we could also discuss the com.medtronic.diabetes.guardian here, since I haven't created any new threads for the new app.
[Android Q&A, Help & Troubleshooting] kutya1:
Wow, that looks very promising. I thought there is no way to get anything out of these .so files.

I was trying with IDA, but that only could give me the ASM (arm64 v8) code which was not very helpful.

That is why I resorted to trying send fake info to the jni functions, but it was not very effective. Either I did not replace the function calls with strings correctly somewhere or the dart code actually checks it for itself somehow.
[Android Q&A, Help & Troubleshooting] kutya1:
Btw for ppl who want to modify the Guardian Connect.

[CLOSED] [Discontinued] [Windows] APK Easy Tool v1.60 (2022-06-23)

Apk Easy Tool is a lightweight GUI application that enables you to manage, sign, compile and decompile the APK files for the apps you are working on. APK Easy Tool is absolute free for commercial and non-commercial use. Please note: This tool...

xdaforums.com

This tool is quite handy. Its from 2022 but it actually works fine still, only you need to download apktool from here, because it packs a very old version of it, but its very easy to replace the jar file (restart the program if it was opened during).

You can easily decompile, open the smali\com\medtronic\guardian\whitelist\h.smali file with even a notepad if you will and comment out the 310th line with a '#' on the start of the row. (explained in detail in the #10 post in this thread).

Then all you need to do is save the file in the notepad and hit compile in the program.

No command line tools, no nothing.
[Android Q&A, Help & Troubleshooting] thefyhn:
For the Minimed Mobile people: I'm in!

The patch below, forcing the switch case to always to go case "pswitch_6", works, and takes me to the "welcome" screen, after which I can connect my glucose pump, etc.

(However, the actual bluetooth pairing doesn't work, but I think that's a legit issue with my device. I'll try on some other "unsupported" android phones to check.)

The point of the patch is just to make this switch hit pswitch_6 with is the "device ok" case, while all the others represent various "device not ok". pswitch_2 is the one I was getting (unsupported device).

It's not a very pretty way to fix it but who worries about that in this context.

This is using the Minimed Mobile 2.2.1 apk from apkpure.

From 789293a0baf9ae4f57dc048bb7c81c9a2e3e65dc Mon Sep 17 00:00:00 2001
From:
Date: Sun, 11 Feb 2024 19:17:48 +0100
Subject: [PATCH] success

---
smali/a5/a.smali | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/smali/a5/a.smali b/smali/a5/a.smali
index e2b088e..cab03e7 100644
--- a/smali/a5/a.smali
+++ b/smali/a5/a.smali
@@ -141,16 +141,7 @@
nop

.line 45
- :pswitch_data_0
- .packed-switch 0x1
- :pswitch_6
- :pswitch_5
- :pswitch_4
- :pswitch_3
- :pswitch_2
- :pswitch_1
- :pswitch_0
- .end packed-switch
+ goto :pswitch_6
.end method

.method public bridge synthetic apply(Ljava/lang/Object;)Ljava/lang/Object;
--
2.43.0

If you're not familiar with the diff format above, the point is just to replace the whole switch case with a line that goes directly to "pswitch_6".
[Android Q&A, Help & Troubleshooting] acdavit:
Finally uploaded the tutorial for patching the older Guardian Connect application. Thanks to @kutya1, it doesn't require Linux. The tutorial is a bit silly, but it sure was fun to make.

Also, don't mind the Windows 7 I got running there, it was the newest computer I could find in my household which didn't run Linux.

Also, huge thanks to @Renate for making this whole thing a possibility.
[Android Q&A, Help & Troubleshooting] Andy-007:
Great video, thanks mate 🤩 easy and straight forward 👍
[Android Q&A, Help & Troubleshooting] acdavit:
You're welcome, did you get it to work?
[Android Q&A, Help & Troubleshooting] Andy-007:
Working 👍 just Java need to be installed, to get it work 👌
[Android Q&A, Help & Troubleshooting] szpryczek:
Hello Can you help me I try open Minimed Mobile 2.2.1 on Lenova phone. Can you tell me how I can patch apk? I always get info that my phone is not compatibly after start app.
[Android Q&A, Help & Troubleshooting] Dacia1300:
The app was updated to v3.5.0 and this method does not work anymore.

The h.smali file only has a few lines of code now. It`s different.

Guardian™ Connect - Apps on Google Play

Now there’s a smarter way to manage your diabetes.

play.google.com
[Android Q&A, Help & Troubleshooting] Renate:
Yeah, but because of the ProGuard the "h.smali" code could be the same as it was but it's now "x.smali".
[Android Q&A, Help & Troubleshooting] Dacia1300:
I am not a technical person I just followed the instructions on this thread. Is x.smali in a different path now than smali\com\medtronic\guardian\whitelist?
[Android Q&A, Help & Troubleshooting] Renate:
I just meant x.smali as a random name.

Yes, it's probably in the same directory when it's a named directory.

If it were /a/c/e it could be /b/d/f
[Android Q&A, Help & Troubleshooting] dia11:
I'm working on 3.5.0 as well, this time trying to force whitelist my device for this version. I'm passing it a different link to a custom whitegraylist.json on my drive, but I get this. Need a different approach though, but at least it's a different error message. Change made in com/medtronic/guardian/ui/activities/carelink/t.smali. Again, possibly not the right place. Also not an Android dev
[Android Q&A, Help & Troubleshooting] sockny:
Sadly it isn't. I tried to reverse engineer it, but I couldn't. It's like the whole "disable whitelist" part is missing.
[Android Q&A, Help & Troubleshooting] dia11:
I tried to pass a local file with modified code when it checks the Whitelist on their API, in an attempt to overwrite their whitelist. To no avail, however. It's super granular. The furthest I got was with that "No internet connection" error, where I simply removed the API path.

Could we maybe add a fallback behaviour so that it checks for a local whitelist if it encounters an error?

File: smali/com/medtronic/guardian/whitelist/k
[Android Q&A, Help & Troubleshooting] Renate:
I don't know, someone post or PM a direct link to the apk.
[Android Q&A, Help & Troubleshooting] dia11:
PM sent.