Changes for April 2023

This commit is contained in:
Andy CrossGate Yan 2023-04-17 12:39:31 +00:00
parent 7c52a16c2e
commit 40f13096eb
47 changed files with 318 additions and 441 deletions

View File

@ -1,7 +1,7 @@
From 107b0eaf96413e3faac0bcbe7e761d98d3595d76 Mon Sep 17 00:00:00 2001
From d2d9150fee51378f34efff4ba7f50a194bb85064 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 13 Jan 2022 14:22:24 +0000
Subject: [PATCH 01/24] Add SPenPointerOverlay
Subject: [PATCH 01/23] Add SPenPointerOverlay
Toggle this overlay with property "persist.ui.spen.pointer"

View File

@ -1,7 +1,7 @@
From c37fef3e91e035f05f3a9a6ab2f744f6e2051b38 Mon Sep 17 00:00:00 2001
From 80b9721f6e8da1f45ca5ebff8870f235efcb2c1e Mon Sep 17 00:00:00 2001
From: AndyCGYan <GeForce8800Ultra@gmail.com>
Date: Fri, 22 Mar 2019 00:41:20 +0800
Subject: [PATCH 02/24] Disable FP lockouts optionally
Subject: [PATCH 02/23] Disable FP lockouts optionally
Both timed and permanent lockouts - GET THE FUCK OUT
Now targeting LockoutFramework, introduced in Android 12

View File

@ -1,7 +1,7 @@
From c51f1b93e9e69cd50959a7d5b8936adabbb98b8c Mon Sep 17 00:00:00 2001
From 908593ecda65f87bbcbda662f9e35de0d7ba94f4 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 5 Apr 2018 10:01:19 +0800
Subject: [PATCH 03/24] Disable vendor mismatch warning
Subject: [PATCH 03/23] Disable vendor mismatch warning
Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b
---

View File

@ -1,7 +1,7 @@
From 53944713b59f662f2a19ea3ccd3cfdcec9f3593a Mon Sep 17 00:00:00 2001
From e08d2afd0c6663e9d439b9371d9aba20f3e566e5 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 17 Jan 2023 17:19:19 +0000
Subject: [PATCH 04/24] Keyguard: Fix colors of slices not updating on doze
Subject: [PATCH 04/23] Keyguard: Fix colors of slices not updating on doze
Slices were invisible (black) in doze when using light wallpapers
Introduced in https://github.com/LineageOS/android_frameworks_base/commit/a19e59d717ec6d573c11c7e8277bba3c4de189c2

View File

@ -1,7 +1,7 @@
From d7612a2bd79c4fbc738bfb4cee56a3a88839d415 Mon Sep 17 00:00:00 2001
From ef9cee9e51e0c3a3020a83b1e18f229c4e45498a Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 16 Oct 2021 02:23:48 +0000
Subject: [PATCH 05/24] UI: Adjust default navbar layouts
Subject: [PATCH 05/23] UI: Adjust default navbar layouts
- Slightly tighten nodpi layout
- Remove sw372dp layout - looks terrible, probably meant for legacy phablets, but most modern phones qualify

View File

@ -1,7 +1,7 @@
From 132cfec6f7d245e867a2be7939931076d721405d Mon Sep 17 00:00:00 2001
From 4bb9def8e58fa46890cdf93672e35a298bd595ff Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 10 Jan 2021 11:44:29 +0000
Subject: [PATCH 06/24] UI: Disable wallpaper zoom
Subject: [PATCH 06/23] UI: Disable wallpaper zoom
It does little more than inducing motion sickness

View File

@ -1,7 +1,7 @@
From 3cea896b28374cb5975b470134bf572e004c5329 Mon Sep 17 00:00:00 2001
From f439b01c40e9c9af40b40dfb80f7422775c587d6 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 25 Sep 2022 02:20:52 +0000
Subject: [PATCH 07/24] UI: Follow Monet and light/dark theme in user 1 icon
Subject: [PATCH 07/23] UI: Follow Monet and light/dark theme in user 1 icon
Change-Id: I755077c6003c39ddc9428da1defe6a6ddd0e5ff8
---

View File

@ -1,7 +1,7 @@
From 9999d9887ec0fc9f3227bac752126d98b2adc07e Mon Sep 17 00:00:00 2001
From 8f0163c65d95e9ecfb4eb3e573040d22c9693ebb Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 3 Jun 2020 01:31:34 +0000
Subject: [PATCH 08/24] UI: Increase default status bar height
Subject: [PATCH 08/23] UI: Increase default status bar height
Change-Id: Ibbcf63159e19bb2bb2b1094ea07ab85917630b07
---

View File

@ -1,7 +1,7 @@
From b85e925a3accec749a28d5edd6bff3ce20f68924 Mon Sep 17 00:00:00 2001
From e3ad3c7f7bbdb5913feddced1a1a36652d849f9d Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 25 Sep 2022 02:20:20 +0000
Subject: [PATCH 09/24] UI: Remove QS footer background
Subject: [PATCH 09/23] UI: Remove QS footer background
Change-Id: I68e82e0c5e3eddb2d3f767fe792b1436eae506ef
---

View File

@ -1,7 +1,7 @@
From 289c535bf6f0decf2c1ce58650ec7dd6721880a8 Mon Sep 17 00:00:00 2001
From 4a51c5c42de7b550ce9a13322d63c44a8bbd76d8 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 19 Mar 2022 09:22:24 +0000
Subject: [PATCH 10/24] UI: Restore split-screen divider to pre-Sv2 looks
Subject: [PATCH 10/23] UI: Restore split-screen divider to pre-Sv2 looks
- Kill rounded corners - where two rectangles collide should be perfectly straight
- Make it black again - taskbar should mind its own business

View File

@ -1,7 +1,7 @@
From 0697f6baa9ffb4f69b90e9c4f8469e7bd130d6bc Mon Sep 17 00:00:00 2001
From fd92d595cd2d3caa015c1ab1749c1a06c472ba82 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 6 Oct 2020 01:41:16 +0000
Subject: [PATCH 11/24] UI: Revive navbar layout tuning via sysui_nav_bar
Subject: [PATCH 11/23] UI: Revive navbar layout tuning via sysui_nav_bar
tunable
Google keeps fixing what ain't broken.

