mirror of
https://github.com/2dust/v2rayNG.git
synced 2026-06-05 21:04:47 +08:00
Fix https://github.com/2dust/v2rayNG/issues/5619 (#5632)
Some checks failed
Validate Fastlane metadata / go (push) Has been cancelled
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:
parent
1cc0865411
commit
bb5e6f1959
@ -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) ->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user