parent
e8cce7a88e
commit
0a26993039
|
|
@ -7,8 +7,6 @@ import android.os.IBinder;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
import android.system.ErrnoException;
|
|
||||||
import android.system.Os;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
|
|
@ -71,15 +69,7 @@ public class BridgeService {
|
||||||
};
|
};
|
||||||
|
|
||||||
// For service
|
// For service
|
||||||
// This MUST run in main thread
|
|
||||||
private static synchronized void sendToBridge(IBinder binder, boolean isRestart) {
|
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 {
|
do {
|
||||||
bridgeService = ServiceManager.getService(SERVICE_NAME);
|
bridgeService = ServiceManager.getService(SERVICE_NAME);
|
||||||
if (bridgeService != null && bridgeService.pingBinder()) {
|
if (bridgeService != null && bridgeService.pingBinder()) {
|
||||||
|
|
@ -145,13 +135,6 @@ public class BridgeService {
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
listener.onResponseFromBridgeService(res);
|
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) {
|
public static void send(LSPosedService service, Listener listener) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue