示例#1
0
        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));
            }
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        //! 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));
            }
        }
示例#5
0
        //! 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));
            }
        }
示例#6
0
        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));
            }
        }