summaryrefslogtreecommitdiffstats
path: root/partition.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2018-08-30 22:16:27 +0200
committerEthan Yonker <dees_troy@teamw.in>2018-08-31 17:37:08 +0200
commite9afc3de0fe1df795cc2f8cfab489177252812be (patch)
tree867698dc2670b97f821726b71043a232ad54c6ce /partition.cpp
parentMerge AOSP android-9.0.0_r3 (diff)
downloadandroid_bootable_recovery-e9afc3de0fe1df795cc2f8cfab489177252812be.tar
android_bootable_recovery-e9afc3de0fe1df795cc2f8cfab489177252812be.tar.gz
android_bootable_recovery-e9afc3de0fe1df795cc2f8cfab489177252812be.tar.bz2
android_bootable_recovery-e9afc3de0fe1df795cc2f8cfab489177252812be.tar.lz
android_bootable_recovery-e9afc3de0fe1df795cc2f8cfab489177252812be.tar.xz
android_bootable_recovery-e9afc3de0fe1df795cc2f8cfab489177252812be.tar.zst
android_bootable_recovery-e9afc3de0fe1df795cc2f8cfab489177252812be.zip
Diffstat (limited to 'partition.cpp')
-rw-r--r--partition.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/partition.cpp b/partition.cpp
index 0272708cd..dfa57fafc 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -130,6 +130,7 @@ enum TW_FSTAB_FLAGS {
TWFLAG_CANENCRYPTBACKUP,
TWFLAG_DISPLAY,
TWFLAG_ENCRYPTABLE,
+ TWFLAG_FILEENCRYPTION,
TWFLAG_FLASHIMG,
TWFLAG_FORCEENCRYPT,
TWFLAG_FSFLAGS,
@@ -172,6 +173,7 @@ const struct flag_list tw_flags[] = {
{ "defaults", TWFLAG_DEFAULTS },
{ "display=", TWFLAG_DISPLAY },
{ "encryptable=", TWFLAG_ENCRYPTABLE },
+ { "fileencryption=", TWFLAG_FILEENCRYPTION },
{ "flashimg", TWFLAG_FLASHIMG },
{ "forceencrypt=", TWFLAG_FORCEENCRYPT },
{ "fsflags=", TWFLAG_FSFLAGS },
@@ -822,6 +824,24 @@ void TWPartition::Apply_TW_Flag(const unsigned flag, const char* str, const bool
case TWFLAG_FORCEENCRYPT:
Crypto_Key_Location = str;
break;
+ case TWFLAG_FILEENCRYPTION:
+ // This flag isn't used by TWRP but is needed in 9.0 FBE decrypt
+ // fileencryption=ice:aes-256-heh
+ {
+ std::string FBE = str;
+ std::string FBE_contents, FBE_filenames;
+ size_t colon_loc = FBE.find(":");
+ if (colon_loc == std::string::npos) {
+ LOGINFO("Invalid fileencryption fstab flag: '%s'\n", str);
+ break;
+ }
+ FBE_contents = FBE.substr(0, colon_loc);
+ FBE_filenames = FBE.substr(colon_loc + 1);
+ property_set("fbe.contents", FBE_contents.c_str());
+ property_set("fbe.filenames", FBE_filenames.c_str());
+ LOGINFO("FBE contents '%s', filenames '%s'\n", FBE_contents.c_str(), FBE_filenames.c_str());
+ }
+ break;
case TWFLAG_FLASHIMG:
Can_Flash_Img = val;
break;