diff --git a/twrpApex.cpp b/twrpApex.cpp index ca6cff426..22da17a91 100755 --- a/twrpApex.cpp +++ b/twrpApex.cpp @@ -169,7 +169,10 @@ bool twrpApex::loadApexImage(std::string fileToMount, size_t loop_device_number) close(loop_fd); std::string bind_mount(APEX_BASE); - bind_mount = bind_mount + basename(fileToMount.c_str()); + std::string apex_cleaned_mount = fileToMount; + apex_cleaned_mount = std::regex_replace(apex_cleaned_mount, std::regex("\\.apex"), ""); + + bind_mount = bind_mount + basename(apex_cleaned_mount.c_str()); int ret = mkdir(bind_mount.c_str(), 0666); if (ret != 0) { diff --git a/twrpApex.hpp b/twrpApex.hpp index d03df106e..b3809dd98 100755 --- a/twrpApex.hpp +++ b/twrpApex.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include