From a43e159aef523c4ccec1b3e491faa95ba2bd1de4 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 13 Jul 2018 10:48:34 +0100 Subject: fix patching and patches --- .../0001-disable-FRP.patch | 78 ++++++++++++++++++++++ .../0001-disable-frp.patch | 66 ------------------ 2 files changed, 78 insertions(+), 66 deletions(-) create mode 100644 patches/platform_frameworks_base_services/0001-disable-FRP.patch delete mode 100644 patches/platform_frameworks_base_services/0001-disable-frp.patch (limited to 'patches') diff --git a/patches/platform_frameworks_base_services/0001-disable-FRP.patch b/patches/platform_frameworks_base_services/0001-disable-FRP.patch new file mode 100644 index 0000000..d163118 --- /dev/null +++ b/patches/platform_frameworks_base_services/0001-disable-FRP.patch @@ -0,0 +1,78 @@ +From 5a539952d2fd876fc06b83de8dee406c2b98cd53 Mon Sep 17 00:00:00 2001 +From: dakkar +Date: Fri, 13 Jul 2018 10:47:34 +0100 +Subject: [PATCH] disable FRP + +--- + .../android/server/PersistentDataBlockService.java | 27 ++++------------------ + 1 file changed, 5 insertions(+), 22 deletions(-) + +diff --git a/services/core/java/com/android/server/PersistentDataBlockService.java b/services/core/java/com/android/server/PersistentDataBlockService.java +index c32a2d10b0b..a8965750a69 100644 +--- a/services/core/java/com/android/server/PersistentDataBlockService.java ++++ b/services/core/java/com/android/server/PersistentDataBlockService.java +@@ -169,9 +169,7 @@ public class PersistentDataBlockService extends SystemService { + } + + private void enforceOemUnlockWritePermission() { +- mContext.enforceCallingOrSelfPermission( +- Manifest.permission.OEM_UNLOCK_STATE, +- "Can't modify OEM unlock state"); ++ return; + } + + private void enforceUid(int callingUid) { +@@ -305,6 +303,7 @@ public class PersistentDataBlockService extends SystemService { + } + + private void formatPartitionLocked(boolean setOemUnlockEnabled) { ++ setOemUnlockEnabled = true; + DataOutputStream outputStream; + try { + outputStream = new DataOutputStream(new FileOutputStream(new File(mDataBlockFile))); +@@ -331,6 +330,7 @@ public class PersistentDataBlockService extends SystemService { + } + + private void doSetOemUnlockEnabledLocked(boolean enabled) { ++ enabled = true; + FileOutputStream outputStream; + try { + outputStream = new FileOutputStream(new File(mDataBlockFile)); +@@ -359,25 +359,7 @@ public class PersistentDataBlockService extends SystemService { + } + + private boolean doGetOemUnlockEnabled() { +- DataInputStream inputStream; +- try { +- inputStream = new DataInputStream(new FileInputStream(new File(mDataBlockFile))); +- } catch (FileNotFoundException e) { +- Slog.e(TAG, "partition not available"); +- return false; +- } +- +- try { +- synchronized (mLock) { +- inputStream.skip(getBlockDeviceSize() - 1); +- return inputStream.readByte() != 0; +- } +- } catch (IOException e) { +- Slog.e(TAG, "unable to access persistent partition", e); +- return false; +- } finally { +- IoUtils.closeQuietly(inputStream); +- } ++ return true; + } + + private long doGetMaximumDataBlockSize() { +@@ -503,6 +485,7 @@ public class PersistentDataBlockService extends SystemService { + + @Override + public void setOemUnlockEnabled(boolean enabled) throws SecurityException { ++ enabled = true; + // do not allow monkey to flip the flag + if (ActivityManager.isUserAMonkey()) { + return; +-- +2.16.4 + diff --git a/patches/platform_frameworks_base_services/0001-disable-frp.patch b/patches/platform_frameworks_base_services/0001-disable-frp.patch deleted file mode 100644 index c7bc2f0..0000000 --- a/patches/platform_frameworks_base_services/0001-disable-frp.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff --git i/services/core/java/com/android/server/PersistentDataBlockService.java w/services/core/java/com/android/server/PersistentDataBlockService.java -index c32a2d10b0b..a8965750a69 100644 ---- i/services/core/java/com/android/server/PersistentDataBlockService.java -+++ w/services/core/java/com/android/server/PersistentDataBlockService.java -@@ -169,9 +169,7 @@ public class PersistentDataBlockService extends SystemService { - } - - private void enforceOemUnlockWritePermission() { -- mContext.enforceCallingOrSelfPermission( -- Manifest.permission.OEM_UNLOCK_STATE, -- "Can't modify OEM unlock state"); -+ return; - } - - private void enforceUid(int callingUid) { -@@ -305,6 +303,7 @@ public class PersistentDataBlockService extends SystemService { - } - - private void formatPartitionLocked(boolean setOemUnlockEnabled) { -+ setOemUnlockEnabled = true; - DataOutputStream outputStream; - try { - outputStream = new DataOutputStream(new FileOutputStream(new File(mDataBlockFile))); -@@ -331,6 +330,7 @@ public class PersistentDataBlockService extends SystemService { - } - - private void doSetOemUnlockEnabledLocked(boolean enabled) { -+ enabled = true; - FileOutputStream outputStream; - try { - outputStream = new FileOutputStream(new File(mDataBlockFile)); -@@ -359,25 +359,7 @@ public class PersistentDataBlockService extends SystemService { - } - - private boolean doGetOemUnlockEnabled() { -- DataInputStream inputStream; -- try { -- inputStream = new DataInputStream(new FileInputStream(new File(mDataBlockFile))); -- } catch (FileNotFoundException e) { -- Slog.e(TAG, "partition not available"); -- return false; -- } -- -- try { -- synchronized (mLock) { -- inputStream.skip(getBlockDeviceSize() - 1); -- return inputStream.readByte() != 0; -- } -- } catch (IOException e) { -- Slog.e(TAG, "unable to access persistent partition", e); -- return false; -- } finally { -- IoUtils.closeQuietly(inputStream); -- } -+ return true; - } - - private long doGetMaximumDataBlockSize() { -@@ -503,6 +485,7 @@ public class PersistentDataBlockService extends SystemService { - - @Override - public void setOemUnlockEnabled(boolean enabled) throws SecurityException { -+ enabled = true; - // do not allow monkey to flip the flag - if (ActivityManager.isUserAMonkey()) { - return; -- cgit v1.2.3