mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-11-06 04:42:12 +00:00
Auto reinstall system apps on hide list
Since we are parsing through /data/app/ to find target APKs for monitoring, system apps will not be covered in this case. Automatically reinstall system apps as if they received an update and refresh the monitor target after it's done. As a bonus, use RAII idioms for locking pthread_mutex_t.
This commit is contained in:
@@ -150,6 +150,24 @@ std::vector<std::string> file_to_vector(const char *filename);
|
||||
|
||||
// misc.cpp
|
||||
|
||||
class MutexGuard {
|
||||
public:
|
||||
explicit MutexGuard(pthread_mutex_t &m): mutex(&m) {
|
||||
pthread_mutex_lock(mutex);
|
||||
}
|
||||
|
||||
explicit MutexGuard(pthread_mutex_t *m): mutex(m) {
|
||||
pthread_mutex_lock(mutex);
|
||||
}
|
||||
|
||||
~MutexGuard() {
|
||||
pthread_mutex_unlock(mutex);
|
||||
}
|
||||
|
||||
private:
|
||||
pthread_mutex_t *mutex;
|
||||
};
|
||||
|
||||
int new_daemon_thread(void *(*start_routine) (void *), void *arg = nullptr,
|
||||
const pthread_attr_t *attr = nullptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user