Stop seteuid to 1000

#1872
This commit is contained in:
vvb2060 2022-12-03 01:03:38 +08:00 committed by LoveSy
parent e8cce7a88e
commit 0a26993039
1 changed files with 51 additions and 68 deletions

View File

@ -7,8 +7,6 @@ import android.os.IBinder;
import android.os.Looper;
import android.os.Parcel;
import android.os.ServiceManager;
import android.system.ErrnoException;
import android.system.Os;
import android.util.Log;
import java.lang.reflect.Field;
@ -71,15 +69,7 @@ public class BridgeService {
};
// For service
// This MUST run in main thread
private static synchronized void sendToBridge(IBinder binder, boolean isRestart) {
assert Looper.myLooper() == Looper.getMainLooper();
try {
Os.seteuid(0);
} catch (ErrnoException e) {
Log.e(TAG, "seteuid 0", e);
}
try {
do {
bridgeService = ServiceManager.getService(SERVICE_NAME);
if (bridgeService != null && bridgeService.pingBinder()) {
@ -145,13 +135,6 @@ public class BridgeService {
if (listener != null) {
listener.onResponseFromBridgeService(res);
}
} finally {
try {
Os.seteuid(1000);
} catch (ErrnoException e) {
Log.e(TAG, "seteuid 1000", e);
}
}
}
public static void send(LSPosedService service, Listener listener) {