DiaKEM / dexcom-g7-apk-patcher

Dexcom G7 .apk patcher | ✅ AAPS Broadcasting ✅ Disable compatibility checks ✅ Enable Screenshots ✅ Decrease required android version
87 stars 30 forks source link

Update for 1.4.0.3906 #36

Closed mxsrm closed 1 year ago

mxsrm commented 1 year ago

1.4.0.3906 is available now.

Reports suggest power consumption has been fixed.

I tried adjusting the patches myself but ended up bricking the app alltogether, though I suspect it had something to do with the changes I needed to do to AndroidManifest.xml to recompile the apk (https://github.com/mxsrm/dexcom-g7-apk-patcher/commit/b961f82a1da7f32f9f98603a11228484b405752c).

Arakon commented 1 year ago

Dexcom obfuscated the app, it's currently not even possible to recompile a completely unmodified app. So until that is worked around, patching is not possible with that version. I'm pretty sure the line in the manifest file requires changing to point at the actual service name and function for it to work.

Arakon commented 1 year ago

So it seems there's more to it.. even if you tell apktool to not decompile the manifest and resources, and successfully compile it without any errors, it still crashes on launch. Apparently it also has some sort of signature check.. as soon as the signature is changed, it can't launch.

mxsrm commented 1 year ago

So it seems there's more to it.. even if you tell apktool to not decompile the manifest and resources, and successfully compile it without any errors, it still crashes on launch. Apparently it also has some sort of signature check.. as soon as the signature is changed, it can't launch.

I can't confirm that. https://github.com/mxsrm/dexcom-g7-apk-patcher/commit/c89c612c2dfa0970dfd866a123103eb667c17d37 compiles and the app works as expected after installation over the previous version. It crashes when trying to send a new reading to AAPS but until then it works as expected. So I suspect my broadcasting patch is bad but not the app itself.

Edit: Though, when I try to roll back to the old patched version of G7 Android tells me "App not installed as package appears to be invalid." thus forcing me to uninstall G7 before reinstalling the old version. So I have to setup again.

Arakon commented 1 year ago

Okay, strange.. what happens if you apply the compatibility patch only?

Arakon commented 1 year ago

I tested your setup with no patches installed at all and it crashes during the "How to set up" after logging in.

khskekec commented 1 year ago

@mxsrm can you provide more information about the behavior off your apk on your phone?

mxsrm commented 1 year ago

I'm going to work now and will be back later in the evening. Then I will test with only the compatibility patch.

blaqone commented 1 year ago

When disabling phone wide location service, the app does not receive glucose values from the sensor.

All in all the new app gathers quite an amount of data - this is smth we have to work on.

Pamalosebi commented 1 year ago

While searching around I found this Thread. Sad that Dexcom works with such technics for no real reason. --> https://www.reddit.com/r/dexcom/comments/y4vixk/oc_build_your_own_dexcom_app_update_now_with_g7/

Update Feb. 21, 2023

Update on the G7 side. Its a big update and there were some additional hurdles in place to try to prevent modifications. With a bunch of hours and a bit of luck I was able to get around them. Changes include:

Update G7 version to 1.4.0.3906

Maybe joining forces here would be nice?

On an other page... Shoking that the official app has just 1.6 Stars in the Play Store. Almost like a scam App. How can they fuck up so badly.

blaqone commented 1 year ago

The last time we asked, he was not interested in sharing info. We also manage to crack the app and add functionality. Testing in progress…

khskekec commented 1 year ago

Hey @Pamalosebi,

Thank you for this important information. We were also able to get the new version working but I am quite interested in his approach. I will try to decompile byodas apk and try to figure out what he did. Unfortunately it is senseless to write him directly. He is just not answering what is very sad. I am really interested in collaborating with him because he seems to be very experienced and did a great work for G6 already.

But the Screenshot patch shows me that he nevertheless is following this project 😂. We introduced it the first time 😜.

This night we will release also the first patched version with all available patches.

Kind regards

Selçuk

boxdot commented 1 year ago

Great work! I am looking forward to the patch. Especially, I am interested in the obfuscated code to understand how the authentication in G7 is different to G6. I have working code for auth/reading the values from G6 (partially based on xdrip), but G7 is different. However the BLE auth characteristic is still the same, so there is hope. (Sorry for slight off-topic)

Pamalosebi commented 1 year ago

Hey, unfortunately I am not a programmer, but I am happy to help in other ways if possible. I didn't know u/shabado8 was uncooperative, that's really sad to hear. I look forward to your release. You guys are awesome!

mxsrm commented 1 year ago

This night we will release also the first patched version with all available patches.

Any news on that? Would love to see the insane battery drain go :)

khskekec commented 1 year ago

Hey,

Unfortunately I was not able to get the basic broadcasting up and running because 2 sensors were totally crap and not able to just go through the warm up phase.

But I am on it...

khskekec commented 1 year ago

Hey,

Broadcasting, Screenshots and Compatibility patches are ready now.

@blaqone and me will test it now before a release!

khskekec commented 1 year ago

Hey,

Testing was successful so that a new version exists now.

I will close this issue now.

I did not test the patching procedure with Docker. Please open a new issue if you run into problems.

Kind regards

Selcuk

mxsrm commented 1 year ago

Patched versions work perfectly. Battery improvement is insane, from 20%+ per day to less then 0,5%. 10h battery usage to over 20h...

Docker works fine for me.