[core] Fix log
This commit is contained in:
parent
3ecb615d6e
commit
687d4d64c7
|
|
@ -16,33 +16,6 @@ public class LSPosedManagerServiceClient {
|
||||||
private static IBinder binder = null;
|
private static IBinder binder = null;
|
||||||
private static ILSPManagerService service = 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 {
|
private static void ensureService() throws NullPointerException {
|
||||||
if (service == null) {
|
if (service == null) {
|
||||||
if (binder != null) {
|
if (binder != null) {
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@ import android.os.IBinder;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import io.github.lsposed.lspd.service.ILSPApplicationService;
|
import io.github.lsposed.lspd.service.ILSPApplicationService;
|
||||||
import io.github.lsposed.lspd.util.Utils;
|
import io.github.lsposed.lspd.util.Utils;
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ public class ConfigManager {
|
||||||
|
|
||||||
final private File logPath = new File(basePath, "log");
|
final private File logPath = new File(basePath, "log");
|
||||||
final private File modulesLogPath = new File(logPath, "modules.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) {
|
final FileObserver configObserver = new FileObserver(configPath) {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,8 @@ public class PackageService {
|
||||||
ArrayList<PackageInfo> res = new ArrayList<>();
|
ArrayList<PackageInfo> res = new ArrayList<>();
|
||||||
IPackageManager pm = getPackageManager();
|
IPackageManager pm = getPackageManager();
|
||||||
if (pm == null) return new ParceledListSlice<>(res);
|
if (pm == null) return new ParceledListSlice<>(res);
|
||||||
for (int uid : UserService.getUsers()) {
|
for (int userId : UserService.getUsers()) {
|
||||||
res.addAll(pm.getInstalledPackages(flags, uid).getList());
|
res.addAll(pm.getInstalledPackages(flags, userId).getList());
|
||||||
}
|
}
|
||||||
return new ParceledListSlice<>(res);
|
return new ParceledListSlice<>(res);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -241,8 +241,8 @@ else
|
||||||
abortC "${LANG_UTIL_ERR_VARIANT_UNSUPPORT} ${VARIANT}"
|
abortC "${LANG_UTIL_ERR_VARIANT_UNSUPPORT} ${VARIANT}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -e /data/misc/$MISC_PATH/disable_verbose_log ]]; then
|
if [[ ! -e /data/adb/lspd/config/verbose_log ]]; then
|
||||||
echo "1" > /data/misc/$MISC_PATH/disable_verbose_log
|
echo "0" > /data/adb/lspd/config/verbose_log
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,18 +65,12 @@ livePatch() {
|
||||||
MISC_PATH=$(cat /data/adb/lspd/misc_path)
|
MISC_PATH=$(cat /data/adb/lspd/misc_path)
|
||||||
BASE_PATH="/data/misc/$MISC_PATH"
|
BASE_PATH="/data/misc/$MISC_PATH"
|
||||||
|
|
||||||
LOG_PATH="${BASE_PATH}/log"
|
LOG_PATH="/data/adb/lspd/log"
|
||||||
DISABLE_VERBOSE_LOG_FILE="${BASE_PATH}/disable_verbose_log"
|
ENABLE_VERBOSE_LOG_FILE="/data/adb/lspd/config/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}')
|
|
||||||
|
|
||||||
if [ "$(cat "${DISABLE_VERBOSE_LOG_FILE}")" = "1" ]; then
|
|
||||||
LOG_VERBOSE=false
|
LOG_VERBOSE=false
|
||||||
|
|
||||||
|
if [ "$(cat "${ENABLE_VERBOSE_LOG_FILE}")" = "1" ]; then
|
||||||
|
LOG_VERBOSE=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If logcat client is kicked out by klogd server, we'll restart it.
|
# 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
|
fi
|
||||||
|
|
||||||
chcon -R u:object_r:system_file:s0 "${MODDIR}"
|
chcon -R u:object_r:system_file:s0 "${MODDIR}"
|
||||||
chcon -R ${PATH_CONTEXT} "${LOG_PATH}"
|
chcon -R u:object_r:system_file:s0 "/data/adb/lspd"
|
||||||
chown -R ${PATH_OWNER} "${LOG_PATH}"
|
|
||||||
chmod -R 666 "${LOG_PATH}"
|
|
||||||
|
|
||||||
if [[ ! -z "${MISC_PATH}" ]]; then
|
if [[ ! -z "${MISC_PATH}" ]]; then
|
||||||
mkdir -p "${BASE_PATH}/cache"
|
mkdir -p "${BASE_PATH}/cache"
|
||||||
|
|
@ -161,10 +153,8 @@ if [[ ! -z "${MISC_PATH}" ]]; then
|
||||||
rm -rf ${LOG_PATH}.old
|
rm -rf ${LOG_PATH}.old
|
||||||
mv ${LOG_PATH} ${LOG_PATH}.old
|
mv ${LOG_PATH} ${LOG_PATH}.old
|
||||||
mkdir -p ${LOG_PATH}
|
mkdir -p ${LOG_PATH}
|
||||||
chmod 771 ${LOG_PATH}
|
|
||||||
print_log_head "${LOG_PATH}/modules.log"
|
print_log_head "${LOG_PATH}/modules.log"
|
||||||
# start_verbose_log_catcher
|
# start_verbose_log_catcher
|
||||||
start_log_catcher all "LSPosed:V XSharedPreferences:V LSPosed-Bridge:V LSPosedManager:V *:F" true ${LOG_VERBOSE}
|
start_log_catcher all "LSPosed:V XSharedPreferences:V LSPosed-Bridge:V LSPosedManager:V *:F" true ${LOG_VERBOSE}
|
||||||
echo 'starting service'
|
|
||||||
fi
|
fi
|
||||||
rm -f /data/adb/lspd/new_install
|
rm -f /data/adb/lspd/new_install
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue