Skip to content

Commit d463edc

Browse files
author
code3-dev
committed
add sdk 36
1 parent 254587d commit d463edc

File tree

154 files changed

+2952
-2117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+2952
-2117
lines changed

.github/workflows/build-and-release.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ jobs:
3030
flutter-version: '3.32.8'
3131
channel: 'stable'
3232

33+
- name: Create keystore properties file
34+
run: |
35+
echo storePassword=${{ secrets.KEY_STORE_PASSWORD }} > android/key.properties
36+
echo keyPassword=${{ secrets.KEY_PASSWORD }} >> android/key.properties
37+
echo keyAlias=${{ secrets.KEY_ALIAS }} >> android/key.properties
38+
echo storeFile=../keystore.jks >> android/key.properties
39+
shell: bash
40+
41+
- name: Decode Keystore
42+
run: |
43+
echo "${{ secrets.KEY_STORE }}" | certutil -decode - > keystore.jks
44+
shell: cmd
45+
3346
- name: Get dependencies
3447
run: flutter pub get
3548

@@ -78,7 +91,7 @@ jobs:
7891
7992
| Architecture | Download Link |
8093
|-------------|---------------|
81-
| Universal | <a href="https://github.com/code3-dev/ProxyCloud/releases/latest/download/proxycloud-universal.apk"><img src="https://img.shields.io/badge/Android-Universal-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android Universal"></a> |
82-
| armeabi-v7a | <a href="https://github.com/code3-dev/ProxyCloud/releases/latest/download/proxycloud-armeabi-v7a.apk"><img src="https://img.shields.io/badge/Android-armeabi--v7a-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android armeabi-v7a"></a> |
83-
| arm64-v8a | <a href="https://github.com/code3-dev/ProxyCloud/releases/latest/download/proxycloud-arm64-v8a.apk"><img src="https://img.shields.io/badge/Android-arm64--v8a-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android arm64-v8a"></a> |
84-
| x86_64 | <a href="https://github.com/code3-dev/ProxyCloud/releases/latest/download/proxycloud-x86_64.apk"><img src="https://img.shields.io/badge/Android-x86_64-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android x86_64"></a> |
94+
| Universal | <a href="https://github.com/code3-dev/ProxyCloud/releases/download/${{ env.TAG_NAME }}/proxycloud-universal.apk"><img src="https://img.shields.io/badge/Android-Universal-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android Universal"></a> |
95+
| armeabi-v7a | <a href="https://github.com/code3-dev/ProxyCloud/releases/download/${{ env.TAG_NAME }}/proxycloud-armeabi-v7a.apk"><img src="https://img.shields.io/badge/Android-armeabi--v7a-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android armeabi-v7a"></a> |
96+
| arm64-v8a | <a href="https://github.com/code3-dev/ProxyCloud/releases/download/${{ env.TAG_NAME }}/proxycloud-arm64-v8a.apk"><img src="https://img.shields.io/badge/Android-arm64--v8a-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android arm64-v8a"></a> |
97+
| x86_64 | <a href="https://github.com/code3-dev/ProxyCloud/releases/download/${{ env.TAG_NAME }}/proxycloud-x86_64.apk"><img src="https://img.shields.io/badge/Android-x86_64-3DDC84?style=for-the-badge&logo=android&logoColor=white" alt="Android x86_64"></a> |

PING_USAGE_EXAMPLES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ If you're currently using the V2Ray library's ping functionality, migration is s
351351

