# MOTOROLA / MOTO — Bloqueio OTA (G series incl. G56 5G / bogota, Edge, Note)
# Android 14–16: com.motorola.ccc.ota e com.motorola.ccc.devicemanagement
# sao non-disable / non-suspend via shell. Soft-freeze + DNS + Owner SEAL.
shell settings put secure user_setup_complete 1
shell settings put global device_provisioned 1
shell settings put global software_updates_enabled 0
shell settings put secure system_update_automatic 0
shell settings put global ota_disable_automatic_update 1
shell settings put secure ota_disable_automatic_update 1
shell settings put global system_update_auto_download 0
shell settings put global auto_update_system 0
shell settings put global fota_disable 1
shell settings put global auto_update_policy 2
shell settings put secure familia_ota_locked 1

# ===== DISABLE (quando o sistema permitir) =====
shell pm disable-user --user 0 com.motorola.ccc.ota
shell pm disable-user --user 0 com.motorola.ccc.notification
shell pm disable-user --user 0 com.motorola.ccc.devicemanagement
shell pm disable-user --user 0 com.motorola.android.provisioning
shell pm disable-user --user 0 com.motorola.omadm
shell pm disable-user --user 0 com.motorola.omadm.service
shell pm disable-user --user 0 com.motorola.omadm.vzw
shell pm disable-user --user 0 com.motorola.genie
shell pm disable-user --user 0 com.motorola.systemupdate
shell pm disable-user --user 0 com.motorola.motocare
shell pm disable-user --user 0 com.motorola.brapps
shell pm disable-user --user 0 com.motorola.demo
shell pm disable-user --user 0 com.motorola.carrierconfig
shell pm disable-user --user 0 com.android.updater
shell pm disable-user --user 0 com.google.android.configupdater
shell pm disable-user --user 0 com.orange.update
shell pm disable-user --user 0 com.wssyncmldm

# ===== SUSPEND =====
shell cmd package suspend com.motorola.ccc.ota
shell cmd package suspend com.motorola.ccc.notification
shell cmd package suspend com.motorola.android.provisioning
shell cmd package suspend com.motorola.omadm
shell cmd package suspend com.motorola.omadm.service
shell cmd package suspend com.motorola.omadm.vzw
shell cmd package suspend com.motorola.systemupdate
shell cmd package suspend com.motorola.motocare
shell cmd package suspend com.motorola.genie
shell cmd package suspend com.motorola.brapps
shell cmd package suspend com.motorola.demo
shell cmd package suspend com.motorola.carrierconfig
shell cmd package suspend com.google.android.configupdater
shell cmd package suspend com.orange.update

# ===== FORCE-STOP =====
shell am force-stop com.motorola.ccc.ota
shell am force-stop com.motorola.ccc.notification
shell am force-stop com.motorola.android.provisioning
shell am force-stop com.motorola.omadm.service
shell am force-stop com.motorola.omadm.vzw
shell am force-stop com.google.android.configupdater
shell am force-stop com.orange.update

# ===== APPOPS soft freeze (critico no G56 / Android 16) =====
shell cmd appops set com.motorola.ccc.ota RUN_IN_BACKGROUND deny
shell cmd appops set com.motorola.ccc.ota RUN_ANY_IN_BACKGROUND deny
shell cmd appops set com.motorola.ccc.ota WAKE_LOCK deny
shell cmd appops set com.motorola.ccc.ota START_FOREGROUND deny
shell cmd appops set com.motorola.ccc.notification RUN_IN_BACKGROUND deny
shell cmd appops set com.motorola.ccc.notification RUN_ANY_IN_BACKGROUND deny
shell cmd appops set com.motorola.android.provisioning RUN_IN_BACKGROUND deny
shell cmd appops set com.motorola.android.provisioning RUN_ANY_IN_BACKGROUND deny
shell cmd appops set com.motorola.omadm.service RUN_IN_BACKGROUND deny
shell cmd appops set com.motorola.omadm.service RUN_ANY_IN_BACKGROUND deny
shell cmd appops set com.google.android.configupdater RUN_IN_BACKGROUND deny
shell cmd appops set com.orange.update RUN_IN_BACKGROUND deny

# ===== JOBS / NET =====
shell cmd netpolicy set restrict-background true com.motorola.ccc.ota
shell cmd netpolicy set restrict-background true com.motorola.android.provisioning
shell cmd jobscheduler cancel -u 0 com.motorola.ccc.ota
shell cmd jobscheduler cancel -u 0 com.motorola.android.provisioning
shell cmd jobscheduler cancel -u 0 com.motorola.omadm.service

# ===== USER 0 uninstall updates (quando aplicavel) =====
shell pm uninstall -k --user 0 com.orange.update
shell pm uninstall -k --user 0 com.google.android.configupdater
