Change warp options
This commit is contained in:
@@ -457,7 +457,7 @@ class FFISingboxService with InfraLogger implements SingboxService {
|
||||
}
|
||||
|
||||
@override
|
||||
TaskEither<String, WarpAccount> generateWarpConfig({
|
||||
TaskEither<String, WarpResponse> generateWarpConfig({
|
||||
required String licenseKey,
|
||||
required String previousAccountId,
|
||||
required String previousAccessToken,
|
||||
@@ -477,20 +477,7 @@ class FFISingboxService with InfraLogger implements SingboxService {
|
||||
if (response.startsWith("error:")) {
|
||||
return left(response.replaceFirst('error:', ""));
|
||||
}
|
||||
if (jsonDecode(response)
|
||||
case {
|
||||
"account-id": final String newAccountId,
|
||||
"access-token": final String newAccessToken,
|
||||
}) {
|
||||
return right(
|
||||
WarpAccount(
|
||||
licenseKey: licenseKey,
|
||||
accountId: newAccountId,
|
||||
accessToken: newAccessToken,
|
||||
),
|
||||
);
|
||||
}
|
||||
return left("invalid response");
|
||||
return right(warpFromJson(jsonDecode(response)));
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@@ -266,7 +266,7 @@ class PlatformSingboxService with InfraLogger implements SingboxService {
|
||||
}
|
||||
|
||||
@override
|
||||
TaskEither<String, WarpAccount> generateWarpConfig({
|
||||
TaskEither<String, WarpResponse> generateWarpConfig({
|
||||
required String licenseKey,
|
||||
required String previousAccountId,
|
||||
required String previousAccessToken,
|
||||
@@ -282,20 +282,7 @@ class PlatformSingboxService with InfraLogger implements SingboxService {
|
||||
"previous-access-token": previousAccessToken,
|
||||
},
|
||||
);
|
||||
if (jsonDecode(warpConfig as String)
|
||||
case {
|
||||
"account-id": final String newAccountId,
|
||||
"access-token": final String newAccessToken,
|
||||
}) {
|
||||
return right(
|
||||
WarpAccount(
|
||||
licenseKey: licenseKey,
|
||||
accountId: newAccountId,
|
||||
accessToken: newAccessToken,
|
||||
),
|
||||
);
|
||||
}
|
||||
return left("invalid response");
|
||||
return right(warpFromJson(jsonDecode(warpConfig as String)));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ abstract interface class SingboxService {
|
||||
|
||||
TaskEither<String, Unit> clearLogs();
|
||||
|
||||
TaskEither<String, WarpAccount> generateWarpConfig({
|
||||
TaskEither<String, WarpResponse> generateWarpConfig({
|
||||
required String licenseKey,
|
||||
required String previousAccountId,
|
||||
required String previousAccessToken,
|
||||
|
||||
Reference in New Issue
Block a user