dispositivo devices como autorizado android permissions usb root usbserial

devices - omitir el diálogo de confirmación del permiso del host usb de Android



adb unauthorized como resolver (12)

@d_d_t aswer es genial, pero no funciona en el nuevo 4.2.2. Utilice esta interfaz:

public interface IUsbManager extends android.os.IInterface { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements android.hardware.usb.IUsbManager { private static final java.lang.String DESCRIPTOR = "android.hardware.usb.IUsbManager"; /** Construct the stub at attach it to the interface. */ public Stub() { throw new RuntimeException( "Stub!" ); } /** * Cast an IBinder object into an android.hardware.usb.IUsbManager * interface, generating a proxy if needed. */ public static android.hardware.usb.IUsbManager asInterface( android.os.IBinder obj) { throw new RuntimeException( "Stub!" ); } @Override public android.os.IBinder asBinder() { throw new RuntimeException( "Stub!" ); } @Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException { throw new RuntimeException( "Stub!" ); } static final int TRANSACTION_getDeviceList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_openDevice = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_getCurrentAccessory = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); static final int TRANSACTION_openAccessory = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); static final int TRANSACTION_setDevicePackage = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4); static final int TRANSACTION_setAccessoryPackage = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5); static final int TRANSACTION_hasDevicePermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6); static final int TRANSACTION_hasAccessoryPermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7); static final int TRANSACTION_requestDevicePermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8); static final int TRANSACTION_requestAccessoryPermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 9); static final int TRANSACTION_grantDevicePermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 10); static final int TRANSACTION_grantAccessoryPermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 11); static final int TRANSACTION_hasDefaults = (android.os.IBinder.FIRST_CALL_TRANSACTION + 12); static final int TRANSACTION_clearDefaults = (android.os.IBinder.FIRST_CALL_TRANSACTION + 13); static final int TRANSACTION_setCurrentFunction = (android.os.IBinder.FIRST_CALL_TRANSACTION + 14); static final int TRANSACTION_setMassStorageBackingFile = (android.os.IBinder.FIRST_CALL_TRANSACTION + 15); static final int TRANSACTION_allowUsbDebugging = (android.os.IBinder.FIRST_CALL_TRANSACTION + 16); static final int TRANSACTION_denyUsbDebugging = (android.os.IBinder.FIRST_CALL_TRANSACTION + 17); } /* Returns a list of all currently attached USB devices */ public void getDeviceList(android.os.Bundle devices) throws android.os.RemoteException; /* * Returns a file descriptor for communicating with the USB device. The * native fd can be passed to usb_device_new() in libusbhost. */ public android.os.ParcelFileDescriptor openDevice( java.lang.String deviceName) throws android.os.RemoteException; /* Returns the currently attached USB accessory */ public android.hardware.usb.UsbAccessory getCurrentAccessory() throws android.os.RemoteException; /* * Returns a file descriptor for communicating with the USB accessory. This * file descriptor can be used with standard Java file operations. */ public android.os.ParcelFileDescriptor openAccessory( android.hardware.usb.UsbAccessory accessory) throws android.os.RemoteException; /* * Sets the default package for a USB device (or clears it if the package * name is null) */ public void setDevicePackage(android.hardware.usb.UsbDevice device, java.lang.String packageName, int userId) throws android.os.RemoteException; /* * Sets the default package for a USB accessory (or clears it if the package * name is null) */ public void setAccessoryPackage( android.hardware.usb.UsbAccessory accessory, java.lang.String packageName, int userId) throws android.os.RemoteException; /* Returns true if the caller has permission to access the device. */ public boolean hasDevicePermission(android.hardware.usb.UsbDevice device) throws android.os.RemoteException; /* Returns true if the caller has permission to access the accessory. */ public boolean hasAccessoryPermission( android.hardware.usb.UsbAccessory accessory) throws android.os.RemoteException; /* * Requests permission for the given package to access the device. Will * display a system dialog to query the user if permission had not already * been given. */ public void requestDevicePermission(android.hardware.usb.UsbDevice device, java.lang.String packageName, android.app.PendingIntent pi) throws android.os.RemoteException; /* * Requests permission for the given package to access the accessory. Will * display a system dialog to query the user if permission had not already * been given. Result is returned via pi. */ public void requestAccessoryPermission( android.hardware.usb.UsbAccessory accessory, java.lang.String packageName, android.app.PendingIntent pi) throws android.os.RemoteException; /* Grants permission for the given UID to access the device */ public void grantDevicePermission(android.hardware.usb.UsbDevice device, int uid) throws android.os.RemoteException; /* Grants permission for the given UID to access the accessory */ public void grantAccessoryPermission( android.hardware.usb.UsbAccessory accessory, int uid) throws android.os.RemoteException; /* * Returns true if the USB manager has default preferences or permissions * for the package */ public boolean hasDefaults(java.lang.String packageName, int userId) throws android.os.RemoteException; /* Clears default preferences and permissions for the package */ public void clearDefaults(java.lang.String packageName, int userId) throws android.os.RemoteException; /* Sets the current USB function. */ public void setCurrentFunction(java.lang.String function, boolean makeDefault) throws android.os.RemoteException; /* Sets the file path for USB mass storage backing file. */ public void setMassStorageBackingFile(java.lang.String path) throws android.os.RemoteException; /* * Allow USB debugging from the attached host. If alwaysAllow is true, add * the the public key to list of host keys that the user has approved. */ public void allowUsbDebugging(boolean alwaysAllow, java.lang.String publicKey) throws android.os.RemoteException; /* Deny USB debugging from the attached host */ public void denyUsbDebugging() throws android.os.RemoteException; }

