From 51179e2339edce30927d94b033118319be7b19f3 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 13 Jul 2018 09:56:16 +0100 Subject: first attempt --- .../0001-disable-frp.patch | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create 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..c7bc2f0 --- /dev/null +++ b/patches/platform_frameworks_base_services/0001-disable-frp.patch @@ -0,0 +1,66 @@ +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