2017-11-14 5 views
1

Ist es möglich, NFC mit ADB für nicht gerootetes Android-Gerät mit Version 6.0.1 oder höher ein-/auszuschalten (deaktivieren/aktivieren)? Ich habe viele Sachen ausprobiert, aber es funktioniert nicht für mich.Natives Android-Gerät> NFC mit ADB ein-/ausschalten

Stuff Ich habe versucht, sind:

Via ADB:

adb shell settings put global airplane_mode_toggleable_radios bluetooth,cell,wimax,nfc 
adb shell am broadcast -a android.intent.action.airplane_mode_toggleable_radios 

adb shell settings put global airplane_mode_on 1 
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE 

adb shell settings put global radio_nfc 0 
adb shell am broadcast -a android.intent.action.radio_nfc 

adb shell settings put global AIRPLANE_MODE_RADIOS 0 
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE_RADIOS 

adb shell settings put global NfcAdapter 0 
adb shell am broadcast -a android.intent.action.NFC_adapter 

adb shell settings put global airplane_mode_radios cell,bluetooth,nfc,wimax 
adb shell content update --uri content://settings/global --bind value:s:'bluetooth,nfc,wimax' --where "name='airplane_mode_radios'" 

auch:

adb shell settings get global airplane_mode_radios 
adb shell content query --uri content://settings/global --projection name:value --where "name='airplane_mode_radios'" 

adb shell settings put global airplane_mode_radios "cell,nfc,wimax" 
adb shell content update --uri content://settings/global --bind value:s:'cell,nfc,wimax' --where "name='airplane_mode_radios'" 

adb shell settings put global airplane_mode_radios "cell,bluetooth,wifi,nfc,wimax" 
adb shell content update --uri content://settings/global --bind value:s:'cell,bluetooth,wifi,nfc,wimax' --where "name='airplane_mode_radios'" 

Nach dem Neustart des Gerätes i auf dem Flugzeug-Modus mit ADB drehen kann, aber die nfc tut NICHT gehen. Wenn ich den Flugzeugmodus auf dem nativen Gerät einschalte (Schnelleinstellungen ODER Einstellungen), geht es los!

Ein anderes habe ich versucht, ist:

Liste der laufenden Dienste mit:

adb shell service list 

dort können Sie diese nfc gelesen wird an der Nummer 9 "nfc: [android.nfc.INfcAdapter]" running

versuchen mit

adb shell pm hide com.android.nfc 

arbeiten und wirft nicht zu deaktivieren: 012.351.Fehler: java.lang.SecurityException: Weder Benutzer 2000 noch aktueller Prozess hat android.permission.MANAGE_USERS.

oder:

adb shell pm grant EXAMPLE.android.services android.permission.WRITE_SECURE_SETTINGS 
adb shell pm grant EXAMPLE.android.services android.permission.CHANGE_CONFIGURATION 

-

folgenden arbeitet an Geräten bis zu Android 5x: Enable/Disable NFC with ADB command

+0

Dies ist kein Duplikat. –

Antwort

0

Nach Herumspielen mit Enable/Disable NFC with ADB command

auf Android-Eibisch (6.0. 0 oder 6.0.1)

Disable

service call nfc 5

aktivieren

service call nfc 6

Edit:

Dies scheint nicht dauerhaft zu deaktivieren, die reale Gefunden erneut aktiviert den Dienst

Neustart Antworten!

svc nfc <enable|disable>

+0

Hallo @Freshollie, das funktioniert! Danke –