tinc_gui icon indicating copy to clipboard operation
tinc_gui copied to clipboard

Support for MIUI Security

Open rafis opened this issue 9 years ago • 0 comments

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.

rafis avatar Dec 07 '15 07:12 rafis