Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PixelPropUtils: Fix GMS drain triggered by an outdated ROM build date #1026

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

timjosten
Copy link
Contributor

If the build date exceeds a month, GMS, thinking the device is Pixel, attempts a system update, which unexpectedly fails. This goes into an endless cycle, which drains battery very quickly and generates a lot of heat. Let's fix it by spoofing the build date to something always fresh.

If the build date exceeds a month, GMS, thinking the device is Pixel, attempts a system update, which unexpectedly fails. This goes into an endless cycle which drains battery very quickly and generates a lot of heat. Let's fix it by spoofing the build date to something always fresh.
@@ -272,6 +272,7 @@ public static void setProps(String packageName) {
setPropValue(key, value);
}
if (packageName.equals("com.google.android.gms")) {
setPropValue("TIME", System.currentTimeMillis());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move it to spoofBuildGms().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's there where it should be. It's not specific to SafetyNet, but to GMS in general. The draining thread INSTALL_UPDATE runs in 'com.google.android.gms' process.

@gwolf2u gwolf2u added this to Pending ideas in crDroid 9 Oct 25, 2023
@major-mayer
Copy link

Could this maybe get a bit more attention?
Battery life is a really big problem for many Poco F3 users in the last month(s) and if this PR could mitigate the problem at least by a bit, it would be great.
See e. g. https://xdaforums.com/t/rom-13-0-official-alioth-aliothin-crdroid-v9-10-14-10-2023.4512033/page-80

I see the useless pixel system update very often as well in the last time.

@neobuddy89 neobuddy89 merged commit 4bad8ff into crdroidandroid:13.0 Oct 31, 2023
crDroid 9 automation moved this from Pending ideas to Done Oct 31, 2023
@major-mayer
Copy link

Thanks😊

@DeannWinchesterr
Copy link

Thanks😊

Could you tell me if this actually fixes your issues on the F3

@major-mayer
Copy link

Yes I will, when @raystef66 releases a new ROM for our device, I will come back again.

Terminator-J added a commit to Terminator-J/crdroid_frameworks_base that referenced this pull request Jan 11, 2024
The now-squashed commit "PixelPropsUtils: Allow devices to opt out gms/gapps"
crdroidandroid@8baa018
changed behavior to actually require explicitly setting props to true.

Change logic to function the way it did before for this block of functions,
and allow automatically benefiting from SPOOF_PIXEL_GMS
(like avoiding GMS battery drain when Pixel udate is available but device
has not been updated to new ASB yet, see crdroidandroid#1026 )
and require explicit commits by maintainers to opt-out per device.
Terminator-J added a commit to Terminator-J/crdroid_frameworks_base that referenced this pull request Jan 13, 2024
The now-squashed commit "PixelPropsUtils: Allow devices to opt out gms/gapps"
crdroidandroid@8baa018
changed behavior to actually require explicitly setting props to true.

Change logic to function the way it did before for this block of functions,
and allow automatically benefiting from SPOOF_PIXEL_GMS
(like avoiding GMS battery drain when Pixel udate is available but device
has not been updated to new ASB yet, see crdroidandroid#1026 )
and require explicit commits by maintainers to opt-out per device.
Terminator-J added a commit to Terminator-J/crdroid_frameworks_base that referenced this pull request Jan 13, 2024
The now-squashed commit "PixelPropsUtils: Allow devices to opt out gms/gapps"
crdroidandroid@8baa018
changed behavior to actually require explicitly setting props to true.

Change logic to function the way it did before for this block of functions,
and allow automatically benefiting from SPOOF_PIXEL_GMS
(like avoiding GMS battery drain when Pixel udate is available but device
has not been updated to new ASB yet, see crdroidandroid#1026 )
and require explicit commits by maintainers to opt-out per device.
Terminator-J added a commit to Terminator-J/crdroid_frameworks_base that referenced this pull request Jan 14, 2024
The now-squashed commit "PixelPropsUtils: Allow devices to opt out gms/gapps"
crdroidandroid@8baa018
changed behavior to actually require explicitly setting props to true.

Change logic to function the way it did before for this block of functions,
and allow automatically benefiting from SPOOF_PIXEL_GMS
(like avoiding GMS battery drain when Pixel udate is available but device
has not been updated to new ASB yet, see crdroidandroid#1026 )
and require explicit commits by maintainers to opt-out per device.
Terminator-J added a commit to Terminator-J/crdroid_frameworks_base that referenced this pull request Jan 14, 2024
The now-squashed commit "PixelPropsUtils: Allow devices to opt out gms/gapps"
crdroidandroid@8baa018
changed behavior to actually require explicitly setting props to true.

Change logic to function the way it did before for this block of functions,
and allow automatically benefiting from SPOOF_PIXEL_GMS
(like avoiding GMS battery drain when Pixel udate is available but device
has not been updated to new ASB yet, see crdroidandroid#1026 )
and require explicit commits by maintainers to opt-out per device.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants