32 Commits

Author SHA1 Message Date
Danny Lin cdfa4d3587 module: Bump version to v2.0.0 2021-01-26 14:16:32 -08:00
Danny Lin 6e35ac2b6c Shim the keystore service instead of replacing it
This method is more portable, does not require a different executable
for each Android version, and avoids breaking ROMs with heavy keystore
customizations. It works by injecting a shared library into the keystore
service and wrapping the Binder transaction handler in the generated
AIDL interface.

Because the actual attestKey implementation is statically linked into
the keystore service executable, we can't hijack it directly without
messy and error-prone code patching. Instead, we check each Binder
transaction handled by the AIDL stub and hijack transactions with the
TRANSACTION_attestKey code.

In order to keep key attestation working for apps, we only block Google
Play Services by checking the command line of the calling process
through Binder. This is not infallible and can be spoofed, but it's much
easier to do in C++ than looking up the calling UID's package name
through PackageManagerService. There are no negative security
implications as the only difference is a denied operation.

We can't set LD_PRELOAD for the keystore service because Magisk modules
start too late to modify its init.rc, so we inject the shim library as a
dependency instead using patchelf and build it with the DF_1_GLOBAL ELF
flag to make the dynamic linker prioritize it in symbol resolution.

TRANSACTION_attestKey values and AIDL stub names by Android version:
Android 10 - 11     (SDK 29-30): TX# 28, android::security::keystore::BnKeystoreService
Android 9           (SDK 28   ): TX# 35, android::security::BnKeystoreService
Android 7.0 - 8.1.0 (SDK 24-27): TX# 36, android::BnKeystoreService

Fixes #3, #6, #7, #8, #10, and #12.
2021-01-26 14:16:32 -08:00
Danny Lin 14e9e97d48 module: Bump version to v1.1.1 v1.1.1 2021-01-16 01:19:41 -08:00
Danny Lin 860ade6ff3 readme: Document removal of security patch fixup 2021-01-16 01:18:29 -08:00
Danny Lin 21d4d1d863 Remove security patch fixup script
This is causing more issues than it fixes.

Fixes #1.
2021-01-16 01:18:23 -08:00
Danny Lin e82c3d0674 customize: Validate CPU architecture before installing 2021-01-14 00:11:37 -08:00
Danny Lin 3a110a895e Makefile: Ignore all nested patches 2021-01-14 00:09:19 -08:00
Danny Lin 7df5188942 post-fs-data: Ignore empty vendor security patch levels 2021-01-14 00:05:36 -08:00
Danny Lin 7fe2c90113 readme: Update from XDA post 2021-01-13 23:55:41 -08:00
Danny Lin 8ed1f119b5 readme: Use en- and em-dashes where appropriate 2021-01-13 23:29:40 -08:00
Danny Lin e02636833b readme: Add link to patch files 2021-01-13 20:30:29 -08:00
Danny Lin 9e80da9fe1 Add all ROM patches 2021-01-13 20:27:20 -08:00
Danny Lin d912f83c2f github: Add funding links 2021-01-13 20:27:15 -08:00
Danny Lin c4db9bb281 Bump version to v1.1.0 v1.1.0 2021-01-13 19:54:10 -08:00
Danny Lin ff67d50b38 patches: Remove frameworks/base patch
This will cause trouble on Windows due to case-insensitive filesystems.
2021-01-13 19:54:10 -08:00
Danny Lin 502d10f8fe Makefile: Include license in zip 2021-01-13 19:54:10 -08:00
Danny Lin da2a7f3bd7 readme: Document prebuilt executable sources 2021-01-13 19:54:10 -08:00
Danny Lin 279c1a918b Add Android 11 patch files 2021-01-13 19:29:04 -08:00
Danny Lin 4ba7ac5da3 Fix mismatching vendor and system security patch levels 2021-01-13 19:29:04 -08:00
Danny Lin e240121e83 customize: Remove unused SDKs after installation 2021-01-13 19:29:03 -08:00
Danny Lin 357517a2e7 readme: Clarify some things 2021-01-13 19:29:03 -08:00
Danny Lin eb32fd3eb1 Document new Android version support 2021-01-13 18:21:58 -08:00
Danny Lin 73cce59b62 Add support for Android 8.0, 8.1, and 9 2021-01-13 18:21:58 -08:00
Danny Lin 18b341e056 Support any Android version based on SDK variant availability 2021-01-13 18:21:57 -08:00
Danny Lin 1157bb969f Add support for Android 10 2021-01-13 18:21:57 -08:00
Danny Lin 37bd89802b Switch to MIT License with AOSP Apache 2.0 notice
I prefer the more permissive MIT license for most of my projects, and
adding the Apache 2.0 license notice from AOSP makes it compliant.
2021-01-13 18:21:06 -08:00
Danny Lin 097f7adfa8 Override basic bootloader unlock props v1.0.2 2021-01-13 03:28:45 -08:00
Danny Lin 3f592ddd68 Rebuild executables with generic ARMv8-A targrt
Maximize compatibility with older CPUs.
v1.0.1
2021-01-13 03:22:54 -08:00
Danny Lin 3162c243d1 readme: Fix ROM commit link 2021-01-13 02:15:55 -08:00
Danny Lin 7a5bba6f99 readme: Add link to ROM commit v1.0.0 2021-01-13 02:08:55 -08:00
Danny Lin 5431feb71b Import module 2021-01-13 02:02:44 -08:00
Danny Lin 41bb921045 Initial commit 2021-01-13 01:57:55 -08:00