Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c1ee28a
Add localized support and clean up with flutter analyze
WishyutC Apr 22, 2025
8b04e8b
Merge branch 'development' of https://github.com/VPNclient/VPNclient-…
WishyutC Apr 22, 2025
f5f79a8
fix quality check
WishyutC Apr 22, 2025
477f4e9
Add localized support and clean up with flutter analyze
WishyutC Apr 22, 2025
fe783f0
fix quality check
WishyutC Apr 22, 2025
54752f1
Add run key in quality test
pkongkha Apr 23, 2025
febd7e6
Fix merge conflict leftover
pkongkha Apr 23, 2025
ebe9b3c
Merge branch 'development' of https://github.com/VPNclient/VPNclient-…
WishyutC Apr 23, 2025
ab280ca
Add flutter gen-l10n
WishyutC Apr 23, 2025
6ce5696
Adding gen-l10n
WishyutC Apr 23, 2025
12353eb
Add Chinese localization
WishyutC Apr 23, 2025
3476968
Add Chinese localization v.2
WishyutC Apr 23, 2025
7b01b75
Add flutter test
WishyutC Apr 23, 2025
8c35000
Add flutter test + dart format
WishyutC Apr 23, 2025
4d9b806
server
Anton-Dodonov Apr 25, 2025
1e05e96
ios vpn
Anton-Dodonov Apr 25, 2025
83aa929
ios vpn
Anton-Dodonov Apr 25, 2025
93eccd7
ios vpn
Anton-Dodonov Apr 25, 2025
ed48c55
ios vpn
Anton-Dodonov Apr 25, 2025
cd7da3d
ios vpn
Anton-Dodonov Apr 25, 2025
ade5d48
last
Anton-Dodonov Apr 28, 2025
72e389e
Merge bugfix/auto-generated-localization into development
pkongkha Apr 28, 2025
18c44a2
Retrieve dependency from GitHub
pkongkha Apr 28, 2025
e616d82
Run dart format
pkongkha Apr 28, 2025
9d2a9e0
Run flutter pub get
pkongkha Apr 28, 2025
5a552d5
Enable synthetic-package as workaround
pkongkha Apr 28, 2025
e656696
Set l10n synthetic-package to false
pkongkha Apr 28, 2025
03288b7
localize to source
WishyutC Apr 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
- run: flutter pub get
- run: dart format --set-exit-if-changed .
- run: flutter analyze
- run: flutter test
- name: Run Dart Code Metrics
run: |
dart pub global activate dart_code_metrics
dart pub global run dart_code_metrics:metrics analyze lib
1 change: 1 addition & 0 deletions build_android.sh
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
flutter build appbundle
flutter build apk
3 changes: 3 additions & 0 deletions devtools_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
6 changes: 6 additions & 0 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
2BABBD1CBB549C229028E3E6 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3AC403B42DBB3FD400E35EC1 /* RunnerRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerRelease.entitlements; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
40D432E32B669D72F284E50A /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
474E7930403F702C7244270A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -143,6 +144,7 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
3AC403B42DBB3FD400E35EC1 /* RunnerRelease.entitlements */,
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -680,6 +682,9 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 6XT4R7V83F;
ENABLE_BITCODE = NO;
Expand All @@ -691,6 +696,7 @@
MARKETING_VERSION = 1.0.5;
PRODUCT_BUNDLE_IDENTIFIER = vpnclient.click;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down
37 changes: 37 additions & 0 deletions ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
import Flutter
import UIKit
///VPN
///import Foundation
import NetworkExtension

class VpnConfigurator {
static func setupTunnel() {
let manager = NEVPNManager.shared()
manager.loadFromPreferences { error in
if let error = error {
print("Failed to load VPN preferences: \(error)")
return
}

let proto = NETunnelProviderProtocol()
proto.providerBundleIdentifier = "com.vpnclient.VPNclientTunnel"
proto.serverAddress = "VPNclient"

manager.protocolConfiguration = proto
manager.localizedDescription = "VPNclient"
manager.isEnabled = true

manager.saveToPreferences { error in
if let error = error {
print("Failed to save VPN configuration: \(error)")
} else {
print("VPN configuration saved successfully.")
}
}
}
}
}
///VPN



