system/core
Revision | 444bcc573987248ec49fddfd624f05cdbf998de6 (tree) |
---|---|
Zeit | 2018-09-11 12:50:10 |
Autor | Ethan Yonker <dees_troy@team...> |
Commiter | Sam Mortimer |
init: add install_keyring for TWRP FBE decrypt
Change-Id: Id7652763ec79bb8679aeb85793f1a748e0d67ff9
@@ -643,6 +643,16 @@ static int queue_fs_event(int code) { | ||
643 | 643 | return ret; |
644 | 644 | } |
645 | 645 | |
646 | +static int do_install_keyring(const std::vector<std::string>& args) { | |
647 | + if (e4crypt_install_keyring()) { | |
648 | + ERROR("failed to install keyring\n"); | |
649 | + return -1; | |
650 | + } | |
651 | + property_set("ro.crypto.state", "encrypted"); | |
652 | + property_set("ro.crypto.type", "file"); | |
653 | + return 0; | |
654 | +} | |
655 | + | |
646 | 656 | /* mount_all <fstab> [ <path> ]* [--<options>]* |
647 | 657 | * |
648 | 658 | * This function might request a reboot, in which case it will |
@@ -1185,6 +1195,7 @@ BuiltinFunctionMap::Map& BuiltinFunctionMap::map() const { | ||
1185 | 1195 | {"ifup", {1, 1, do_ifup}}, |
1186 | 1196 | {"init_user0", {0, 0, do_init_user0}}, |
1187 | 1197 | {"insmod", {1, kMax, do_insmod}}, |
1198 | + {"install_keyring", {0, 0, do_install_keyring}}, | |
1188 | 1199 | {"installkey", {1, 1, do_installkey}}, |
1189 | 1200 | {"load_persist_props", {0, 0, do_load_persist_props}}, |
1190 | 1201 | {"load_system_props", {0, 0, do_load_system_props}}, |