Fix https://github.com/2dust/v2rayNG/issues/5619 (#5632)
Some checks failed
Validate Fastlane metadata / go (push) Has been cancelled

Added "Level 0" matching to perform a full check of remarks, server, port, and password before falling back to partial matches. This ensures that identical profiles with the same remarks are correctly identified
This commit is contained in:
skl256 2026-05-13 13:48:22 +03:00 committed by GitHub
parent 1cc0865411
commit bb5e6f1959
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -311,6 +311,16 @@ object AngConfigManager {
private fun findMatchedProfileKey(keyToProfile: Map<String, ProfileItem>, target: ProfileItem?): String? {
if (keyToProfile.isEmpty() || target == null) return null
// Level 0: Full match (remarks + server + port + password)
if (target.remarks.isNotBlank()) {
keyToProfile.entries.firstOrNull { (_, saved) ->
isSameText(saved.remarks, target.remarks) &&
isSameText(saved.server, target.server) &&
isSameText(saved.serverPort, target.serverPort) &&
isSameText(saved.password, target.password)
}?.key?.let { return it }
}
// Level 1: Match by remarks
if (target.remarks.isNotBlank()) {
keyToProfile.entries.firstOrNull { (_, saved) ->