void KiLLServer() { string comment = "kill-server"; RESULT_PROCESS PointerProcess = new ADBBridge().exec(comment); //! jika error code bukan 0 berarti error dan error nya adaalah if (PointerProcess.code != 0) { throw new Exception(string.Format("error code:{0} - message {1} ", PointerProcess.code, PointerProcess.error)); } }
public virtual string InitDevices() { string comment = "devices"; RESULT_PROCESS PointerProcess = new ADBBridge().exec(comment); //! jika error code bukan 0 berarti error dan error nya adaalah if (PointerProcess.code != 0) { throw new Exception(string.Format("error code:{0} - message {1} ", PointerProcess.code, PointerProcess.error)); } //! return empty jika tidak ada device yang terdetect return(PointerProcess.output = string.IsNullOrEmpty(PointerProcess.output) ? PointerProcess.output : string.Empty); }
public virtual string ConnectDevice() { string commentconnect = "connect"; string[] comment = { commentconnect, string.Format("{0}:{1}", ip, port) }; RESULT_PROCESS PointerProcess = new ADBBridge().exec(comment); //! jika error code bukan 0 berarti error dan error nya adaalah if (PointerProcess.code != 0) { throw new Exception(string.Format("error code:{0} - message {1} ", PointerProcess.code, PointerProcess.error)); } //! return connected return(PointerProcess.output = string.IsNullOrEmpty(PointerProcess.output) ? PointerProcess.output : string.Empty); }
//! path contoh data/data or system or data //! no return public virtual void Remount(string path) { string[] comment = { s , string.Format("{0}:{1}", ip, port) , shell , remount , string.Format("/{0}", path) }; RESULT_PROCESS PointerProcess = new ADBBridge().exec(comment); //! jika error code bukan 0 berarti error dan error nya adaalah if (PointerProcess.code != 0) { throw new Exception(string.Format("error code:{0} - message {1} ", PointerProcess.code, PointerProcess.error)); } }
//! remove file //! data/data/simplehat.clicker public virtual void Remove(string fileremove, int timeout) { string[] comment = { s , string.Format("{0}:{1}", ip, port) , shell , "rm" , "-rf" , string.Format("/{0}", fileremove) , string.Format("timeout {0}", timeout) }; RESULT_PROCESS PointerProcess = new ADBBridge().exec(comment); //! jika error code bukan 0 berarti error dan error nya adaalah if (PointerProcess.code != 0) { throw new Exception(string.Format("error code:{0} - message {1} ", PointerProcess.code, PointerProcess.error)); } }
public virtual void Lancher(string gamepath) { string commentlancher = "android.intent.category.LAUNCHER 1"; string[] comment = { s , string.Format("{0}:{1}", ip, port) , shell , "monkey" , "-p" , string.Format("{0}", gamepath) , "-c" , commentlancher }; RESULT_PROCESS PointerProcess = new ADBBridge().exec(comment); //! jika error code bukan 0 berarti error dan error nya adaalah if (PointerProcess.code != 0) { throw new Exception(string.Format("error code:{0} - message {1} ", PointerProcess.code, PointerProcess.error)); } }