aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMister Oyster <oysterized@gmail.com>2017-12-23 16:08:07 +0100
committerMister Oyster <oysterized@gmail.com>2017-12-23 16:08:07 +0100
commitf8a374368b1060297fb0fd1aad95531d97d8505e (patch)
tree2a421594e75241be5ba2858f44fe30c8b9016fd4
parent3219a844496b787808a184cfa478e516b23b4ae0 (diff)
patches: add software gatekeeper patch
-rw-r--r--patches/system/core/0002-gatekeeperd-Add-use-software-gatekeeper-option.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/patches/system/core/0002-gatekeeperd-Add-use-software-gatekeeper-option.patch b/patches/system/core/0002-gatekeeperd-Add-use-software-gatekeeper-option.patch
new file mode 100644
index 0000000..76ed031
--- /dev/null
+++ b/patches/system/core/0002-gatekeeperd-Add-use-software-gatekeeper-option.patch
@@ -0,0 +1,46 @@
+From b5a73b765859c8bcafdbfac5a4d8306550db4286 Mon Sep 17 00:00:00 2001
+From: danielhk <daniel.p6800@gmail.com>
+Date: Fri, 22 Dec 2017 23:35:45 +0800
+Subject: [PATCH] gatekeeperd:Add use software gatekeeper option
+
+Add BOARD_USE_SOFT_GATEKEEPER flag to use software gatekeeper.
+---
+ gatekeeperd/Android.mk | 4 ++++
+ gatekeeperd/gatekeeperd.cpp | 5 ++++-
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/gatekeeperd/Android.mk b/gatekeeperd/Android.mk
+index 0dfd9d8a9..652c21d29 100644
+--- a/gatekeeperd/Android.mk
++++ b/gatekeeperd/Android.mk
+@@ -39,6 +39,10 @@ LOCAL_SHARED_LIBRARIES := \
+ libhwbinder \
+ android.hardware.gatekeeper@1.0 \
+
++ifeq ($(strip $(BOARD_USE_SOFT_GATEKEEPER)),true)
++LOCAL_CFLAGS += -DUSE_SOFT_GATEKEEPER
++endif
++
+ LOCAL_STATIC_LIBRARIES := libscrypt_static
+ LOCAL_C_INCLUDES := external/scrypt/lib/crypto
+ LOCAL_INIT_RC := gatekeeperd.rc
+diff --git a/gatekeeperd/gatekeeperd.cpp b/gatekeeperd/gatekeeperd.cpp
+index e6eb3bc25..85ca97259 100644
+--- a/gatekeeperd/gatekeeperd.cpp
++++ b/gatekeeperd/gatekeeperd.cpp
+@@ -56,8 +56,11 @@ static const String16 DUMP_PERMISSION("android.permission.DUMP");
+ class GateKeeperProxy : public BnGateKeeperService {
+ public:
+ GateKeeperProxy() {
++#ifdef USE_SOFT_GATEKEEPER
++ hw_device = nullptr;
++#else
+ hw_device = IGatekeeper::getService();
+-
++#endif
+ if (hw_device == nullptr) {
+ ALOGW("falling back to software GateKeeper");
+ soft_device.reset(new SoftGateKeeperDevice());
+--
+2.11.0
+