Chrisplus/RootManager

Timeout Exception Occur, How to run command continue in backgeound

Opened this issue · 3 comments

i am tring to get Hash Value, but it always return me status code 0 and message is nothing.
Please check code below.'

 val hashValue: StringBuilder = StringBuilder()
        val hashCommand = RootManager.getInstance().runCommand("md5sum $path")
        hashValue.append("MD5 : ${hashCommand.message}")
        Log.d("getHash","Hash Message : "+hashCommand.message)
        Log.d("getHash","Hash Status Code : "+hashCommand.statusCode)
        Log.d("getHash","Hash Result : "+hashCommand.result)

Hi,

Thanks for reporting. May I know if you have granted SU permission before run this command?

Yes, I root the device and give superuser permission granted.
its working well with 8GB Pendrive within 4 minutes it gives a result.
but for a long time process such as 1TB HDD, it returns timeout exception.

@VikramSN Hi, current the default command timeout is 5 min, please refer to

public static final int COMMAND_TIMEOUT = 1000 * 60 * 5;

Command commandImpl = new Command(command) {

You may fork this repo and change the default timeout setting.

Thanks.