mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-23 07:29:07 -08:00
Monitor /data/system/packages.xml
Reinstalling system apps as data creates tons of issues. Calling pm path <pkg> is extremely expensive and doesn't work in post-fs-data. Parse through packages.xml to get APK path and UID at the same time. As a bonus, we don't need to traverse /data/app for packages anymore.
This commit is contained in:
@@ -236,3 +236,9 @@ void set_nice_name(const char *name) {
|
||||
strlcpy(argv0, name, name_len);
|
||||
prctl(PR_SET_NAME, name);
|
||||
}
|
||||
|
||||
bool ends_with(const std::string_view &s1, const std::string_view &s2) {
|
||||
unsigned l1 = s1.length();
|
||||
unsigned l2 = s2.length();
|
||||
return l1 < l2 ? false : s1.compare(l1 - l2, l2, s2) == 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user