Y modifique el código agregando ID de usuario:

... service.setDevicePackage( usbDevice, YOUR_APP_PACKAGE_NAMESPACE, ai.uid ); ....

Quiero usar Android en la industria,

Puedo conectarme a los chips Profilic y Ftdi USB a serie con la biblioteca slickdevlabs.com sin ningún problema.

La aplicación tiene un servicio y se inicia en el arranque, se conecta al puerto serie USB y realiza otras tareas.

mi problema es que el dispositivo host no tiene ninguna interacción con el usuario,

así que cuando el androide pregunta

Allow the app "MyAPP" to access the USB device ? [checkmark]Use by default for this USB device Cancel OK

No hay persona para hacer clic en Aceptar.

incluso cuando marca la casilla de verificación de uso predeterminado ... Si reinserto el USB, o reinicio el dispositivo host, vuelve a preguntar en el próximo arranque.

Ejecuté el servicio y la aplicación con el modo Superusuario, pero no hay diferencia, vuelve a preguntar.

Agregué filtro de intención pero no hay diferencia, me lo pide cada vez.

<intent-filter> <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" /> <action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" /> </intent-filter> <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" android:resource="@xml/device_filter" /> <meta-data android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" android:resource="@xml/device_filter" />

¿Alguna opinión de cómo evitarlo o desactivarlo?

Tengo acceso a root y SU.


Android realmente no está diseñado para admitir este tipo de uso fuera de la caja. Personalmente, para un uso no interactivo, me sentiría tentado a considerar el uso del controlador serial USB en el kernel de Linux y omitir las apis USB de Android. Pero tendría que estar en condiciones de modificar seriamente la instalación de Android: cambiar la configuración del kernel y / o cargar un módulo, crear archivos de dispositivos y establecer sus permisos o propietarios, posiblemente agregar un grupo de Unix y permisos de Android para las aplicaciones permitidas acceder a él.

O puede mirar a través de la fuente de Android y deshabilitar la confirmación del usuario; pero si no tiene una versión de Android de origen para el dispositivo, esto puede ser más complicado que la idea de nivel de Linux, ya que adaptar Android de código abierto para que se ejecute en un dispositivo de proveedor puede ser no trivial (a menos que alguien ya ofrezca un -construcción de fuente que es suficientemente funcional para el dispositivo en cuestión)

