diff --git a/accessibility-api/src/main/java/cn/vove7/andro_accessibility_api/AppScope.kt b/accessibility-api/src/main/java/cn/vove7/andro_accessibility_api/AppScope.kt index ffa8ab7..2f4501b 100644 --- a/accessibility-api/src/main/java/cn/vove7/andro_accessibility_api/AppScope.kt +++ b/accessibility-api/src/main/java/cn/vove7/andro_accessibility_api/AppScope.kt @@ -7,7 +7,7 @@ package cn.vove7.andro_accessibility_api * @property pageName String class name of Activity or Dialog * @constructor */ -class AppScope( +data class AppScope( var packageName: String, var pageName: String ) { @@ -15,12 +15,18 @@ class AppScope( if (other == null || other !is AppScope) return false return packageName.startsWith(other.packageName) && - pageName == other.pageName || + (pageName == other.pageName || pageName.isEmpty() || other.pageName.isEmpty() || pageName.endsWith("." + other.pageName) || pageName.endsWith("$" + other.pageName) || other.pageName.endsWith(".$pageName") || - other.pageName.endsWith("$$pageName") + other.pageName.endsWith("$$pageName")) } + + override fun hashCode(): Int { + var result = packageName.hashCode() + result = 31 * result + pageName.hashCode() + return result + } } \ No newline at end of file