diff options
author | Bruno Martins <bgcngm@gmail.com> | 2021-06-06 14:10:23 +0100 |
---|---|---|
committer | Bruno Martins <bgcngm@gmail.com> | 2021-06-16 00:39:40 +0200 |
commit | 07f2c91a563e79783bbabec0ec6112cfc3aaf757 (patch) | |
tree | ecd61a44150bf6e0e5357b1a0540ce724d45cb31 | |
parent | 4a34bc93cb65ba368e120bfa09908583e6d18691 (diff) |
lineagestats: Use FLAG_IMMUTABLE for ReportingServiceManager
Following Google's approach to fix these vulnerabilities,
require that the PendingIntent be immutable so that a malicious app
isn't able to hijack and mutate any of the details.
Change-Id: Ic66e57f0d0cc9a0b1afbb62857809499cb50172f
-rw-r--r-- | src/org/lineageos/lineageparts/lineagestats/ReportingServiceManager.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/org/lineageos/lineageparts/lineagestats/ReportingServiceManager.java b/src/org/lineageos/lineageparts/lineagestats/ReportingServiceManager.java index c71e48b..6faeb89 100644 --- a/src/org/lineageos/lineageparts/lineagestats/ReportingServiceManager.java +++ b/src/org/lineageos/lineageparts/lineagestats/ReportingServiceManager.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2012 The CyanogenMod Project - * 2017 The LineageOS Project + * 2017,2020-2021 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ public class ReportingServiceManager extends BroadcastReceiver { AlarmManager alarmManager = context.getSystemService(AlarmManager.class); alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + millisFromNow, - PendingIntent.getBroadcast(context, 0, intent, 0)); + PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_IMMUTABLE)); Log.d(TAG, "Next sync attempt in : " + (millisFromNow / MILLIS_PER_HOUR) + " hours"); } |