@main
@objc class AppDelegate: FlutterAppDelegate {
Expand All @@ -8,6 +42,9 @@ import UIKit
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
///vpn
VpnConfigurator.setupTunnel()
///vpn
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
18 changes: 18 additions & 0 deletions ios/Runner/RunnerRelease.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.networking.networkextension</key>
<array>
<string>dns-settings</string>
<string>packet-tunnel-provider</string>
<string>dns-proxy</string>
<string>app-proxy-provider</string>
<string>content-filter-provider</string>
</array>
<key>com.apple.developer.networking.vpn.api</key>
<array>
<string>allow-vpn</string>
</array>
</dict>
</plist>
4 changes: 4 additions & 0 deletions l10n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
synthetic-package: false
arb-dir: lib/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
2 changes: 1 addition & 1 deletion lib/design/colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ final ThemeData darkTheme = ThemeData(
final LinearGradient mainGradient = LinearGradient(
colors: [Color(0xFF00C6FB), Color(0xFF005BEA)],
begin: Alignment.topCenter,
end: Alignment.bottomCenter
end: Alignment.bottomCenter,
);
18 changes: 15 additions & 3 deletions lib/design/custom_icons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@ class CustomIcons {
static const _kFontFam = 'CustomIcons';
static const String? _kFontPkg = null;

static const IconData ping = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData download = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData upload = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData ping = IconData(
0xe800,
fontFamily: _kFontFam,
fontPackage: _kFontPkg,
);
static const IconData download = IconData(
0xe801,
fontFamily: _kFontFam,
fontPackage: _kFontPkg,
);
static const IconData upload = IconData(
0xe802,
fontFamily: _kFontFam,
fontPackage: _kFontPkg,
);
}
73 changes: 68 additions & 5 deletions lib/design/dimensions.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,71 @@
// text
const String connectionStatusConnected = 'ПОДКЛЮЧЕН';
const String connectionStatusDisconnected = 'ОТКЛЮЧЕН';
const String connectionStatusConnecting = 'ПОДКЛЮЧЕНИЕ';
const String connectionStatusDisconnecting = 'ОТКЛЮЧЕНИЕ';
import 'package:flutter/material.dart';

class CustomString {
final BuildContext context;
late Locale locale;

CustomString(this.context) {
locale = Localizations.localeOf(context);
}

String get connected {
return _localized('connected');
}

String get disconnected {
return _localized('disconnected');
}

String get connecting {
return _localized('connecting');
}

String get disconnecting {
return _localized('disconnecting');
}

String get allapp {
return _localized('all_apps');
}

String _localized(String key) {
switch (locale.languageCode) {
case 'ru':
return {
'connected': 'ПОДКЛЮЧЕН',
'disconnected': 'ОТКЛЮЧЕН',
'connecting': 'ПОДКЛЮЧЕНИЕ',
'disconnecting': 'ОТКЛЮЧЕНИЕ',
"all_apps": "Все приложения",
}[key]!;
case 'th':
return {
"connected": "เชื่อมต่อแล้ว",
"disconnected": "ไม่ได้เชื่อมต่อ",
"connecting": "กำลังเชื่อมต่อ",
"disconnecting": "กำลังตัดการเชื่อมต่อ",
"all_apps": "แอปทั้งหมด",
}[key]!;
case 'zh':
return {
"connected": "已连接",
"disconnected": "已断开",
"connecting": "正在连接",
"disconnecting": "正在断开",
"all_apps": "所有应用",
}[key]!;
case 'en':
default:
return {
'connected': 'CONNECTED',
'disconnected': 'DISCONNECTED',
'connecting': 'CONNECTING',
'disconnecting': 'DISCONNECTING',
"all_apps": "All Applications",
}[key]!;
}
}
}

// style
const double elevation0 = 0;
Expand Down
14 changes: 10 additions & 4 deletions lib/design/images.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import 'package:flutter_svg/flutter_svg.dart';

final SvgPicture homeIcon = SvgPicture.asset('assets/images/home.svg');
final SvgPicture activeHomeIcon = SvgPicture.asset('assets/images/active_home.svg');
final SvgPicture activeHomeIcon = SvgPicture.asset(
'assets/images/active_home.svg',
);
final SvgPicture appIcon = SvgPicture.asset('assets/images/app.svg');
final SvgPicture activeAppIcon = SvgPicture.asset('assets/images/active_app.svg');
final SvgPicture activeAppIcon = SvgPicture.asset(
'assets/images/active_app.svg',
);
final SvgPicture serverIcon = SvgPicture.asset('assets/images/server.svg');
final SvgPicture activeServerIcon = SvgPicture.asset('assets/images/active_server.svg');
final SvgPicture activeServerIcon = SvgPicture.asset(
'assets/images/active_server.svg',
);
final SvgPicture settingsIcon = SvgPicture.asset('assets/images/settings.svg');
final SvgPicture speedIcon = SvgPicture.asset('assets/images/speed.svg');
final SvgPicture deFlag = SvgPicture.asset('assets/images/de.svg');
final SvgPicture deFlag = SvgPicture.asset('assets/images/de.svg');
31 changes: 31 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"@@locale": "en",
"app_name": "VPN Client",
"apps_selection": "App Selection",
"search": "Search",
"your_location": "Your Location",
"auto_select": "Auto Select",
"kazakhstan": "Kazakhstan",
"turkey": "Turkey",
"poland": "Poland",
"fastest": "Fastest",
"selected_server": "Selected server",
"server_selection": "Server selection",
"all_servers": "All servers",
"country_name": "Country name",
"all_apps": "All Applications",
"done": "Done",
"cancel": "Cancel",
"recently_searched": "Recently searched",
"nothing_found": "Nothing found",
"connected": "CONNECTED",
"disconnected": "DISCONNECTED",
"connecting": "CONNECTING",
"disconnecting": "DISCONNECTING"





}

Loading
Loading