diff --git a/Patches/LineageOS-19.1/android_frameworks_base/0033-minimal_screenshot_exif.patch b/Patches/LineageOS-19.1/android_frameworks_base/0033-minimal_screenshot_exif.patch new file mode 100644 index 00000000..4fa9b591 --- /dev/null +++ b/Patches/LineageOS-19.1/android_frameworks_base/0033-minimal_screenshot_exif.patch @@ -0,0 +1,40 @@ +From 546fd13c6f1d99cb36ca8db80da2d66b96329f47 Mon Sep 17 00:00:00 2001 +From: Chirayu Desai +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 + diff --git a/Patches/LineageOS-20.0/android_frameworks_base/0042-minimal_screenshot_exif.patch b/Patches/LineageOS-20.0/android_frameworks_base/0042-minimal_screenshot_exif.patch new file mode 100644 index 00000000..4fa9b591 --- /dev/null +++ b/Patches/LineageOS-20.0/android_frameworks_base/0042-minimal_screenshot_exif.patch @@ -0,0 +1,40 @@ +From 546fd13c6f1d99cb36ca8db80da2d66b96329f47 Mon Sep 17 00:00:00 2001 +From: Chirayu Desai +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 + diff --git a/Scripts/LineageOS-19.1/Patch.sh b/Scripts/LineageOS-19.1/Patch.sh index 72aa473b..8db68b4b 100644 --- a/Scripts/LineageOS-19.1/Patch.sh +++ b/Scripts/LineageOS-19.1/Patch.sh @@ -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 diff --git a/Scripts/LineageOS-20.0/Patch.sh b/Scripts/LineageOS-20.0/Patch.sh index 37d7895e..df19ab91 100644 --- a/Scripts/LineageOS-20.0/Patch.sh +++ b/Scripts/LineageOS-20.0/Patch.sh @@ -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)