package com.tcl.factory.utils;

import com.tcl.seeker.RootSeeker;

import android.content.Context;
import android.os.SystemProperties;

public class RootSeekerHelper {
    private static final String rootSeekerProp = "ro.build.version.tvkit_seeker";
    public static final String targetRootSeekerVersion = "3";
    public static final String DefaultRootSeekerVersion = "0";
    public static final int SUCCESS = 0;
    private Context mContext;
    private String mAccessKey;
    private String currentRootSeekerVersion;

    public RootSeekerHelper(Context context, String accessKey) {
        this.mContext = context;
        this.mAccessKey = accessKey;
        currentRootSeekerVersion = getRootSeekerVersion();
    }

    public int exec(String cmdStr) {
        int ret;
//		if(targetRootSeekerVersion.equals(currentRootSeekerVersion)){
//			ret =RootSeeker.exec(mContext,mAccessKey,cmdStr);
//		}else{
//			ret = RootSeeker.exec(cmdStr);
//		}
        ret = RootSeeker.exec(cmdStr);
        return ret;
    }

    public static String getRootSeekerVersion() {
        return SystemProperties.get(rootSeekerProp, DefaultRootSeekerVersion);
    }
}