De manera indicativa, el acceso root / su no se aplica a las aplicaciones en sí mismas, solo significa que una aplicación que sepa cómo ejecutar la herramienta que su root hack dejó atrás, puede iniciar un programa auxiliar que se ejecuta como root, pero la aplicación en sí no lo hace y no poder. El uso de root para instalar la aplicación en la partición del sistema puede brindarle algunos permisos atípicos de Android, pero tendrá que verificar si hay alguna que le ayude con el usb.


Creo que la mejor solución es poner en la lista blanca el accesorio que está usando de antemano. Para hacer esto necesita agregar el archivo usb_device_manager.xml en esta ubicación / data / system / users / 0
// Tenga en cuenta que 0 es ID de usuario, probablemente será 0 si no agregó más usuarios en Android pero si cambió esta ID en consecuencia

Así es como debería verse el archivo:

<settings> <preference package="<PACKAGE NAME OF APP YOU WANT TO START ON CONNECTIONCTION>"> <usb-accessory manufacturer="<NAME OF MANUFECTURER LIKE ONE REGISTERED IN meta-data in the manifest>" model="<MODEL NAME LIKE ONE REGISTERED IN meta-data in the manifest>" version="<VERSION LIKE ONE REGISTERED IN meta-data in the manifest>" /> </preference>

Para una junta como esta http://www.embeddedartists.com/products/app/aoa_kit.php es:

<?xml version=''1.0'' encoding=''utf-8'' standalone=''yes'' ?> <settings> <preference package="com.embeddedartists.aoa"> <usb-accessory manufacturer="Embedded Artists AB" model="AOA Board - Basic" version="1.0" /> </preference>


Creo que podemos hacer esto haciendo algunas modificaciones en /etc/udev . Podríamos agregar la identificación del proveedor y la identificación del dispositivo en el archivo 51-android.rules .


De acuerdo con la documentación sobre Desarrolladores de Android, usted ya tiene permiso para el dispositivo USB conectado cuando su aplicación se inicia a través de su filtro de intención manifiesta. Tal vez debería probar este enfoque y escribir un filtro que coincida exactamente con el dispositivo que desea usar, para evitar que otras aplicaciones también quieran comunicarse con el dispositivo.

Consulte la "Nota" en http://developer.android.com/guide/topics/connectivity/usb/host.html#permission-d


La primera vez, cuando necesita confirmación, puede seleccionar "siempre", luego, incluso si el dispositivo Android está apagado y encendido, su aplicación aún tiene permiso para acceder al USB2Serial. Solo para decir, solo una vez confirmar!


Sé que es un poco tarde, pero aún así ...

Tuve el mismo tipo de problema y creo que me las arreglé para resolverlo. Hay un servicio que Android usa internamente que permite administrar dispositivos USB y accesorios. Este servicio está oculto para terceros desarrolladores y no está documentado. Si verifica el código fuente de UsbPermissionActivity, podrá averiguar cómo se llama ese servicio. Para llamar al servicio se emplean la interfaz IUsbManager y la clase ServiceManager. Ambos están ocultos también, así que no puedes usarlos directamente. Pero lo que puede hacer es crear sus apéndices con exactamente los mismos nombres y en los espacios de nombres correspondientes (paquetes). Entonces podrás compilar ese código, mientras que el entorno de ejecución utilizará las cosas reales.

El único requisito es que su aplicación tiene que ser un sistema uno , es decir, debe estar ubicada en el directorio / system / app /. Ya que su dispositivo está rooteado eso no debería ser un problema.

Así que tendrá que agregar un paquete a su proyecto: " android.hardware.usb " y colocar un archivo llamado " IUsbManager.java " con el siguiente contenido:

