新聞中心

        EEPW首頁 > 嵌入式系統 > 設計應用 > Android常見錯誤匯總

        Android常見錯誤匯總

        作者: 時間:2016-10-08 來源:網絡 收藏

        out.write(buffer, 0, read);

        }

        }

        24.判斷是否有root權限

        [java] view plaincopyprint?

        public static synchronized boolean getRootAhth()

        {

        Process process = null;

        DataOutputStream os = null;

        try

        {

        process = Runtime.getRuntime().exec(su);

        os = new DataOutputStream(process.getOutputStream());

        os.writeBytes(exitn);

        os.flush();

        int exitValue = process.waitFor();

        if (exitValue == 0)

        {

        return true;

        } else

        {

        return false;

        }

        } catch (Exception e)

        {

        Log.d(*** DEBUG ***, Unexpected error - Here is what I know:

        + e.getMessage());

        return false;

        } finally

        {

        try

        {

        if (os != null)

        {

        os.close();

        }

        process.destroy();

        } catch (Exception e)

        {

        e.printStackTrace();

        }

        }

        }

        25.最簡單的Root 模擬器的方法

        啟動一個模擬器,開始-運行-輸入cmd,打開dos,依次輸入

        adb shell

        mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

        cd /system/bin

        cat sh > su

        chmod 4755 su

        su

        即可獲得root權限


        上一頁 1 2 3 下一頁

        關鍵詞:

        評論


        相關推薦

        技術專區

        關閉
        主站蜘蛛池模板: 南漳县| 环江| 黄山市| 泽普县| 永登县| 安远县| 噶尔县| 长武县| 阜新| 昌邑市| 涟源市| 贡嘎县| 曲靖市| 安多县| 桂东县| 河津市| 山东省| 柏乡县| 乌恰县| 怀集县| 宜黄县| 三明市| 中宁县| 醴陵市| 明星| 望城县| 涞水县| 昭苏县| 普陀区| 南汇区| 开平市| 徐水县| 东山县| 东莞市| 汉沽区| 铁岭市| 阳高县| 连江县| 宝应县| 湖州市| 如皋市|