Set the dex2oat wrapper owner and group to `root:shell` (#2248)

This commit is contained in:
Howard Wu 2022-11-27 00:12:05 +08:00 committed by GitHub
parent c5918f7886
commit 6b70b624e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 8 deletions

View File

@ -19,7 +19,6 @@
package org.lsposed.manager.ui.widget; package org.lsposed.manager.ui.widget;
import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.os.Bundle; import android.os.Bundle;
@ -113,7 +112,6 @@ public class ExpandableTextView extends MaterialTextView {
return super.onPreDraw(); return super.onPreDraw();
} }
@SuppressLint("ClickableViewAccessibility")
@Override @Override
public boolean onTouchEvent(@NonNull MotionEvent event) { public boolean onTouchEvent(@NonNull MotionEvent event) {
Layout layout = this.getLayout(); Layout layout = this.getLayout();
@ -129,6 +127,7 @@ public class ExpandableTextView extends MaterialTextView {
if (links.length == 0) { if (links.length == 0) {
return false; return false;
} else { } else {
performClick();
return super.onTouchEvent(event); return super.onTouchEvent(event);
} }
} }
@ -137,6 +136,11 @@ public class ExpandableTextView extends MaterialTextView {
return false; return false;
} }
@Override
public boolean performClick() {
return super.performClick();
}
@Override @Override
public Parcelable onSaveInstanceState() { public Parcelable onSaveInstanceState() {
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();

View File

@ -105,9 +105,7 @@ public class Dex2OatService {
public Dex2OatService() { public Dex2OatService() {
initNative(); initNative();
try { try {
Files.walk(Paths.get(magiskPath).resolve("dex2oat")).forEach(path -> { Files.walk(Paths.get(magiskPath).resolve("dex2oat")).forEach(path -> SELinux.setFileContext(path.toString(), "u:object_r:magisk_file:s0"));
SELinux.setFileContext(path.toString(), "u:object_r:magisk_file:s0");
});
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "Error setting sepolicy", e); Log.e(TAG, "Error setting sepolicy", e);
} }
@ -130,7 +128,7 @@ public class Dex2OatService {
var devPath = Paths.get(devTmpDir); var devPath = Paths.get(devTmpDir);
var sockPath = devPath.resolve("dex2oat.sock"); var sockPath = devPath.resolve("dex2oat.sock");
try { try {
Log.i(TAG, "Daemon start"); Log.i(TAG, "Dex2oat wrapper daemon start");
if (setSocketCreateContext("u:r:dex2oat:s0")) { if (setSocketCreateContext("u:r:dex2oat:s0")) {
Log.d(TAG, "Set socket context to u:r:dex2oat:s0"); Log.d(TAG, "Set socket context to u:r:dex2oat:s0");
} else { } else {
@ -161,7 +159,7 @@ public class Dex2OatService {
} }
} }
} catch (Throwable e) { } catch (Throwable e) {
Log.e(TAG, "Daemon crashed", e); Log.e(TAG, "Dex2oat wrapper daemon crashed", e);
try { try {
server.close(); server.close();
Files.delete(sockPath); Files.delete(sockPath);

View File

@ -184,7 +184,7 @@ else
fi fi
set_perm_recursive "$MODPATH" 0 0 0755 0644 set_perm_recursive "$MODPATH" 0 0 0755 0644
set_perm_recursive "$MODPATH/bin" 0 0 0755 0755 u:object_r:dex2oat_exec:s0 set_perm_recursive "$MODPATH/bin" 0 2000 0755 0755 u:object_r:dex2oat_exec:s0
chmod 0744 "$MODPATH/daemon" chmod 0744 "$MODPATH/daemon"
if [ "$(grep_prop ro.maple.enable)" == "1" ] && [ "$FLAVOR" == "zygisk" ]; then if [ "$(grep_prop ro.maple.enable)" == "1" ] && [ "$FLAVOR" == "zygisk" ]; then