Setting system time of ROOTED phone

后端 未结 2 1331
青春惊慌失措
青春惊慌失措 2020-11-29 02:39

I am currently trying to set Android system time in software. Yes, I know that many people tried it - and failed like I do now. :-)

But I also know that it is possib

2条回答
  •  北海茫月
    2020-11-29 03:02

    you can set system Date and time on rooted device like this

    public void setDate()
        {
            try {
                Process process = Runtime.getRuntime().exec("su");
            DataOutputStream os = new DataOutputStream(process.getOutputStream());
                os.writeBytes("date -s 20120419.024012; \n");
            } catch (Exception e) {
                Log.d(TAG,"error=="+e.toString());
                e.printStackTrace();
            }
        } 
    

提交回复
热议问题