[core] Fix log

This commit is contained in:
LoveSy 2021-02-17 19:20:04 +08:00 committed by tehcneko
parent 3ecb615d6e
commit 687d4d64c7
6 changed files with 11 additions and 50 deletions

View File

@ -16,33 +16,6 @@ public class LSPosedManagerServiceClient {
private static IBinder binder = null;
private static ILSPManagerService service = null;
/*
public static void testBinder() {
if (binder == null) {
}
if (service == null && binder != null) {
service = ILSPManagerService.Stub.asInterface(binder);
}
if (service == null) {
return;
}
int ver = -1;
try {
ver = service.getVersion();
} catch (RemoteException e) {
e.printStackTrace();
}
Log.i(App.TAG, "Got version " + ver);
List<PackageInfo> ps = null;
try {
ps = service.getInstalledPackagesFromAllUsers(0).getList();
} catch (RemoteException e) {
e.printStackTrace();
}
Log.i(App.TAG, String.valueOf(ps));
}
*/
private static void ensureService() throws NullPointerException {
if (service == null) {
if (binder != null) {

View File

@ -4,8 +4,6 @@ import android.os.IBinder;
import android.os.RemoteException;
import java.io.File;
import java.util.Collections;
import java.util.List;
import io.github.lsposed.lspd.service.ILSPApplicationService;
import io.github.lsposed.lspd.util.Utils;

View File

@ -57,7 +57,7 @@ public class ConfigManager {
final private File logPath = new File(basePath, "log");
final private File modulesLogPath = new File(logPath, "modules.log");
final private File verboseLogPath = new File(logPath, "verbose.log");
final private File verboseLogPath = new File(logPath, "all.log");
final FileObserver configObserver = new FileObserver(configPath) {
@Override

View File

@ -38,8 +38,8 @@ public class PackageService {
ArrayList<PackageInfo> res = new ArrayList<>();
IPackageManager pm = getPackageManager();
if (pm == null) return new ParceledListSlice<>(res);
for (int uid : UserService.getUsers()) {
res.addAll(pm.getInstalledPackages(flags, uid).getList());
for (int userId : UserService.getUsers()) {
res.addAll(pm.getInstalledPackages(flags, userId).getList());
}
return new ParceledListSlice<>(res);
}

View File

@ -241,8 +241,8 @@ else
abortC "${LANG_UTIL_ERR_VARIANT_UNSUPPORT} ${VARIANT}"
fi
if [[ ! -e /data/misc/$MISC_PATH/disable_verbose_log ]]; then
echo "1" > /data/misc/$MISC_PATH/disable_verbose_log
if [[ ! -e /data/adb/lspd/config/verbose_log ]]; then
echo "0" > /data/adb/lspd/config/verbose_log
fi

View File

@ -65,18 +65,12 @@ livePatch() {
MISC_PATH=$(cat /data/adb/lspd/misc_path)
BASE_PATH="/data/misc/$MISC_PATH"
LOG_PATH="${BASE_PATH}/log"
DISABLE_VERBOSE_LOG_FILE="${BASE_PATH}/disable_verbose_log"
LOG_VERBOSE=true
OLD_PATH=${PATH}
PATH=${PATH#*:}
PATH_INFO=$(ls -ldZ "${BASE_PATH}")
PATH=${OLD_PATH}
PATH_OWNER=$(echo "${PATH_INFO}" | awk -F " " '{print $3":"$4}')
PATH_CONTEXT=$(echo "${PATH_INFO}" | awk -F " " '{print $5}')
LOG_PATH="/data/adb/lspd/log"
ENABLE_VERBOSE_LOG_FILE="/data/adb/lspd/config/verbose_log"
LOG_VERBOSE=false
if [ "$(cat "${DISABLE_VERBOSE_LOG_FILE}")" = "1" ]; then
LOG_VERBOSE=false
if [ "$(cat "${ENABLE_VERBOSE_LOG_FILE}")" = "1" ]; then
LOG_VERBOSE=true
fi
# If logcat client is kicked out by klogd server, we'll restart it.
@ -149,9 +143,7 @@ if [[ -f "/data/adb/riru/modules/lspd.prop" ]]; then
fi
chcon -R u:object_r:system_file:s0 "${MODDIR}"
chcon -R ${PATH_CONTEXT} "${LOG_PATH}"
chown -R ${PATH_OWNER} "${LOG_PATH}"
chmod -R 666 "${LOG_PATH}"
chcon -R u:object_r:system_file:s0 "/data/adb/lspd"
if [[ ! -z "${MISC_PATH}" ]]; then
mkdir -p "${BASE_PATH}/cache"
@ -161,10 +153,8 @@ if [[ ! -z "${MISC_PATH}" ]]; then
rm -rf ${LOG_PATH}.old
mv ${LOG_PATH} ${LOG_PATH}.old
mkdir -p ${LOG_PATH}
chmod 771 ${LOG_PATH}
print_log_head "${LOG_PATH}/modules.log"
# start_verbose_log_catcher
start_log_catcher all "LSPosed:V XSharedPreferences:V LSPosed-Bridge:V LSPosedManager:V *:F" true ${LOG_VERBOSE}
echo 'starting service'
fi
rm -f /data/adb/lspd/new_install