package android.hardware.usb; public interface IUsbManager extends android.os.IInterface { /** Local-side IPC implementation stub class. */ public static abstract class Stub extends android.os.Binder implements android.hardware.usb.IUsbManager { /** Construct the stub at attach it to the interface. */ public Stub() { throw new RuntimeException( "Stub!" ); } /** * Cast an IBinder object into an android.hardware.usb.IUsbManager interface, * generating a proxy if needed. */ public static android.hardware.usb.IUsbManager asInterface( android.os.IBinder obj ) { throw new RuntimeException( "Stub!" ); } public android.os.IBinder asBinder() { throw new RuntimeException( "Stub!" ); } public boolean onTransact( int code, android.os.Parcel data, android.os.Parcel reply, int flags ) throws android.os.RemoteException { throw new RuntimeException( "Stub!" ); } static final int TRANSACTION_getDeviceList = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0); static final int TRANSACTION_openDevice = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1); static final int TRANSACTION_getCurrentAccessory = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2); static final int TRANSACTION_openAccessory = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3); static final int TRANSACTION_setDevicePackage = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4); static final int TRANSACTION_setAccessoryPackage = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5); static final int TRANSACTION_hasDevicePermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6); static final int TRANSACTION_hasAccessoryPermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 7); static final int TRANSACTION_requestDevicePermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 8); static final int TRANSACTION_requestAccessoryPermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 9); static final int TRANSACTION_grantDevicePermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 10); static final int TRANSACTION_grantAccessoryPermission = (android.os.IBinder.FIRST_CALL_TRANSACTION + 11); static final int TRANSACTION_hasDefaults = (android.os.IBinder.FIRST_CALL_TRANSACTION + 12); static final int TRANSACTION_clearDefaults = (android.os.IBinder.FIRST_CALL_TRANSACTION + 13); static final int TRANSACTION_setCurrentFunction = (android.os.IBinder.FIRST_CALL_TRANSACTION + 14); static final int TRANSACTION_setMassStorageBackingFile = (android.os.IBinder.FIRST_CALL_TRANSACTION + 15); } /* Returns a list of all currently attached USB devices */ public void getDeviceList( android.os.Bundle devices ) throws android.os.RemoteException; /* Returns a file descriptor for communicating with the USB device. * The native fd can be passed to usb_device_new() in libusbhost. */ public android.os.ParcelFileDescriptor openDevice( java.lang.String deviceName ) throws android.os.RemoteException; /* Returns the currently attached USB accessory */ public android.hardware.usb.UsbAccessory getCurrentAccessory() throws android.os.RemoteException; /* Returns a file descriptor for communicating with the USB accessory. * This file descriptor can be used with standard Java file operations. */ public android.os.ParcelFileDescriptor openAccessory( android.hardware.usb.UsbAccessory accessory ) throws android.os.RemoteException; /* Sets the default package for a USB device * (or clears it if the package name is null) */ public void setDevicePackage( android.hardware.usb.UsbDevice device, java.lang.String packageName ) throws android.os.RemoteException; /* Sets the default package for a USB accessory * (or clears it if the package name is null) */ public void setAccessoryPackage( android.hardware.usb.UsbAccessory accessory, java.lang.String packageName ) throws android.os.RemoteException; /* Returns true if the caller has permission to access the device. */ public boolean hasDevicePermission(android.hardware.usb.UsbDevice device) throws android.os.RemoteException; /* Returns true if the caller has permission to access the accessory. */ public boolean hasAccessoryPermission( android.hardware.usb.UsbAccessory accessory ) throws android.os.RemoteException; /* Requests permission for the given package to access the device. * Will display a system dialog to query the user if permission * had not already been given. */ public void requestDevicePermission( android.hardware.usb.UsbDevice device, java.lang.String packageName, android.app.PendingIntent pi ) throws android.os.RemoteException; /* Requests permission for the given package to access the accessory. * Will display a system dialog to query the user if permission * had not already been given. Result is returned via pi. */ public void requestAccessoryPermission( android.hardware.usb.UsbAccessory accessory, java.lang.String packageName, android.app.PendingIntent pi ) throws android.os.RemoteException; /* Grants permission for the given UID to access the device */ public void grantDevicePermission( android.hardware.usb.UsbDevice device, int uid ) throws android.os.RemoteException; /* Grants permission for the given UID to access the accessory */ public void grantAccessoryPermission( android.hardware.usb.UsbAccessory accessory, int uid ) throws android.os.RemoteException; /* Returns true if the USB manager has default preferences or permissions for the package */ public boolean hasDefaults( java.lang.String packageName ) throws android.os.RemoteException; /* Clears default preferences and permissions for the package */ public void clearDefaults( java.lang.String packageName ) throws android.os.RemoteException; /* Sets the current USB function. */ public void setCurrentFunction( java.lang.String function, boolean makeDefault ) throws android.os.RemoteException; /* Sets the file path for USB mass storage backing file. */ public void setMassStorageBackingFile( java.lang.String path ) throws android.os.RemoteException; }

