19.1+: Reduce EXIF metadata in screenshots, thanks to CalyxOS

546fd13c6f

Closes https://github.com/Divested-Mobile/DivestOS-Build/issues/263

Signed-off-by: Tad <tad@spotco.us>
This commit is contained in:
Tad 2023-10-20 18:53:59 -04:00
parent 90979e494c
commit 01e41a26f6
No known key found for this signature in database
GPG Key ID: B286E9F57A07424B
4 changed files with 82 additions and 0 deletions

View File

@ -0,0 +1,40 @@
From 546fd13c6f1d99cb36ca8db80da2d66b96329f47 Mon Sep 17 00:00:00 2001
From: Chirayu Desai <chirayudesai1@gmail.com>
Date: Tue, 26 Sep 2023 19:30:58 +0530
Subject: [PATCH] Put bare minimum metadata in screenshots
* Don't want OS info
* Skip date, time, and more importantly, timezone
Change-Id: I6f38c5cf04539e09b8bfe0102c646bd8faa50f5b
---
.../android/systemui/screenshot/ImageExporter.java | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ImageExporter.java b/packages/SystemUI/src/com/android/systemui/screenshot/ImageExporter.java
index 7cfe2327f992..b991fccf0e84 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ImageExporter.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ImageExporter.java
@@ -394,19 +394,8 @@ public class ImageExporter {
static void updateExifAttributes(ExifInterface exif, UUID uniqueId, int width, int height,
ZonedDateTime captureTime) {
- exif.setAttribute(ExifInterface.TAG_IMAGE_UNIQUE_ID, uniqueId.toString());
-
- exif.setAttribute(ExifInterface.TAG_SOFTWARE, "Android " + Build.DISPLAY);
exif.setAttribute(ExifInterface.TAG_IMAGE_WIDTH, Integer.toString(width));
exif.setAttribute(ExifInterface.TAG_IMAGE_LENGTH, Integer.toString(height));
-
- String dateTime = DateTimeFormatter.ofPattern("yyyy:MM:dd HH:mm:ss").format(captureTime);
- String subSec = DateTimeFormatter.ofPattern("SSS").format(captureTime);
- String timeZone = DateTimeFormatter.ofPattern("xxx").format(captureTime);
-
- exif.setAttribute(ExifInterface.TAG_DATETIME_ORIGINAL, dateTime);
- exif.setAttribute(ExifInterface.TAG_SUBSEC_TIME_ORIGINAL, subSec);
- exif.setAttribute(ExifInterface.TAG_OFFSET_TIME_ORIGINAL, timeZone);
}
static String getMimeType(CompressFormat format) {
--
GitLab

View File

@ -0,0 +1,40 @@
From 546fd13c6f1d99cb36ca8db80da2d66b96329f47 Mon Sep 17 00:00:00 2001
From: Chirayu Desai <chirayudesai1@gmail.com>
Date: Tue, 26 Sep 2023 19:30:58 +0530
Subject: [PATCH] Put bare minimum metadata in screenshots
* Don't want OS info
* Skip date, time, and more importantly, timezone
Change-Id: I6f38c5cf04539e09b8bfe0102c646bd8faa50f5b
---
.../android/systemui/screenshot/ImageExporter.java | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ImageExporter.java b/packages/SystemUI/src/com/android/systemui/screenshot/ImageExporter.java
index 7cfe2327f992..b991fccf0e84 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ImageExporter.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ImageExporter.java
@@ -394,19 +394,8 @@ public class ImageExporter {
static void updateExifAttributes(ExifInterface exif, UUID uniqueId, int width, int height,
ZonedDateTime captureTime) {
- exif.setAttribute(ExifInterface.TAG_IMAGE_UNIQUE_ID, uniqueId.toString());
-
- exif.setAttribute(ExifInterface.TAG_SOFTWARE, "Android " + Build.DISPLAY);
exif.setAttribute(ExifInterface.TAG_IMAGE_WIDTH, Integer.toString(width));
exif.setAttribute(ExifInterface.TAG_IMAGE_LENGTH, Integer.toString(height));
-
- String dateTime = DateTimeFormatter.ofPattern("yyyy:MM:dd HH:mm:ss").format(captureTime);
- String subSec = DateTimeFormatter.ofPattern("SSS").format(captureTime);
- String timeZone = DateTimeFormatter.ofPattern("xxx").format(captureTime);
-
- exif.setAttribute(ExifInterface.TAG_DATETIME_ORIGINAL, dateTime);
- exif.setAttribute(ExifInterface.TAG_SUBSEC_TIME_ORIGINAL, subSec);
- exif.setAttribute(ExifInterface.TAG_OFFSET_TIME_ORIGINAL, timeZone);
}
static String getMimeType(CompressFormat format) {
--
GitLab

View File

@ -177,6 +177,7 @@ applyPatch "$DOS_PATCHES/android_frameworks_base/0029-Allow_Disabling_NTP.patch"
applyPatch "$DOS_PATCHES/android_frameworks_base/0030-System_JobScheduler_Allowance.patch"; #DeviceIdleJobsController: don't ignore whitelisted system apps (GrapheneOS)
if [ "$DOS_MICROG_SUPPORT" = true ]; then applyPatch "$DOS_PATCHES/android_frameworks_base/0031-Unprivileged_microG_Handling.patch"; fi; #Unprivileged microG handling (heavily based off of a CalyxOS patch)
applyPatch "$DOS_PATCHES/android_frameworks_base/0032-tile_restrictions.patch"; #SystemUI: Require unlocking to use sensitive QS tiles (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0042-minimal_screenshot_exif.patch"; #Put bare minimum metadata in screenshots (CalyxOS)
applyPatch "$DOS_PATCHES_COMMON/android_frameworks_base/0007-ABI_Warning.patch"; #Warn when running activity from 32 bit app on ARM64 devices. (AOSP)
applyPatch "$DOS_PATCHES_COMMON/android_frameworks_base/0008-No_Crash_GSF.patch"; #Don't crash apps that depend on missing Gservices provider (GrapheneOS)
hardenLocationConf services/core/java/com/android/server/location/gnss/gps_debug.conf; #Harden the default GPS config

View File

@ -194,6 +194,7 @@ applyPatch "$DOS_PATCHES/android_frameworks_base/0038-no-camera-lpad.patch"; #Do
applyPatch "$DOS_PATCHES/android_frameworks_base/0039-package_hooks.patch"; #Add hooks for modifying PackageManagerService behavior (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0040-euicc-restrictions.patch"; #Integrate Google's EuiccSupportPixel package (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0041-tile_restrictions.patch"; #SystemUI: Require unlocking to use sensitive QS tiles (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0042-minimal_screenshot_exif.patch"; #Put bare minimum metadata in screenshots (CalyxOS)
applyPatch "$DOS_PATCHES_COMMON/android_frameworks_base/0008-No_Crash_GSF.patch"; #Don't crash apps that depend on missing Gservices provider (GrapheneOS)
hardenLocationConf services/core/java/com/android/server/location/gnss/gps_debug.conf; #Harden the default GPS config
sed -i 's/DEFAULT_USE_COMPACTION = false;/DEFAULT_USE_COMPACTION = true;/' services/core/java/com/android/server/am/CachedAppOptimizer.java; #Enable app compaction by default (GrapheneOS)