diff --git a/app/src/full/java/com/topjohnwu/magisk/adapters/PolicyAdapter.java b/app/src/full/java/com/topjohnwu/magisk/adapters/PolicyAdapter.java index c9bf2434d..407a2b4b9 100644 --- a/app/src/full/java/com/topjohnwu/magisk/adapters/PolicyAdapter.java +++ b/app/src/full/java/com/topjohnwu/magisk/adapters/PolicyAdapter.java @@ -6,7 +6,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; -import android.widget.Switch; import android.widget.TextView; import com.google.android.material.snackbar.Snackbar; @@ -23,6 +22,7 @@ import java.util.List; import java.util.Set; import androidx.annotation.NonNull; +import androidx.appcompat.widget.SwitchCompat; import androidx.recyclerview.widget.RecyclerView; import butterknife.BindView; @@ -144,9 +144,9 @@ public class PolicyAdapter extends RecyclerView.Adapter - - - command[0]) return to->command; if (to->shell[0]) @@ -71,10 +72,13 @@ void app_log(struct su_context *ctx) { char policy[2]; sprintf(policy, "%d", ctx->info->access.policy); + char component[128]; + sprintf(component, "%s/" RECEIVER, ctx->info->str[SU_MANAGER]); + const char *cmd[] = { AM_PATH, "broadcast", "-a", "android.intent.action.BOOT_COMPLETED", - "-p", ctx->info->str[SU_MANAGER], + "-n", component, "-f", "0x00000020", "--user", user, "--es", "action", "log", @@ -101,10 +105,13 @@ void app_notify(struct su_context *ctx) { char policy[2]; sprintf(policy, "%d", ctx->info->access.policy); + char component[128]; + sprintf(component, "%s/" RECEIVER, ctx->info->str[SU_MANAGER]); + const char *cmd[] = { AM_PATH, "broadcast", "-a", "android.intent.action.BOOT_COMPLETED", - "-p", ctx->info->str[SU_MANAGER], + "-n", component, "-f", "0x00000020", "--user", user, "--es", "action", "notify", @@ -118,10 +125,12 @@ void app_notify(struct su_context *ctx) { void app_connect(const char *socket, struct su_info *info) { char user[8]; setup_user(user, info); + char component[128]; + sprintf(component, "%s/" RECEIVER, info->str[SU_MANAGER]); const char *cmd[] = { AM_PATH, "broadcast", "-a", "android.intent.action.BOOT_COMPLETED", - "-p", info->str[SU_MANAGER], + "-n", component, "-f", "0x00000020", "--user", user, "--es", "action", "request", diff --git a/scripts/flash_script.sh b/scripts/flash_script.sh index c227d7563..aeb8f081c 100644 --- a/scripts/flash_script.sh +++ b/scripts/flash_script.sh @@ -57,7 +57,7 @@ ui_print "- Target image: $BOOTIMAGE" # Detect version and architecture api_level_arch_detect -[ $API -lt 21 ] && abort "! Magisk is only for Lollipop and above (5.0+) (SDK 21+)" +[ $API -lt 19 ] && abort "! Magisk is only for KitKat and above (4.4+) (SDK 19+)" ui_print "- Device platform: $ARCH"