Luego otro paquete: " android.os " con " ServiceManager.java ":

package android.os; import java.util.Map; public final class ServiceManager { public static IBinder getService( String name ) { throw new RuntimeException( "Stub!" ); } /** * Place a new @a service called @a name into the service * manager. * * @param name the name of the new service * @param service the service object */ public static void addService( String name, IBinder service ) { throw new RuntimeException( "Stub!" ); } /** * Retrieve an existing service called @a name from the * service manager. Non-blocking. */ public static IBinder checkService( String name ) { throw new RuntimeException( "Stub!" ); } public static String[] listServices() throws RemoteException { throw new RuntimeException( "Stub!" ); } /** * This is only intended to be called when the process is first being brought * up and bound by the activity manager. There is only one thread in the process * at that time, so no locking is done. * * @param cache the cache of service references * @hide */ public static void initServiceCache( Map<String, IBinder> cache ) { throw new RuntimeException( "Stub!" ); } }

Tenga en cuenta que las interfaces de estas clases pueden cambiar dependiendo de la versión de Android. En mi caso la versión es 4.0.3 . Por lo tanto, si tiene otra versión de Android y este código no funciona, tendrá que verificar el código fuente de su versión particular del sistema operativo.

Este es un ejemplo del uso del servicio para otorgar permisos a todos los dispositivos FTDI:

import java.util.HashMap; import java.util.Iterator; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.hardware.usb.IUsbManager; import android.hardware.usb.UsbDevice; import android.hardware.usb.UsbManager; import android.os.IBinder; import android.os.ServiceManager; public class LaunchReceiver extends BroadcastReceiver { public void onReceive( Context context, Intent intent ) { String action = intent.getAction(); if( action != null && action.equals( Intent.ACTION_BOOT_COMPLETED ) ) { try { PackageManager pm = context.getPackageManager(); ApplicationInfo ai = pm.getApplicationInfo( YOUR_APP_PACKAGE_NAMESPACE, 0 ); if( ai != null ) { UsbManager manager = (UsbManager) context.getSystemService( Context.USB_SERVICE ); IBinder b = ServiceManager.getService( Context.USB_SERVICE ); IUsbManager service = IUsbManager.Stub.asInterface( b ); HashMap<String, UsbDevice> deviceList = manager.getDeviceList(); Iterator<UsbDevice> deviceIterator = deviceList.values().iterator(); while( deviceIterator.hasNext() ) { UsbDevice device = deviceIterator.next(); if( device.getVendorId() == 0x0403 ) { service.grantDevicePermission( device, ai.uid ); service.setDevicePackage( device, YOUR_APP_PACKAGE_NAMESPACE ); } } } } catch( Exception e ) { trace( e.toString() ); } } } }

Una cosa más: tendrá que agregar el siguiente permiso a su manifiesto (es posible que a Lint no le guste, pero siempre puede cambiar el nivel de gravedad en las propiedades de su proyecto):

