package com.github.shiraji.permissionsdispatcherplugin.data

class AndroidGradleVersion(versionText: String) {
    private var major: Int
    private var minor: Int

    init {
        try {
            major = versionText.substringBefore(".").toInt()
            minor = versionText.substring(versionText.indexOf(".") + 1, versionText.lastIndexOf(".")).toInt()
        } catch (e: NumberFormatException) {
            major = -1
            minor = -1
        }
    }

    fun isHigherThan2_2() = major >= 2 && minor >= 2

    fun isValid() = major >= 0 && minor >= 0
}
package com.github.shiraji.permissionsdispatcherplugin.data

class AndroidGradleVersion(versionText: String) {
    private var major: Int
    private var minor: Int

    init {
        try {
            major = versionText.substringBefore(".").toInt()
            minor = versionText.substring(versionText.indexOf(".") + 1, versionText.lastIndexOf(".")).toInt()
        } catch (e: NumberFormatException) {
            major = -1
            minor = -1
        }
    }

    fun isHigherThan2_2() = major > 2 || major == 2 && minor >= 2

    fun isValid() = major >= 0 && minor >= 0
}
Fix the problem with version check logic
Fix the problem with version check logic

shiraji/permissions-dispatcher-plugin,shiraji/permissions-dispatcher-plugin,shiraji/permissions-dispatcher-plugin