repack: move sbin to /system ramdisk and update repacking
for android-10

This will support updating the ramdisk to a different
compression format and co-exist with magisk.

We are also cleaning up and removing non android-10
api makefile actions.

We are also moving twrp repacking to its own class. We
check the new ramdisk format and if it's different
we have magisk compress using the new ramdisk format.

Change-Id: I770030aae7797e75817178b2f0fccd9f39dc23af
diff --git a/crypto/ext4crypt/Android.mk b/crypto/ext4crypt/Android.mk
index 955bd3b..8b1372b 100755
--- a/crypto/ext4crypt/Android.mk
+++ b/crypto/ext4crypt/Android.mk
@@ -75,10 +75,9 @@
 LOCAL_MODULE := twrpfbe
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
-LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
+LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/
 LOCAL_SRC_FILES := main.cpp
 LOCAL_SHARED_LIBRARIES := libe4crypt
-#LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
 
 include $(BUILD_EXECUTABLE)
 
@@ -86,10 +85,10 @@
 LOCAL_MODULE := e4policyget
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
-LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
+LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/
 LOCAL_SRC_FILES := e4policyget.cpp
 LOCAL_SHARED_LIBRARIES := libe4crypt
-LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
+LOCAL_LDFLAGS += -Wl,-dynamic-linker,/system/bin/linker64
 
 include $(BUILD_EXECUTABLE)
 
@@ -97,7 +96,7 @@
 LOCAL_MODULE := keystore_auth
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
-LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
+LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/
 LOCAL_SRC_FILES := keystore_auth.cpp
 LOCAL_SHARED_LIBRARIES := libc libkeystore_binder libutils libbinder liblog
 ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28; echo $$?),0)
@@ -105,7 +104,7 @@
     LOCAL_CFLAGS += -DUSE_SECURITY_NAMESPACE
     LOCAL_SHARED_LIBRARIES += libkeystore_aidl
 endif
-LOCAL_LDFLAGS += -Wl,-dynamic-linker,/sbin/linker64
+LOCAL_LDFLAGS += -Wl,-dynamic-linker,/system/bin/linker64
 
 include $(BUILD_EXECUTABLE)
 
diff --git a/crypto/ext4crypt/Decrypt.cpp b/crypto/ext4crypt/Decrypt.cpp
index dcd390f..85d14ea 100755
--- a/crypto/ext4crypt/Decrypt.cpp
+++ b/crypto/ext4crypt/Decrypt.cpp
@@ -659,7 +659,7 @@
 			if (auth_wait_count == 0 || access("/auth_error", F_OK) == 0) {
 				printf("error during keymaster_auth service\n");
 				/* If you are getting this error, make sure that you have the keymaster_auth service defined in your init scripts, preferrably in init.recovery.{ro.hardware}.rc
-				 * service keystore_auth /sbin/keystore_auth
+				 * service keystore_auth /system/bin/keystore_auth
 				 *     disabled
 				 *     oneshot
 				 *     user system
@@ -804,7 +804,7 @@
 			if (auth_wait_count == 0 || access("/auth_error", F_OK) == 0) {
 				printf("error during keymaster_auth service\n");
 				/* If you are getting this error, make sure that you have the keymaster_auth service defined in your init scripts, preferrably in init.recovery.{ro.hardware}.rc
-				 * service keystore_auth /sbin/keystore_auth
+				 * service keystore_auth /system/bin/keystore_auth
 				 *     disabled
 				 *     oneshot
 				 *     user system