How to toggle Airplane Mode on Android 4.2 and above using root? -
as known, on android 4.2 system applications can toggle airplane mode. think must available rooted devices. , want impliment in application rooted devices build.version.sdk_int>=17. how toggle airplane mode on rooted devices android 4.2?
there new "settings" binary in android 4.2 can use without su, app needs permission required change setting declared in app's manifest (which write_secure_settings flight mode in 4.2 - granted apps installed on system partition).
activate
su settings put global airplane_mode_on 1 broadcast -a android.intent.action.airplane_mode --ez state true deactivate
su settings put global airplane_mode_on 0 broadcast -a android.intent.action.airplane_mode --ez state false for other android versions , other settings (flight mode can activated without root before 4.2) can use sql injects in settings.db
su sqlite3 /data/data/com.android.providers.settings/databases/settings.db insert global values(null, 'airplane_mode_on', 1); replace "global" "system" or "secure" , 'airplane_mode_on' key of desired table entry. settings need send broadcasts afterwards, see example above flight mode.
to explore settings.db run in terminal app:
su sqlite3 /data/data/com.android.providers.settings/databases/settings.db .tables select * global select * secure select * system
Comments
Post a Comment