Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for MIUI Security #35

Open
rafis opened this issue Dec 7, 2015 · 0 comments
Open

Support for MIUI Security #35

rafis opened this issue Dec 7, 2015 · 0 comments

Comments

@rafis
Copy link

rafis commented Dec 7, 2015

Then I'm trying to Start service with "Execute as Super User" set, it says "Your terminal is not rooted properly. Please correct this or try disabling su usage from preferences.". But this check in checkRoot() is just check. Is it possible to look if application is running under MIUI and if it is then replace this simple check by syscall which asking root access wrapping it in try/catch block. I've never developed for Android or Java, I'm PHP developer, but maybe this can accomplish task:

String version = System.getProperty("os.version");
if (version.contains("MIUI"))
{
    try
    {
         Process root = Runtime.getRuntime().exec("su");
         return true;
    }
    catch(Exception e)
    {
         return false;
    }
}
else
{
    if (_service != null && _service._useSU)
    {
        // Ensure su is working correctly, as some implementations do simply nothing, without error...
        String aOut = Tools.ToString(Tools.Run("su", "id"));
        return (aOut.length() >= 5 && aOut.substring(0, 5).equals("uid=0"));
    }
    return true;
}

This is required for MIUI su application called "Security". This application detects such calls and later allows a user to give such applications root rights. Tinc GUI doesn't appearing there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant