[core] Don't override system properties (#972)

This commit is contained in:
vvb2060 2021-08-21 20:58:42 +08:00 committed by GitHub
parent e72bd46705
commit 3600e53865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -6,15 +6,15 @@ debug="false"
if [ -r $tmpLspdDex ]; then
java_options="-Djava.class.path=$tmpLspdDex"
java_options="$java_options -Djava.library.path=/data/local/tmp"
java_options="$java_options -Dlsp.library.path=/data/local/tmp"
debug="true"
elif [ -d "$dir/system" ]; then
java_options="-Djava.class.path=$dir/system/framework/lspd.dex"
java_options="$java_options -Djava.library.path=$dir"
java_options="$java_options -Dlsp.library.path=$dir"
debug="true"
else
java_options="-Djava.class.path=$dir/framework/lspd.dex"
java_options="$java_options -Djava.library.path=$dir"
java_options="$java_options -Dlsp.library.path=$dir"
fi
if [ $debug = "true" ]; then

View File

@ -1,5 +1,6 @@
package org.lsposed.lspd.service;
import android.annotation.SuppressLint;
import android.os.ParcelFileDescriptor;
import android.util.Log;
@ -19,8 +20,10 @@ public class LogcatService implements Runnable {
private File log = null;
private Thread thread = null;
@SuppressLint("UnsafeDynamicallyLoadedCode")
public LogcatService(File logPath) {
System.loadLibrary("daemon");
String libraryPath = System.getProperty("lsp.library.path");
System.load(libraryPath + "/" + System.mapLibraryName("daemon"));
this.logPath = logPath;
logTimeFormat = DateTimeFormatter.ISO_LOCAL_DATE_TIME.withZone(Utils.getZoneId());
}