352352
```dart
353353
// Old way (V2Ray library)
354-
final delay = await flutterV2ray.getServerDelay(config: config);
354+
final delay = await V2ray.getServerDelay(config: config);
355355
356356
// New way (maintains compatibility)
357357
final delay = await v2rayService.getServerDelay(config);

android/app/build.gradle.kts

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1+
import java.io.FileInputStream
2+
import java.util.Properties
3+
14
plugins {
25
id("com.android.application")
36
id("kotlin-android")
47
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
58
id("dev.flutter.flutter-gradle-plugin")
69
}
710

11+
// Load keystore properties
12+
val keystorePropertiesFile = rootProject.file("key.properties")
13+
val keystoreProperties = Properties()
14+
if (keystorePropertiesFile.exists()) {
15+
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
16+
}
17+
818
android {
919
namespace = "com.cloud.pira"
10-
compileSdk = flutter.compileSdkVersion
20+
compileSdk = 36
1121
ndkVersion = "27.0.12077973"
1222

1323
compileOptions {
@@ -19,22 +29,49 @@ android {
1929
jvmTarget = JavaVersion.VERSION_11.toString()
2030
}
2131

32+
signingConfigs {
33+
create("release") {
34+
keyAlias = keystoreProperties.getProperty("keyAlias") ?: "androiddebugkey"
35+
keyPassword = keystoreProperties.getProperty("keyPassword") ?: "android"
36+
storeFile = file(keystoreProperties.getProperty("storeFile") ?: "keystore/debug.keystore")
37+
storePassword = keystoreProperties.getProperty("storePassword") ?: "android"
38+
}
39+
}
40+
2241
defaultConfig {
23-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
2442
applicationId = "com.cloud.pira"
25-
// You can update the following values to match your application needs.
26-
// For more information, see: https://flutter.dev/to/review-gradle-config.
2743
minSdk = flutter.minSdkVersion
2844
targetSdk = flutter.targetSdkVersion
29-
versionCode = 34
30-
versionName = "3.4.0"
45+
versionCode = 35
46+
versionName = "3.4.5"
47+
48+
manifestPlaceholders.put("io.flutter.embedding.android.EnableImpeller", "false")
49+
}
50+
51+
packagingOptions {
52+
jniLibs {
53+
useLegacyPackaging = true
54+
}
55+
}
56+
57+
splits {
58+
abi {
59+
isEnable = true
60+
reset()
61+
include("x86_64", "armeabi-v7a", "arm64-v8a")
62+
isUniversalApk = true
63+
}
3164
}
3265

3366
buildTypes {
34-
release {
35-
// TODO: Add your own signing config for the release build.
36-
// Signing with the debug keys for now, so `flutter run --release` works.
37-
signingConfig = signingConfigs.getByName("debug")
67+
getByName("release") {
68+
signingConfig = signingConfigs.getByName("release")
69+
isMinifyEnabled = false
70+
isShrinkResources = false
71+
ndk {
72+
abiFilters.addAll(listOf("x86_64", "armeabi-v7a", "arm64-v8a"))
73+
debugSymbolLevel = "FULL"
74+
}
3875
}
3976
}
4077
}
@@ -45,4 +82,4 @@ flutter {
4582

4683
dependencies {
4784
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
48-
}
85+
}

android/app/src/main/AndroidManifest.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
22
<!-- VPN permissions -->
33
<uses-permission android:name="android.permission.INTERNET" />
44
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
55
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
6-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
6+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" tools:targetApi="34" />
77
<uses-permission android:name="android.permission.WAKE_LOCK" />
88
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
99
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
1010
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
11-
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
11+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" tools:targetApi="33" />
1212
<!-- Battery optimization permission -->
1313
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
1414
<application
1515
android:label="Proxy Cloud"
1616
android:name="${applicationName}"
17-
android:icon="@mipmap/ic_launcher">
17+
android:icon="@mipmap/ic_launcher"
18+
android:enableOnBackInvokedCallback="true"
19+
android:networkSecurityConfig="@xml/network_security_config">
1820
<activity
1921
android:name=".MainActivity"
2022
android:exported="true"
@@ -50,6 +52,9 @@
5052
<meta-data
5153
android:name="flutterEmbedding"
5254
android:value="2" />
55+
<meta-data
56+
android:name="io.flutter.embedding.android.EnableImpeller"
57+
android:value="false" />
5358
</application>
5459
<!-- Required to query activities that can process text, see:
5560
https://developer.android.com/training/package-visibility and
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<network-security-config>
3+
<!-- Default: disallow cleartext traffic -->
4+
<base-config cleartextTrafficPermitted="false" />
5+
</network-security-config>

lib/models/app_update.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class AppUpdate {
66
final String messText;
77

88
// Current app version - manually set
9-
static const String currentAppVersion = '3.4.0';
9+
static const String currentAppVersion = '3.4.5';
1010

1111
AppUpdate({required this.version, required this.url, required this.messText});
1212

lib/providers/v2ray_provider.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:flutter/widgets.dart';
2-
import 'package:flutter_v2ray/flutter_v2ray.dart';
2+
import 'package:flutter_v2ray_client/flutter_v2ray.dart';
33
import '../models/v2ray_config.dart';
44
import '../models/subscription.dart';
55
import '../services/v2ray_service.dart';

lib/screens/about_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class AboutScreen extends StatelessWidget {
6464
Text(
6565
context.tr(
6666
TranslationKeys.aboutVersion,
67-
parameters: {'version': '3.4.0'},
67+
parameters: {'version': '3.4.5'},
6868
),
6969
style: const TextStyle(fontSize: 16, color: Colors.grey),
7070
),

lib/services/server_service.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'dart:convert';
22
import 'package:http/http.dart' as http;
33
import '../models/v2ray_config.dart';
44
import 'package:flutter/foundation.dart';
5-
import 'package:flutter_v2ray/flutter_v2ray.dart';
5+
import 'package:flutter_v2ray_client/flutter_v2ray.dart';
66

77
class ServerService {
88
// Default GitHub URL for server configurations
@@ -100,13 +100,13 @@ class ServerService {
100100
'Parsing URI: ${uri.substring(0, uri.length > 30 ? 30 : uri.length)}...',
101101
);
102102

103-
// Use FlutterV2ray to parse the URL
103+
// Use V2ray to parse the URL
104104
if (uri.startsWith('vmess://') ||
105105
uri.startsWith('vless://') ||
106106
uri.startsWith('trojan://') ||
107107
uri.startsWith('ss://')) {
108108
try {
109-
V2RayURL parser = FlutterV2ray.parseFromURL(uri);
109+
V2RayURL parser = V2ray.parseFromURL(uri);
110110
String configType = '';
111111

112112
if (uri.startsWith('vmess://')) {
@@ -124,7 +124,7 @@ class ServerService {
124124
int port = parser.port;
125125

126126
debugPrint(
127-
'Parsed URI with FlutterV2ray: remark=${parser.remark}, address=$address, port=$port',
127+
'Parsed URI with V2ray: remark=${parser.remark}, address=$address, port=$port',
128128
);
129129

130130
return V2RayConfig(
@@ -136,7 +136,7 @@ class ServerService {
136136
fullConfig: uri,
137137
);
138138
} catch (e) {
139-
debugPrint('Error parsing with FlutterV2ray: $e');
139+
debugPrint('Error parsing with V2ray: $e');
140140
return null;
141141
}
142142
}

lib/services/v2ray_service.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'dart:convert';
22
import 'dart:async';
33
import 'dart:math';
4-
import 'package:flutter_v2ray/flutter_v2ray.dart';
4+
import 'package:flutter_v2ray_client/flutter_v2ray.dart';
55
import 'package:http/http.dart' as http;
66
import 'package:shared_preferences/shared_preferences.dart';
77
import 'package:proxycloud/models/v2ray_config.dart';
@@ -123,14 +123,14 @@ class V2RayService extends ChangeNotifier {
123123
static final V2RayService _instance = V2RayService._internal();
124124
factory V2RayService() => _instance;
125125

126-
late final FlutterV2ray _flutterV2ray;
126+
late final V2ray _flutterV2ray;
127127

128128
// Current V2Ray status from the callback
129129
V2RayStatus? _currentStatus;
130130
V2RayStatus? get currentStatus => _currentStatus;
131131

132132
V2RayService._internal() {
133-
_flutterV2ray = FlutterV2ray(
133+
_flutterV2ray = V2ray(
134134
onStatusChanged: (status) {
135135
print('V2Ray status changed: $status');
136136
_currentStatus = status;
@@ -174,7 +174,7 @@ class V2RayService extends ChangeNotifier {
174174

175175
Future<void> initialize() async {
176176
if (!_isInitialized) {
177-
await _flutterV2ray.initializeV2Ray(
177+
await _flutterV2ray.initialize(
178178
notificationIconResourceType: "mipmap",
179179
notificationIconResourceName: "ic_launcher",
180180
);
@@ -190,7 +190,7 @@ class V2RayService extends ChangeNotifier {
190190
await initialize();
191191

192192
// Parse the configuration
193-
V2RayURL parser = FlutterV2ray.parseFromURL(config.fullConfig);
193+
V2RayURL parser = V2ray.parseFromURL(config.fullConfig);
194194

195195
// Request permission if needed (for VPN mode)
196196
bool hasPermission = await _flutterV2ray.requestPermission();
@@ -520,7 +520,7 @@ class V2RayService extends ChangeNotifier {
520520
try {
521521
await initialize();
522522

523-
final parser = FlutterV2ray.parseFromURL(config.fullConfig);
523+
final parser = V2ray.parseFromURL(config.fullConfig);
524524
final delay = await _flutterV2ray
525525
.getServerDelay(config: parser.getFullConfiguration())
526526
.timeout(
@@ -605,7 +605,7 @@ class V2RayService extends ChangeNotifier {
605605
line.startsWith('vless://') ||
606606
line.startsWith('trojan://') ||
607607
line.startsWith('ss://')) {
608-
V2RayURL parser = FlutterV2ray.parseFromURL(line);
608+
V2RayURL parser = V2ray.parseFromURL(line);
609609
String configType = '';
610610

611611
if (line.startsWith('vmess://')) {
@@ -939,7 +939,7 @@ class V2RayService extends ChangeNotifier {
939939
Future<V2RayConfig?> parseSubscriptionConfig(String configText) async {
940940
try {
941941
// Try to parse as a V2Ray URL
942-
final parser = FlutterV2ray.parseFromURL(configText);
942+
final parser = V2ray.parseFromURL(configText);
943943

944944
// Determine the protocol type from the URL prefix
945945
String configType = '';

0 commit comments

Comments
 (0)