<uses-permission android:name="android.permission.MANAGE_USB" />


Si solo desea copiar / escribir en una memoria USB, puede utilizar

siguiendo el método con comandos linx doCommand ("mkdir / mnt / usbhost1 / dirname")

private boolean doCommand(String[] commands) { boolean ran = false; try { Process process = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(process.getOutputStream()); for (String single : commands) { os.writeBytes(single + "/n"); os.flush(); } os.writeBytes("exit/n"); os.flush(); process.waitFor(); ran = true; } catch(Exception ex) { } return ran; }

Tengo los siguientes permisos en mi manifiesto para disculparme, no recuerdo cuáles son obligatorios.

<permission android:name="com.android.example.USB_PERMISSION"/> <permission android:name= "android.permission.INSTALL_PACKAGES"/> <permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <data android:scheme="file" />

Si quieres hacer algo más, esto puede no serte muy útil.


Si tiene la opción de compilar el sistema Android, entonces no hay nada que no pueda hacer.

Puedes añadir

public void onStart() { super.onStart(); mPermissionGranted = true; finish(); }

to frameworks / base / packages / SystemUI / src / com / android / systemui / usb / UsbPermissionActivity.java

para pasar por alto la ventana emergente de confirmación del permiso.


Tuve el mismo problema con la ventana emergente y nadie hizo clic en ella. Pero encontré una solución diferente (para dispositivos rooteados). La ventana emergente es generada por Android en la clase UsbPermissionActivity (y que UsbPermissionActivity se inicia con el UsbSettingsManager). Mira el código fuente de Android para ver qué está pasando. Lo bueno aquí es que podemos manipular el código de bytes de UsbPermissionActivity para aceptar todos los dispositivos USB. Necesitas la herramienta Smali / Baksmali para hacerlo. https://code.google.com/p/smali/

  1. Localiza el archivo SystemUI.apk en tu dispositivo
  2. adb pull path/to/SystemUI.apk en su computadora con la adb pull path/to/SystemUI.apk
  3. Descomprimir el apk
  4. Desmonte el archivo classes.dex con java -jar baksmali.jar classes.dex
  5. Encuentre el archivo UsbPermissionActivity y dentro de él encuentre la línea que dice

    invoke-virtual {p0}, Lcom/android/systemui/usb/UsbPermissionActivity;->setupAlert()V

  6. Cambia esto comentándolo y agregando dos nuevas líneas.

#invoke-virtual {p0}, Lcom/android/systemui/usb/UsbPermissionActivity;->setupAlert()V const/4 v0, 0x1 iput-boolean v0, p0, Lcom/android/systemui/usb/UsbPermissionActivity;->mPermissionGranted:Z invoke-virtual {p0}, Lcom/android/systemui/usb/UsbPermissionActivity;->finish()V

  1. Ensamble con java -jar smali.jar -o classes.dex out
  2. Reemplace el original classes.dex y vuelva a comprimir todo a SystemUI.apk
  3. Reemplace el SystemUI.apk original en su dispositivo con adb push services.jar path/to/SystemUI.apk o si eso no funciona con una aplicación de archivos de archivos

Tuve el mismo problema, la ventana emergente de permiso aparece cada vez que conecto el cable USB, para resolverlo, solo agregué el filtro en el archivo de manifiesto y el archivo XML para VID y PID, solo asegúrese de haber configurado el filtrado de dispositivos USB como se sugiere en el enlace SO anterior o como se documenta aquí, y usted pone el buen VID y PID. Fue mi problema, no puse el VID y el PID que coinciden con mi dispositivo


Una forma de lograr esto, tenga en cuenta que esto no elimina realmente la confirmación, sería identificar la ubicación de la checkbox de checkbox y usar el equivalente de Android de la clase de Robot para seleccionarlo y luego seleccionar OK . Podría escribir una aplicación que se ejecute en segundo plano, incluso podría ser invocada por el servicio de inicio que mencionó, específicamente para este propósito.