View File

@ -1,7 +1,7 @@
From 9f0fb3f042124da5731232dffa1bda623c395a22 Mon Sep 17 00:00:00 2001
From ae22c5903fb6bd176d1df8de0292df0c386f1f80 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 26 Apr 2020 08:56:13 +0000
Subject: [PATCH 12/24] UI: Use SNAP_FIXED_RATIO for multi-window globally
Subject: [PATCH 12/23] UI: Use SNAP_FIXED_RATIO for multi-window globally
Enables multiple snap targets under landscape for phone UI

View File

@ -1,7 +1,7 @@
From 30a3637fe457193166cc324af29c306d7748adfa Mon Sep 17 00:00:00 2001
From 519ee96fabf6d29ed22641f3a587012d92cc6846 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 3 Nov 2020 22:43:12 -0800
Subject: [PATCH 13/24] core: Remove old app target SDK dialog
Subject: [PATCH 13/23] core: Remove old app target SDK dialog
If an app is old, users should already know that, and there's usually no
point in warning them about it because they would already be using a

View File

@ -1,7 +1,7 @@
From 964346e2b9e8ceaa7c6b2b9a4c74a401af0fc9e0 Mon Sep 17 00:00:00 2001
From b715efda04efd69a0bfd4a9fd003e519b1255e96 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Tue, 5 Oct 2021 21:01:50 -0700
Subject: [PATCH 14/24] Paint: Enable subpixel text positioning by default
Subject: [PATCH 14/23] Paint: Enable subpixel text positioning by default
On desktop Linux, subpixel text positioning is necessary to avoid
kerning issues, and Android is no different. Even though most phone

View File

@ -1,7 +1,7 @@
From d5b5deb95a8bf6737973cde8460d05b19a70032c Mon Sep 17 00:00:00 2001
From 8b06ea31edf57c5b6252a188f2035c92c6c2bd31 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Sat, 16 Oct 2021 05:27:57 -0700
Subject: [PATCH 16/24] Add support for app signature spoofing
Subject: [PATCH 15/23] Add support for app signature spoofing
This is needed by microG GmsCore to pretend to be the official Google
Play Services package, because client apps check the package signature

View File

