For normal dex files, location and base location coincide. If a dex file is part of a multidex archive, the base location is the name of the originating jar/apk, stripped of any internal classes*.dex path.
| 78 | // archive, the base location is the name of the originating jar/apk, stripped of any internal |
| 79 | // classes*.dex path. |
| 80 | static std::string GetBaseLocation(const char* location) { |
| 81 | const char* pos = strrchr(location, kMultiDexSeparator); |
| 82 | return (pos == nullptr) ? location : std::string(location, pos - location); |
| 83 | } |
| 84 | |
| 85 | static std::string GetBaseLocation(const std::string& location) { |
| 86 | return GetBaseLocation(location.c_str()); |