#!/system/bin/sh LOG=/data/adb/euicc_daemon.log ESIM_SVC="vendor.oplus.hardware.esim.IOplusEsim/default" gpio_st() { service call "$ESIM_SVC" 1 2>/dev/null | grep -oE '[0-9a-f]{8} [0-9a-f]{8}' | head -1 | awk '{print $2}' } status() { G=$(gpio_st) D=$(dumpsys isub 2>/dev/null | grep -c 'simSlotIndex=1 portIndex=0 isEmbedded=1') N=$(dumpsys isub 2>/dev/null | grep 'simSlotIndex=1 ' | grep -oE 'displayName=[^ ]+' | head -1) if [ "$G" = "00000001" ]; then echo "eUICC power : ON" else echo "eUICC power : OFF ($G)" fi if [ "${D:-0}" -ge 1 ]; then echo "eSIM in slot: YES $N" else echo "eSIM in slot: NO" fi } echo "=== eSIM Fix ===" status echo echo "Running activation cycle (~1-2 min)..." echo sh /data/adb/modules/euicc_slots_fix/esimd-manual.sh echo echo "=== Result ===" status echo echo "Log:" tail -8 "$LOG" 2>/dev/null if [[ -z "$MMRL" ]] && ([[ -n "$KSU" ]] || [[ -n "$APATCH" ]]); then sleep 10 fi