/// <summary> /// Initializes a new instance of the <c>AAPT</c> class /// </summary> public AAPT() { ResourceFolderManager.Register("AAPT"); this.resDir = ResourceFolderManager.GetRegisteredFolderPath("AAPT"); ExtractResources(this.resDir); }
/// <summary> /// Signs an Update.zip with test keys to flash on an Android device /// </summary> /// <param name="unsigned">Full path to unsigned update.zip</param> /// <returns>True if successful, false if file <paramref name="unsigned"/> does not exist or if file <paramref name="unsigned"/> is not a zip</returns> /// <remarks><para>Outputs signed zip in same directory as unsigned zip</para></remarks> public static bool SignUpdateZip(string unsigned) { if (!File.Exists(unsigned) || Path.GetExtension(unsigned).ToLower() != ".zip") { return(false); } bool result; string resDir; ResourceFolderManager.Register("Signer"); resDir = ResourceFolderManager.GetRegisteredFolderPath("Signer"); ExtractResources(resDir); result = Java.RunJar(resDir + "signapk.jar", "\"" + resDir + "testkey.x509.pem\"", "\"" + resDir + "testkey.pk8\"", "\"" + unsigned + "\"", "\"" + unsigned.Replace(".zip", "_signed.zip\"")); ResourceFolderManager.Unregister("Signer"); return(result); }
private AndroidController() { this.connectedDevices = new List <string>(); ResourceFolderManager.Register(ANDROID_CONTROLLER_FOLDER); this.resourceDirectory = ResourceFolderManager.GetRegisteredFolderPath(ANDROID_CONTROLLER_FOLDER); }
/// <summary> /// Prevents a default instance of the <see cref="AndroidController"/> class from being created. /// </summary> private AndroidController() { this.connectedDevices = new List <string>(); ResourceFolderManager.Register(ANDROID_CONTROLLER_TMP_FOLDER); this.resourceDirectory = ResourceFolderManager.GetRegisteredFolderPath(ANDROID_CONTROLLER_TMP_FOLDER); //CreateResourceDirectories(); //ExtractResources(); this.m_eventWatcher = new ManagementEventWatcher( new WqlEventQuery("SELECT * FROM Win32_VolumeChangeEvent WHERE EventType = 2") ); this.m_eventWatcher.EventArrived += (s, evt) => { var m_oldConnectedDevices = connectedDevices; var m_newConnectedDevices = ConnectedDevices; if (m_oldConnectedDevices.Count != m_newConnectedDevices.Count) { // List sizes do not match. // Depending on whether the new list is longer or short, fire the corresponding event. if (m_newConnectedDevices.Count > m_oldConnectedDevices.Count) { // A new device was added. // Find out which device it was. foreach (string m_device in m_newConnectedDevices) { if (!m_oldConnectedDevices.Contains(m_device)) { // We've found the device that was added. // We know this because the old list doesn't contain this device's serial. // Now fire OnDeviceAdded event(s). foreach (DeviceAddedEventHandler m_handler in OnDeviceAdded.GetInvocationList()) { m_handler( this, new OnDeviceAddedEventArgs( "A new device was added to the local machine.", GetConnectedDevice(m_device) ) ); } } } } else { // A device was removed. // Find out which one it was. foreach (string m_device in m_oldConnectedDevices) { if (!m_newConnectedDevices.Contains(m_device)) { // We've found the device that was removed. // We know this because the new list doesn't contain the device's serial. // Now fire OnDeviceRemoved event(s). foreach (DeviceRemovedEventHandler m_handler in OnDeviceRemoved.GetInvocationList()) { m_handler( this, new OnDeviceRemovedEventArgs( "A device was removed from the local machine.", m_device ) ); } } } } } else { return; // Nothing to do here, so don't bother. } }; if (m_monitorUSB) { m_eventWatcher.Start(); } }
private AndroidController() { this._connectedDevices = new List <string>(); ResourceFolderManager.Register(AndroidControllerTmpFolder); this._resourceDirectory = ResourceFolderManager.GetRegisteredFolderPath(AndroidControllerTmpFolder); }
private XiaomiController() { connectedDevices = new List <string>(); ResourceFolderManager.Register(ANDROID_CONTROLLER_TMP_FOLDER); resourceDirectory = ResourceFolderManager.GetRegisteredFolderPath(ANDROID_CONTROLLER_TMP_FOLDER); }