@ -1,320 +0,0 @@
From 4fa320b2eacab5be5b9fb3f2ebe24f39e8b54cc1 Mon Sep 17 00:00:00 2001
From: Park Ju Hyung <qkrwngud825@gmail.com>
Date: Sun, 15 Jan 2017 03:33:04 +0900
Subject: [PATCH 15/24] SystemUI: add burnIn protection
Devices with AMOLED display suffer from
status-bar's notification items and nagivation bar's software keys
causing permanent burn-ins when used long-term.
Moving all items in the area
both horizontally and vertically workarounds this problem.
jrizzoli: integrate with runtime cmsdk preference
Linux4: Removed toggle from settings - the burnIn protection is always
enabled if the corresponding AOSP overlay is set to true
Updated for T
Change-Id: I35b04d1edff86a556adb3ad349569e5d82653f16
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
Signed-off-by: Thecrazyskull <anaskarbila@gmail.com>
Signed-off-by: Joey Rizzoli <joey@lineageos.org>
---
.../SystemUI/res/values/lineage_dimens.xml | 3 +
.../navigationbar/NavigationBarView.java | 26 +++++
.../statusbar/phone/CentralSurfacesImpl.java | 14 +++
.../statusbar/phone/PhoneStatusBarView.java | 27 +++++
.../policy/BurnInProtectionController.java | 105 ++++++++++++++++++
5 files changed, 175 insertions(+)
create mode 100644 packages/SystemUI/src/com/android/systemui/statusbar/policy/BurnInProtectionController.java
diff --git a/packages/SystemUI/res/values/lineage_dimens.xml b/packages/SystemUI/res/values/lineage_dimens.xml
index e1998ce3d3ab..dc59ccd794f7 100644
--- a/packages/SystemUI/res/values/lineage_dimens.xml
+++ b/packages/SystemUI/res/values/lineage_dimens.xml
@@ -21,4 +21,7 @@
<!-- Largest size an avatar might need to be drawn in the power menu user picker -->
<dimen name="global_actions_avatar_size">24dp</dimen>
+
+ <dimen name="burnin_protection_horizontal_shift">3dp</dimen>
+ <dimen name="burnin_protection_vertical_shift">1dp</dimen>
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
index 883903efb95f..2020910d88bf 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
@@ -163,6 +163,13 @@ public class NavigationBarView extends FrameLayout implements TunerService.Tunab
private FloatingRotationButton mFloatingRotationButton;
private RotationButtonController mRotationButtonController;
+ private int mBasePaddingBottom;
+ private int mBasePaddingLeft;
+ private int mBasePaddingRight;
+ private int mBasePaddingTop;
+
+ private ViewGroup mNavigationBarContents;
+
/**
* Helper that is responsible for showing the right toast when a disallowed activity operation
* occurred. In pinned mode, we show instructions on how to break out of this mode, whilst in
@@ -880,12 +887,31 @@ public class NavigationBarView extends FrameLayout implements TunerService.Tunab
mContextualButtonGroup.setButtonVisibility(R.id.accessibility_button, visible);
}
+ public void shiftNavigationBarItems(int horizontalShift, int verticalShift) {
+ if (mNavigationBarContents == null) {
+ return;
+ }
+
+ mNavigationBarContents.setPaddingRelative(mBasePaddingLeft + horizontalShift,
+ mBasePaddingTop + verticalShift,
+ mBasePaddingRight + horizontalShift,
+ mBasePaddingBottom - verticalShift);
+ invalidate();
+ }
+
@Override
public void onFinishInflate() {
super.onFinishInflate();
mNavigationInflaterView = findViewById(R.id.navigation_inflater);
mNavigationInflaterView.setButtonDispatchers(mButtonDispatchers);
+
+ mNavigationBarContents = (ViewGroup) findViewById(R.id.nav_buttons);
+
+ mBasePaddingLeft = mNavigationBarContents.getPaddingStart();
+ mBasePaddingTop = mNavigationBarContents.getPaddingTop();
+ mBasePaddingRight = mNavigationBarContents.getPaddingEnd();
+ mBasePaddingBottom = mNavigationBarContents.getPaddingBottom();
updateOrientationViews();
reloadNavIcons();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
index 83755c6591be..4e2bb5424eb8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
@@ -226,6 +226,7 @@ import com.android.systemui.statusbar.phone.dagger.StatusBarPhoneModule;
import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallController;
import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.BrightnessMirrorController;
+import com.android.systemui.statusbar.policy.BurnInProtectionController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
@@ -453,6 +454,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces, Tune
@Nullable
protected LockscreenWallpaper mLockscreenWallpaper;
private final AutoHideController mAutoHideController;
+ private BurnInProtectionController mBurnInProtectionController;
private final Point mCurrentDisplaySize = new Point();
@@ -1233,6 +1235,12 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces, Tune
mNotificationPanelViewController.updatePanelExpansionAndVisibility();
setBouncerShowingForStatusBarComponents(mBouncerShowing);
checkBarModes();
+
+ if (mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_enableBurnInProtection)) {
+ mBurnInProtectionController = new BurnInProtectionController(mContext,
+ this, mStatusBarView);
+ }
});
initializer.initializeStatusBar(mCentralSurfacesComponent);
@@ -3488,6 +3496,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces, Tune
updateNotificationPanelTouchState();
mNotificationShadeWindowViewController.cancelCurrentTouch();
+ if (mBurnInProtectionController != null) {
+ mBurnInProtectionController.stopShiftTimer(true);
+ }
if (mLaunchCameraOnFinishedGoingToSleep) {
mLaunchCameraOnFinishedGoingToSleep = false;
@@ -3593,6 +3604,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces, Tune
}
}
updateScrimController();
+ if (mBurnInProtectionController != null) {
+ mBurnInProtectionController.startShiftTimer(true);
+ }
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
index 5692024fb473..3892921957b2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@@ -19,6 +19,7 @@ package com.android.systemui.statusbar.phone;
import android.annotation.Nullable;
import android.content.Context;
+import android.content.res.Resources;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.inputmethodservice.InputMethodService;
@@ -63,6 +64,13 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks {
private final CommandQueue mCommandQueue;
private final StatusBarContentInsetsProvider mContentInsetsProvider;
+ private int mBasePaddingBottom;
+ private int mBasePaddingLeft;
+ private int mBasePaddingRight;
+ private int mBasePaddingTop;
+
+ private ViewGroup mStatusBarContents;
+
private DarkReceiver mBattery;
private ClockController mClockController;
private int mRotationOrientation = -1;
@@ -140,6 +148,18 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks {
StatusBarUserChipViewBinder.bind(container, viewModel);
}
+ public void shiftStatusBarItems(int horizontalShift, int verticalShift) {
+ if (mStatusBarContents == null) {
+ return;
+ }
+
+ mStatusBarContents.setPaddingRelative(mBasePaddingLeft + horizontalShift,
+ mBasePaddingTop + verticalShift,
+ mBasePaddingRight + horizontalShift,
+ mBasePaddingBottom - verticalShift);
+ invalidate();
+ }
+
@Override
public void onFinishInflate() {
super.onFinishInflate();
@@ -147,6 +167,13 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks {
mClockController = new ClockController(getContext(), this);
mCutoutSpace = findViewById(R.id.cutout_space_view);
+ mStatusBarContents = (ViewGroup) findViewById(R.id.status_bar_contents);
+
+ mBasePaddingLeft = mStatusBarContents.getPaddingStart();
+ mBasePaddingTop = mStatusBarContents.getPaddingTop();
+ mBasePaddingRight = mStatusBarContents.getPaddingEnd();
+ mBasePaddingBottom = mStatusBarContents.getPaddingBottom();
+
updateResources();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BurnInProtectionController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BurnInProtectionController.java
new file mode 100644
index 000000000000..864d86ffd6a3
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BurnInProtectionController.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2017 Paranoid Android
+ * Copyright 2020 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.policy;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.os.Handler;
+import android.os.Looper;
+import android.util.Log;
+
+import com.android.systemui.R;
+import com.android.systemui.navigationbar.NavigationBarView;
+import com.android.systemui.statusbar.phone.PhoneStatusBarView;
+import com.android.systemui.statusbar.phone.CentralSurfacesImpl;
+
+public class BurnInProtectionController {
+ private static final String TAG = "BurnInProtectionController";
+ private static final boolean DEBUG = false;
+ private static final long INTERVAL = 60000; // Milliseconds
+
+ private int mHorizontalShift = 0;
+ private int mVerticalShift = 0;
+ private int mHorizontalDirection = 1;
+ private int mVerticalDirection = 1;
+ private int mNavigationBarHorizontalMaxShift;
+ private int mNavigationBarVerticalMaxShift;
+ private int mHorizontalMaxShift;
+ private int mVerticalMaxShift;
+ private long mShiftInterval;
+
+ private final Handler mHandler = new Handler();
+ private final Runnable mRunnable = () -> {
+ shiftItems();
+ mHandler.postDelayed(this.mRunnable, INTERVAL);
+ };
+
+ private PhoneStatusBarView mPhoneStatusBarView;
+ private CentralSurfacesImpl mStatusBar;
+
+ private Context mContext;
+
+ public BurnInProtectionController(Context context, CentralSurfacesImpl statusBar,
+ PhoneStatusBarView phoneStatusBarView) {
+ mContext = context;
+
+ mPhoneStatusBarView = phoneStatusBarView;
+ mStatusBar = statusBar;
+
+ mHorizontalMaxShift = mContext.getResources()
+ .getDimensionPixelSize(R.dimen.burnin_protection_horizontal_shift);
+ // total of ((vertical_max_shift - 1) * 2) pixels can be moved
+ mVerticalMaxShift = mContext.getResources()
+ .getDimensionPixelSize(R.dimen.burnin_protection_vertical_shift) - 1;
+ }
+
+ public void startShiftTimer(boolean enabled) {
+ if (!enabled) return;
+ mHandler.removeCallbacks(mRunnable);
+ mHandler.postDelayed(mRunnable, INTERVAL);
+ if (DEBUG) Log.d(TAG, "Started shift timer");
+ }
+
+ public void stopShiftTimer(boolean enabled) {
+ if (!enabled) return;
+ mHandler.removeCallbacks(mRunnable);
+ if (DEBUG) Log.d(TAG, "Canceled shift timer");
+ }
+
+ private void shiftItems() {
+ mHorizontalShift += mHorizontalDirection;
+ if ((mHorizontalShift >= mHorizontalMaxShift) ||
+ (mHorizontalShift <= -mHorizontalMaxShift)) {
+ mHorizontalDirection *= -1;
+ }
+
+ mVerticalShift += mVerticalDirection;
+ if ((mVerticalShift >= mVerticalMaxShift) ||
+ (mVerticalShift <= -mVerticalMaxShift)) {
+ mVerticalDirection *= -1;
+ }
+
+ mPhoneStatusBarView.shiftStatusBarItems(mHorizontalShift, mVerticalShift);
+ NavigationBarView navigationBarView = mStatusBar.getNavigationBarView();
+
+ if (navigationBarView != null) {
+ navigationBarView.shiftNavigationBarItems(mHorizontalShift, mVerticalShift);
+ }
+ if (DEBUG) Log.d(TAG, "Shifting items\u2026");
+ }
+}
--
2.34.1

View File

@ -1,7 +1,7 @@
From 47265639ead98824ac0d176e06bcffe6a2035a42 Mon Sep 17 00:00:00 2001
From dff8fbe5dfceacfd51b3606d7b137616911a6cf6 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 19:59:51 -0700
Subject: [PATCH 17/24] Spoof product name for Google Play Services
Subject: [PATCH 16/23] Spoof product name for Google Play Services
NB: This code is under the gmscompat package, but it does not depend on
any code from gmscompat.

View File

@ -1,7 +1,7 @@
From 838a9febd980da5a1829c75f86ecc5a519e9cdb9 Mon Sep 17 00:00:00 2001
From bf57e2c0560a94601c465de9cce8ae77111ba37f Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 11 Oct 2021 20:00:44 -0700
Subject: [PATCH 18/24] keystore: Block key attestation for SafetyNet
Subject: [PATCH 17/23] keystore: Block key attestation for SafetyNet
SafetyNet (part of Google Play Services) opportunistically uses
hardware-backed key attestation via KeyStore as a strong integrity

View File

@ -1,7 +1,7 @@
From 260b0f7a81c762b3b03b8f83dedee9c92e0f55ca Mon Sep 17 00:00:00 2001
From 4b2da805e60f7456b60fbef0399b42270bd6d1d8 Mon Sep 17 00:00:00 2001
From: Danny Lin <danny@kdrag0n.dev>
Date: Mon, 1 Nov 2021 20:06:48 -0700
Subject: [PATCH 19/24] Limit SafetyNet workarounds to unstable GMS process
Subject: [PATCH 18/23] Limit SafetyNet workarounds to unstable GMS process
The unstable process is where SafetyNet attestation actually runs, so
we only need to spoof the model in that process. Leaving other processes

View File

@ -1,7 +1,7 @@
From 839d9d8e213a15c823aa218539993b2c23f3bd65 Mon Sep 17 00:00:00 2001
From 3e127f227f91e2cda68ae28c531c7f7034693b9e Mon Sep 17 00:00:00 2001
From: Dyneteve <dyneteve@hentaios.com>
Date: Tue, 23 Aug 2022 18:57:05 +0200
Subject: [PATCH 20/24] gmscompat: Apply the SafetyNet workaround to Play Store
Subject: [PATCH 19/23] gmscompat: Apply the SafetyNet workaround to Play Store
aswell
Play Store is used for the new Play Integrity API, extend the hack

View File

@ -1,7 +1,7 @@
From 030dc8f051ca98594cc037b1fe6b79d417d3a8a3 Mon Sep 17 00:00:00 2001
From 408d79cb171d9d9d4e78c068601c8e08047b18d0 Mon Sep 17 00:00:00 2001
From: Dyneteve <dyneteve@hentaios.com>
Date: Thu, 8 Sep 2022 14:39:52 +0200
Subject: [PATCH 21/24] gmscompat: Use Nexus 6P fingerprint for CTS/Integrity
Subject: [PATCH 20/23] gmscompat: Use Nexus 6P fingerprint for CTS/Integrity
Google seems to have patched the KM block to Play Store in record time,
but is still not enforced for anything under android N.

View File

@ -1,7 +1,7 @@
From bdd113e11896541b2e4df0fcb9dd94ce3334e933 Mon Sep 17 00:00:00 2001
From 9e51495edc14e3cf1609eccf3d65a71720c17a09 Mon Sep 17 00:00:00 2001
From: Dyneteve <dyneteve@hentaios.com>
Date: Tue, 6 Dec 2022 15:59:08 +0100
Subject: [PATCH 22/24] gmscompat: Use actual device model name
Subject: [PATCH 21/23] gmscompat: Use actual device model name
Signed-off-by: Dyneteve <dyneteve@hentaios.com>
Change-Id: I454654d87b3ea6286e12e9a9f5ed120f06cb2aa6

View File

@ -1,7 +1,7 @@
From b4b83ed885d8c3751220ab7270ff0819ea37fb5e Mon Sep 17 00:00:00 2001
From f7ac5b583424583d440b7f2ce6bdce96fce2e209 Mon Sep 17 00:00:00 2001
From: Anirudh Gupta <anirudhgupta109@aosip.dev>
Date: Wed, 4 Jan 2023 18:20:56 +0000
Subject: [PATCH 23/24] gmscompat: Set shipping level to 32 for devices >=33
Subject: [PATCH 22/23] gmscompat: Set shipping level to 32 for devices >=33
If ro.product.first_api_level is 33, its forced to use HW attestation even though the safteynet checker app shows BASIC
setting it to 32 allows for software attestation and passing CTS

View File

@ -1,7 +1,7 @@
From 2d053efcdbc7ad46ab7cae4550c3134b6ca5ba62 Mon Sep 17 00:00:00 2001
From ebbe0af4cff77d27ab5b7b23c5d86f947428b4c4 Mon Sep 17 00:00:00 2001
From: Dyneteve <dyneteve@hentaios.com>
Date: Wed, 8 Feb 2023 15:21:01 +0000
Subject: [PATCH 24/24] gmscompat: Make CTS/Play Integrity pass again
Subject: [PATCH 23/23] gmscompat: Make CTS/Play Integrity pass again
The logic behind CTS and Play Integrity has been updated today it now
checks the product and model names against the fingerprint and if

View File

@ -1,7 +1,7 @@
From 630ef309d41f80ba621c9646d44e1480a2c1b06b Mon Sep 17 00:00:00 2001
From fe9ef4702e81d02d75fb9e6df73fcf013fb955af Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 20 Jun 2021 03:39:32 +0000
Subject: [PATCH 01/21] Add MiuiNavbarOverlay
Subject: [PATCH 01/20] Add MiuiNavbarOverlay
Change-Id: I0e6791abc3c9521d7dc612df2fec2b041affe7e9
---

View File

@ -1,7 +1,7 @@
From df749c8f69ea955f7ce2894ef73f0b395b6aa86d Mon Sep 17 00:00:00 2001
From 964e570909040dc8de452f5269f633c4b4fe9519 Mon Sep 17 00:00:00 2001
From: Hikari-no-Tenshi <kyryljan.serhij@gmail.com>
Date: Thu, 30 Jan 2020 22:20:54 +0200
Subject: [PATCH 02/21] Disable Bluetooth by default
Subject: [PATCH 02/20] Disable Bluetooth by default
Change-Id: Iea5d24f977928bf01cd7a46b98c75c0a4bd6a23c
---

View File

@ -1,7 +1,7 @@
From 3446855cc0673b68bbd3558362e282c5b1decf51 Mon Sep 17 00:00:00 2001
From 0db4a23679a9c74790cc618abeeeadaf0a202665 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 27 Sep 2021 16:30:00 +0000
Subject: [PATCH 03/21] Disable cursor drag by default for editable TextViews
Subject: [PATCH 03/20] Disable cursor drag by default for editable TextViews
Requested by @TadiT7

View File

@ -1,7 +1,7 @@
From 4706b07fb66ea1a0f10a5bb84cda6780cb10f4a3 Mon Sep 17 00:00:00 2001
From 6a0d86399b5d61301d2184a6b10152462380dc10 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 3 Jul 2022 00:08:42 +0000
Subject: [PATCH 04/21] Disable "RESTRICTED bucket" toast
Subject: [PATCH 04/20] Disable "RESTRICTED bucket" toast
Change-Id: I20a328d3c77962f3a6095bfca42d0b165a093ce8
---

View File

@ -1,7 +1,7 @@
From 2362d29a436aa9483f6913e022567d6f9fd90332 Mon Sep 17 00:00:00 2001
From 64d1e22f654f996d3cc46334f4a75b6c37c16268 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 2 Sep 2021 16:15:19 +0000
Subject: [PATCH 05/21] Keyguard: Adjust clock style
Subject: [PATCH 05/20] Keyguard: Adjust clock style
Thinner font, less padding and unintrusive colors

View File

@ -1,7 +1,7 @@
From f3928474b86986827588d05535cc045156becbde Mon Sep 17 00:00:00 2001
From abc2207876e23d1c01e0c45fe604dcef3967e1b7 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 2 Nov 2019 06:41:03 +0000
Subject: [PATCH 06/21] Keyguard: Hide padlock unless UDFPS is in use
Subject: [PATCH 06/20] Keyguard: Hide padlock unless UDFPS is in use
Fair enough Google, but don't give me that otherwise

View File

@ -1,7 +1,7 @@
From 67e73c9aa252581a81f0dabcc6b8a7067da040ac Mon Sep 17 00:00:00 2001
From 86a90de31bc9c05b3124d573dcd93eb5a3ddf5ec Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 1 Sep 2021 14:41:53 +0000
Subject: [PATCH 07/21] Keyguard: Never switch to large clock
Subject: [PATCH 07/20] Keyguard: Never switch to large clock
It looks alright actually, but as always breaks under landscape

View File

@ -1,7 +1,7 @@
From 5b078c1242e2d69a887b56130b0f12609269ad89 Mon Sep 17 00:00:00 2001
From 6254335e8e470501a24b678aa006536fadd0f7c0 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 2 Nov 2019 08:31:36 +0000
Subject: [PATCH 08/21] Keyguard: Refine indication text
Subject: [PATCH 08/20] Keyguard: Refine indication text
Change-Id: Ib771c35610f712a1de34736e817bcfe616ac37d8
---
@ -84,7 +84,7 @@ index 9235e10209d4..42e710d9c9a3 100644
* Clears all messages in the queue and sets the current message to an empty string.
*/
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index 6a658b6ee047..632d186ac4f4 100644
index 3301d6907a25..15a7555e1381 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -270,10 +270,12 @@ public class KeyguardIndicationController {
@ -100,7 +100,7 @@ index 6a658b6ee047..632d186ac4f4 100644
} else if (msg.what == MSG_RESET_ERROR_MESSAGE_ON_SCREEN_ON) {
mBiometricErrorMessageToShowOnScreenOn = null;
}
@@ -375,7 +377,6 @@ public class KeyguardIndicationController {
@@ -377,7 +379,6 @@ public class KeyguardIndicationController {
updateLockScreenDisclosureMsg();
updateLockScreenOwnerInfo();
updateLockScreenBatteryMsg(animate);
@ -108,7 +108,7 @@ index 6a658b6ee047..632d186ac4f4 100644
updateLockScreenTrustMsg(userId, getTrustGrantedIndication(), getTrustManagedIndication());
updateLockScreenAlignmentMsg();
updateLockScreenLogoutView();
@@ -484,22 +485,6 @@ public class KeyguardIndicationController {
@@ -486,22 +487,6 @@ public class KeyguardIndicationController {
}
}
@ -131,7 +131,7 @@ index 6a658b6ee047..632d186ac4f4 100644
private void updateBiometricMessage() {
if (mDozing) {
updateDeviceEntryIndication(false);
@@ -592,11 +577,11 @@ public class KeyguardIndicationController {
@@ -594,11 +579,11 @@ public class KeyguardIndicationController {
}
private void updateLockScreenPersistentUnlockMsg() {

View File

@ -1,7 +1,7 @@
From 146d8cbf38f17136e1aed47d634ff833f5a5fc8d Mon Sep 17 00:00:00 2001
From 4eebadc9bacc35b94ac2fec83e68b4fd0a6eab21 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 20 Mar 2021 10:35:14 +0000
Subject: [PATCH 09/21] Keyguard/UI: Fix status bar / quick settings margins
Subject: [PATCH 09/20] Keyguard/UI: Fix status bar / quick settings margins
and paddings
Last revised on 2023/03/22, targeting T QPR2
@ -101,10 +101,10 @@ index e56e5d557c2f..6378705f9db4 100644
\ No newline at end of file
+</ConstraintSet>
diff --git a/packages/SystemUI/src/com/android/systemui/shade/LargeScreenShadeHeaderController.kt b/packages/SystemUI/src/com/android/systemui/shade/LargeScreenShadeHeaderController.kt
index 9795434a6545..cc8e3f48131d 100644
index a3dffa2ec4d8..dca955008ad3 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/LargeScreenShadeHeaderController.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/LargeScreenShadeHeaderController.kt
@@ -136,6 +136,8 @@ class LargeScreenShadeHeaderController @Inject constructor(
@@ -140,6 +140,8 @@ class LargeScreenShadeHeaderController @Inject constructor(
private var cutoutLeft = 0
private var cutoutRight = 0
private var roundedCorners = 0
@ -113,7 +113,7 @@ index 9795434a6545..cc8e3f48131d 100644
private var lastInsets: WindowInsets? = null
private var textColorPrimary = Color.TRANSPARENT
@@ -360,14 +362,17 @@ class LargeScreenShadeHeaderController @Inject constructor(
@@ -376,14 +378,17 @@ class LargeScreenShadeHeaderController @Inject constructor(
cutoutLeft = sbInsets.first
cutoutRight = sbInsets.second
val hasCornerCutout: Boolean = insetsProvider.currentRotationHasCornerCutout()
@ -133,7 +133,7 @@ index 9795434a6545..cc8e3f48131d 100644
header.paddingEnd
)
@@ -486,7 +491,6 @@ class LargeScreenShadeHeaderController @Inject constructor(
@@ -502,7 +507,6 @@ class LargeScreenShadeHeaderController @Inject constructor(
}
private fun updateResources() {

View File

@ -1,26 +0,0 @@
From a893877e865d6c39bf6f7976efe5618787a1a15f Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 17 Apr 2022 08:48:42 +0000
Subject: [PATCH 10/21] Replace NTP server
Change-Id: I938ab46026d841e7536d8fc02b0ef6b28ebb6ea1
---
core/res/res/values/config.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 8f81427cbe67..8bd2f7aaad07 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2416,7 +2416,7 @@
<bool name="config_actionMenuItemAllCaps">true</bool>
<!-- Remote server that can provide NTP responses. -->
- <string translatable="false" name="config_ntpServer">time.android.com</string>
+ <string translatable="false" name="config_ntpServer">cn.pool.ntp.org</string>
<!-- Normal polling frequency in milliseconds -->
<integer name="config_ntpPollingInterval">64800000</integer>
<!-- Try-again polling interval in milliseconds, in case the network request failed -->
--
2.34.1

View File

@ -1,7 +1,7 @@
From ce6bd2ce984f6647b673640dc4bbd07315fb128b Mon Sep 17 00:00:00 2001
From 29973bff7d5cad945ec8cb4b378d4d099b2ccf6e Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 31 May 2022 00:00:08 +0000
Subject: [PATCH 11/21] Revert "SystemUI: Add left padding for keyguard slices"
Subject: [PATCH 10/20] Revert "SystemUI: Add left padding for keyguard slices"
This reverts commit 4a7a4426944e28e70a3eca6a696ff6c7599fb896.
---

View File

@ -1,7 +1,7 @@
From 1476a09fe1f6d1facfeff4fe1f4bfba02f34a176 Mon Sep 17 00:00:00 2001
From 88e5979f1265f85901bf38ad7072b61a0ed1321b Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 5 Sep 2021 01:20:12 +0000
Subject: [PATCH 12/21] Revert "Update RAT icons to match Silk design"
Subject: [PATCH 11/20] Revert "Update RAT icons to match Silk design"
This reverts commit 084c13c8216f6a899cd3eda04fc1d7acff3d1248.
---

View File

@ -1,7 +1,7 @@
From 0e336e834bf43aec2c3d627140e6b6f9a5466580 Mon Sep 17 00:00:00 2001
From 9ca4c9ed59f2d710e2ed65d266c346f6c76bf06d Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Thu, 29 Sep 2022 11:27:57 +0000
Subject: [PATCH 13/21] Revert "Use the default top clock margin on h800
Subject: [PATCH 12/20] Revert "Use the default top clock margin on h800
devices"
This reverts commits 50ba380f4d8d1c2523e0f76295ca556038796bfd

View File

@ -1,7 +1,7 @@
From d4aeaae7ab4d7c2e51b86afd6fa12888a47be51a Mon Sep 17 00:00:00 2001
From b4f02e5a5d70915148a826fd5adbc80005c2d893 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 7 Oct 2020 14:00:35 +0000
Subject: [PATCH 14/21] UI: Always render windows into cutouts
Subject: [PATCH 13/20] UI: Always render windows into cutouts
Eliminates black/white letterboxing
Quick and dirty way to do the latter - wait for proper fix from Google

View File

@ -1,7 +1,7 @@
From 4565707ddbfac766a60fa90ed6c68e31badfbad3 Mon Sep 17 00:00:00 2001
From b780aa348b0807a89c393330d2727b5d69c59238 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 1 Sep 2021 14:10:50 +0000
Subject: [PATCH 15/21] UI: Kill rounded corners in notification scrim
Subject: [PATCH 14/20] UI: Kill rounded corners in notification scrim
Rounded corners in S is nicely implemented, but this is one occasion where it looks out of place

View File

@ -1,7 +1,7 @@
From c8eb0353820700a61178af90e221db5cc7ffb3e5 Mon Sep 17 00:00:00 2001
From 7e764a4f7f2314bbaf5d7271115be30baa46e893 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Mon, 26 Oct 2020 14:06:56 +0000
Subject: [PATCH 16/21] UI: Reconfigure power menu items
Subject: [PATCH 15/20] UI: Reconfigure power menu items
Change-Id: I32cca6e2c6bb64d891efee959127edf7c0802cbc
---
@ -9,7 +9,7 @@ Change-Id: I32cca6e2c6bb64d891efee959127edf7c0802cbc
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 8bd2f7aaad07..a2df7afe944c 100644
index 8f81427cbe67..349ff65ecde6 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -3252,13 +3252,10 @@

View File

@ -1,7 +1,7 @@
From 87c266fe66b62ac138f9c1dbbc5bc0339a67526e Mon Sep 17 00:00:00 2001
From dbbe5afc40f68420da0e808c89b34f284b09f8d9 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sat, 5 Mar 2022 01:43:37 +0000
Subject: [PATCH 17/21] UI: Reconfigure quick settings tiles
Subject: [PATCH 16/20] UI: Reconfigure quick settings tiles
Change-Id: I743f52ef3a95db0ca2c02ae973faa4629e41885d
---

View File

@ -1,7 +1,7 @@
From 15166b73a21dfcd204ed1d5f65934cee1d972be9 Mon Sep 17 00:00:00 2001
From 07b9d619fefc8b722dd154e0cf68249b3d9fffe2 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 29 Jun 2021 22:57:01 +0000
Subject: [PATCH 18/21] UI: Relax requirement for HINT_SUPPORTS_DARK_TEXT
Subject: [PATCH 17/20] UI: Relax requirement for HINT_SUPPORTS_DARK_TEXT
I decide what's good enough for a wallpaper!

View File

@ -1,7 +1,7 @@
From 0ee6fdb253b5568408387a8f1348d4daa790e8e5 Mon Sep 17 00:00:00 2001
From 6d5e98d6f14462e0921eee4b223dcce4daa47b73 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 19 Oct 2021 12:09:34 +0000
Subject: [PATCH 19/21] UI: Remove privacy dot
Subject: [PATCH 18/20] UI: Remove privacy dot
Change-Id: I5d2e2b3e36f027b4348a83030d4b4d3c4f0209d1
---

View File

@ -1,7 +1,7 @@
From 3829d2d835c4dee4861e4262424a0540bc57af26 Mon Sep 17 00:00:00 2001
From 31ed8c48f604dbab1f0097737886fb800929c101 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Wed, 22 Mar 2023 00:29:13 +0000
Subject: [PATCH 20/21] UI: Restore quick settings fonts to pre-T-QPR2
Subject: [PATCH 19/20] UI: Restore quick settings fonts to pre-T-QPR2
TODO: Large header clock looks better in Regular - perhaps figure out how to transition smoothly?
Change-Id: If2e57fee61b6bd4b6b7fedc7e3011164cd2cb56f

View File

@ -1,7 +1,7 @@
From 8eb4dba8b771a9f30db4cd58eb7509642568506b Mon Sep 17 00:00:00 2001
From be2c9c3bfaac6b3b9fc705ceb3799decc99d5a3d Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Fri, 30 Sep 2022 16:02:16 +0000
Subject: [PATCH 21/21] UI: Revert to HSL luminance for wallpaper dark hints
Subject: [PATCH 20/20] UI: Revert to HSL luminance for wallpaper dark hints
Y U no test for consistency, Google?

View File

@ -0,0 +1,78 @@
From 1a8eee6d2a1d79412902331b74283eec77414c6b Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sat, 19 Feb 2022 08:20:25 -0500
Subject: [PATCH 1/2] Add new mechanism to fake vendor props on a per-process
basis
This reads debug.phh.props.<process name>. If its value is "vendor",
then ro.product.device/ro.product.manufacturer is read from vendor
---
libc/system_properties/system_properties.cpp | 38 ++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
index 1cb15c3df..d6e7e3e68 100644
--- a/libc/system_properties/system_properties.cpp
+++ b/libc/system_properties/system_properties.cpp
@@ -35,6 +35,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#include <fcntl.h>
#include <new>
@@ -50,6 +51,32 @@
#define SERIAL_DIRTY(serial) ((serial)&1)
#define SERIAL_VALUE_LEN(serial) ((serial) >> 24)
+static char comm[128];
+static bool self_ok = false;
+static char comm_override[PROP_VALUE_MAX];
+
+static void read_self() {
+ //NB: Not atomic, but should be good enough, there is no possible corruption from concurrency
+ if(self_ok) return;
+ self_ok = true;
+
+ int fd = open("/proc/self/comm", O_RDONLY);
+ if(fd<0) return;
+ read(fd, comm, sizeof(comm)-1);
+ for(unsigned i=0; i<sizeof(comm); i++)
+ if(comm[i] == '\n')
+ comm[i] = 0;
+ close(fd);
+
+ //That's calling ourselves but that's fine because we already have self_ok = true
+ char propName[PROP_NAME_MAX];
+ memset(propName, 0, PROP_NAME_MAX);
+ strncpy(propName, "debug.phh.props.", PROP_NAME_MAX - 1);
+ strncat(propName, comm, PROP_NAME_MAX - 1);
+
+ __system_property_get(propName, comm_override);
+}
+
static bool is_dir(const char* pathname) {
struct stat info;
if (stat(pathname, &info) == -1) {
@@ -216,6 +243,17 @@ void SystemProperties::ReadCallback(const prop_info* pi,
}
int SystemProperties::Get(const char* name, char* value) {
+ read_self();
+ if(strcmp(comm_override, "vendor") == 0) {
+ if(strcmp(name, "ro.product.device") == 0) {
+ int r = Get("ro.product.vendor.device", value);
+ if(r>0) return r;
+ }
+ if(strcmp(name, "ro.product.manufacturer") == 0) {
+ int r = Get("ro.product.vendor.manufacturer", value);
+ if(r>0) return r;
+ }
+ }
const prop_info* pi = Find(name);
if (pi != nullptr) {
--
2.34.1

View File

@ -0,0 +1,145 @@
From ad25fd64270b2c3dc9fbce5e97c2eb75d63f015b Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 19 Jan 2023 16:44:01 -0500
Subject: [PATCH 2/2] Rework property overriding
- Support property read with callback in addition to previous
constant-size property_get
- Add another class of redirect "keymaster", to redirect to AOSP/GSI
props + SPL based on boot.img
---
libc/system_properties/system_properties.cpp | 77 +++++++++++++++-----
1 file changed, 58 insertions(+), 19 deletions(-)
diff --git a/libc/system_properties/system_properties.cpp b/libc/system_properties/system_properties.cpp
index d6e7e3e68..40ff48bad 100644
--- a/libc/system_properties/system_properties.cpp
+++ b/libc/system_properties/system_properties.cpp
@@ -35,6 +35,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#include <string.h>
#include <fcntl.h>
#include <new>
@@ -60,23 +61,70 @@ static void read_self() {
if(self_ok) return;
self_ok = true;
- int fd = open("/proc/self/comm", O_RDONLY);
+ char cmdline[128];
+ int fd = open("/proc/self/cmdline", O_RDONLY);
if(fd<0) return;
- read(fd, comm, sizeof(comm)-1);
- for(unsigned i=0; i<sizeof(comm); i++)
- if(comm[i] == '\n')
- comm[i] = 0;
+ read(fd, cmdline, sizeof(cmdline)-1);
+ for(unsigned i=0; i<sizeof(cmdline); i++)
+ if(cmdline[i] == '\n')
+ cmdline[i] = 0;
close(fd);
+ // Truncate to last /, we don't want `/` in the prop
+ const char *c = strrchr(cmdline, '/');
+ if (c != nullptr) {
+ c = c+1;
+ } else {
+ c = cmdline;
+ }
+ // Take only the last 16 bytes (prop names max is 32)
+ if(strlen(c) < 15) {
+ strcpy(comm, c);
+ } else {
+ strcpy(comm, c + strlen(c) - 15);
+ }
+
+
//That's calling ourselves but that's fine because we already have self_ok = true
char propName[PROP_NAME_MAX];
memset(propName, 0, PROP_NAME_MAX);
strncpy(propName, "debug.phh.props.", PROP_NAME_MAX - 1);
- strncat(propName, comm, PROP_NAME_MAX - 1);
+ strncat(propName, comm, PROP_NAME_MAX - strlen(propName) - 1);
+ //async_safe_format_log(ANDROID_LOG_WARN, "libc", "Reading debug prop %s", propName);
__system_property_get(propName, comm_override);
}
+static const char* redirectToProp(const char *name) {
+ read_self();
+ /*if(strstr(name, "ro.keymaster") != nullptr || strstr(name, "security_patch") != nullptr || strstr(name, "release") != nullptr) {
+ async_safe_format_log(ANDROID_LOG_WARN, "libc", "Process/comm %s/%s is reading %s", comm, comm_override, name);
+ }*/
+ if(strcmp(comm_override, "vendor") == 0) {
+ if(strcmp(name, "ro.product.device") == 0) {
+ return "ro.product.vendor.device";
+ }
+ if(strcmp(name, "ro.product.manufacturer") == 0) {
+ return "ro.product.vendor.manufacturer";
+ }
+ }
+ if(strcmp(comm_override, "keymaster") == 0) {
+ if(strcmp(name, "ro.product.model") == 0) {
+ return "ro.keymaster.mod";
+ }
+ if(strcmp(name, "ro.product.brand") == 0) {
+ return "ro.keymaster.brn";
+ }
+ if(strcmp(name, "ro.build.version.release") == 0) {
+ return "ro.keymaster.xxx.release";
+ }
+ if(strcmp(name, "ro.build.version.security_patch") == 0) {
+ return "ro.keymaster.xxx.security_patch";
+ }
+ }
+ return name;
+}
+
static bool is_dir(const char* pathname) {
struct stat info;
if (stat(pathname, &info) == -1) {
@@ -150,17 +198,19 @@ uint32_t SystemProperties::AreaSerial() {
}
const prop_info* SystemProperties::Find(const char* name) {
+ const char* newName = redirectToProp(name);
+
if (!initialized_) {
return nullptr;
}
- prop_area* pa = contexts_->GetPropAreaForName(name);
+ prop_area* pa = contexts_->GetPropAreaForName(newName);
if (!pa) {
async_safe_format_log(ANDROID_LOG_WARN, "libc", "Access denied finding property \"%s\"", name);
return nullptr;
}
- return pa->find(name);
+ return pa->find(newName);
}
static bool is_read_only(const char* name) {
@@ -243,17 +293,6 @@ void SystemProperties::ReadCallback(const prop_info* pi,
}
int SystemProperties::Get(const char* name, char* value) {
- read_self();
- if(strcmp(comm_override, "vendor") == 0) {
- if(strcmp(name, "ro.product.device") == 0) {
- int r = Get("ro.product.vendor.device", value);
- if(r>0) return r;
- }
- if(strcmp(name, "ro.product.manufacturer") == 0) {
- int r = Get("ro.product.vendor.manufacturer", value);
- if(r>0) return r;
- }
- }
const prop_info* pi = Find(name);
if (pi != nullptr) {
--
2.34.1