Skip to content

Commit e00d0bb

Browse files
author
code3-dev
committed
add xhttp
1 parent 4cd0b3e commit e00d0bb

89 files changed

Lines changed: 618 additions & 2983 deletions

File tree

Some content is hidden

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

android/app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ android {
4242
applicationId = "com.cloud.pira"
4343
minSdk = flutter.minSdkVersion
4444
targetSdk = flutter.targetSdkVersion
45-
versionCode = 36
46-
versionName = "3.5.0"
45+
versionCode = 37
46+
versionName = "3.5.5"
4747

4848
manifestPlaceholders.put("io.flutter.embedding.android.EnableImpeller", "false")
4949
}

assets/languages/ar.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@
514514
},
515515
"persian_gulf": {
516516
"title": "الخليج الفارسي",
517-
"message": "هذه هي الخليج الفارسي - كانت وستبقى",
517+
"message": "هذه هي الخليج الفارسي، كانت وستبقى",
518518
"card_title": "الخليج الفارسي للأبد"
519519
},
520520
"ircf": {

assets/languages/fa.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@
507507
},
508508
"persian_gulf": {
509509
"title": "خلیج فارس",
510-
"message": "اینجا خلیج فارس بوده - هست و خواهد ماند",
510+
"message": "اینجا خلیج فارس بوده، هست و خواهد ماند",
511511
"card_title": "خلیج فارس برای همیشه"
512512
},
513513
"ircf": {

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.5.0';
9+
static const String currentAppVersion = '3.5.5';
1010

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

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.5.0'},
67+
parameters: {'version': '3.5.5'},
6868
),
6969
style: const TextStyle(fontSize: 16, color: Colors.grey),
7070
),

lib/screens/privacy_welcome_screen.dart

Lines changed: 4 additions & 181 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class _PrivacyWelcomeScreenState extends State<PrivacyWelcomeScreen> {
2222
final PageController _pageController = PageController();
2323
int _currentPage = 0;
2424
final int _totalPages =
25-
8; // Increased to accommodate channels, sponsors, and Persian Gulf pages
25+
7; // Reduced to remove background access page, now accommodating channels, sponsors, and Persian Gulf pages
2626
bool _acceptedPrivacy = false;
27-
bool _backgroundAccessHandled = false;
27+
2828
AppLanguage? _selectedLanguage;
2929

3030
@override
@@ -74,15 +74,10 @@ class _PrivacyWelcomeScreenState extends State<PrivacyWelcomeScreen> {
7474
return;
7575
}
7676

77-
// If on background access page and not handled, show dialog
78-
if (_currentPage == 4 && !_backgroundAccessHandled) {
79-
// Changed from 3 to 4
80-
_showBackgroundAccessDialog();
81-
return;
82-
}
77+
8378

8479
// If on channels page, proceed to next page
85-
if (_currentPage == 5) {
80+
if (_currentPage == 4) {
8681
// No special handling required for channels page
8782
}
8883

@@ -172,94 +167,6 @@ class _PrivacyWelcomeScreenState extends State<PrivacyWelcomeScreen> {
172167
}
173168
}
174169

175-
void _showBackgroundAccessDialog() {
176-
showDialog(
177-
context: context,
178-
builder: (BuildContext context) {
179-
return AlertDialog(
180-
title: Text(
181-
context.tr('privacy_welcome.background_access_required'),
182-
style: const TextStyle(
183-
fontWeight: FontWeight.bold,
184-
color: Colors.white,
185-
),
186-
),
187-
content: Text(
188-
context.tr('privacy_welcome.background_access_content'),
189-
style: const TextStyle(color: Colors.white70),
190-
),
191-
backgroundColor: AppTheme.primaryDark,
192-
shape: RoundedRectangleBorder(
193-
borderRadius: BorderRadius.circular(12),
194-
),
195-
actions: [
196-
TextButton(
197-
onPressed: () {
198-
Navigator.of(context).pop(); // Close the dialog
199-
// Stay on the current page
200-
},
201-
child: Text(
202-
context.tr('privacy_welcome.stay'),
203-
style: const TextStyle(color: Colors.white70),
204-
),
205-
),
206-
TextButton(
207-
onPressed: () {
208-
Navigator.of(context).pop(); // Close the dialog
209-
setState(() {
210-
_backgroundAccessHandled = true;
211-
});
212-
_nextPage(); // Continue to next page
213-
},
214-
child: Text(
215-
context.tr('common.next'),
216-
style: const TextStyle(color: AppTheme.primaryGreen),
217-
),
218-
),
219-
],
220-
);
221-
},
222-
);
223-
}
224-
225-
void _openBackgroundSettings() async {
226-
print(context.tr('privacy_welcome.opening_background_settings'));
227-
try {
228-
// Use platform channel to open Android battery optimization settings
229-
const platform = MethodChannel('com.cloud.pira/settings');
230-
final result = await platform.invokeMethod(
231-
'openBatteryOptimizationSettings',
232-
);
233-
print(
234-
'${context.tr('privacy_welcome.settings_opened_successfully')}: $result',
235-
);
236-
} catch (e) {
237-
print(
238-
'${context.tr('privacy_welcome.error_opening_battery_settings')}: $e',
239-
);
240-
// Fallback: open general app settings
241-
try {
242-
const platform = MethodChannel('com.cloud.pira/settings');
243-
final result = await platform.invokeMethod('openAppSettings');
244-
print('${context.tr('privacy_welcome.app_settings_opened')}: $result');
245-
} catch (e2) {
246-
print(
247-
'${context.tr('privacy_welcome.error_opening_app_settings')}: $e2',
248-
);
249-
if (mounted) {
250-
ScaffoldMessenger.of(context).showSnackBar(
251-
SnackBar(
252-
content: Text(
253-
'${context.tr('privacy_welcome.could_not_open_settings')}: $e2',
254-
),
255-
duration: const Duration(seconds: 3),
256-
),
257-
);
258-
}
259-
}
260-
}
261-
}
262-
263170
@override
264171
Widget build(BuildContext context) {
265172
return Scaffold(
@@ -310,7 +217,6 @@ class _PrivacyWelcomeScreenState extends State<PrivacyWelcomeScreen> {
310217
_buildWelcomePage(),
311218
_buildPrivacyPage(),
312219
_buildNoLimitsPage(),
313-
_buildBackgroundAccessPage(),
314220
_buildChannelsPage(), // Added channels and sponsors page
315221
_buildPersianGulfPage(), // Added Persian Gulf page
316222
_buildFreeToUsePage(),
@@ -365,9 +271,6 @@ class _PrivacyWelcomeScreenState extends State<PrivacyWelcomeScreen> {
365271
child: Text(
366272
_currentPage == _totalPages - 1
367273
? context.tr('privacy_welcome.get_started')
368-
: (_currentPage == 4 && // Changed from 3 to 4
369-
!_backgroundAccessHandled)
370-
? context.tr('common.next')
371274
: context.tr('common.next'),
372275
style: const TextStyle(
373276
fontSize: 16,
@@ -788,86 +691,6 @@ class _PrivacyWelcomeScreenState extends State<PrivacyWelcomeScreen> {
788691
);
789692
}
790693

791-
Widget _buildBackgroundAccessPage() {
792-
return Consumer<LanguageProvider>(
793-
builder: (context, languageProvider, child) {
794-
final isRtlLanguage =
795-
languageProvider.currentLanguage.code == 'fa' ||
796-
languageProvider.currentLanguage.code == 'ar';
797-
798-
final titleStyle = isRtlLanguage
799-
? GoogleFonts.vazirmatn(
800-
fontSize: 28,
801-
fontWeight: FontWeight.bold,
802-
color: Colors.white,
803-
)
804-
: const TextStyle(
805-
fontSize: 28,
806-
fontWeight: FontWeight.bold,
807-
color: Colors.white,
808-
);
809-
810-
final subtitleStyle = isRtlLanguage
811-
? GoogleFonts.vazirmatn(fontSize: 16, color: Colors.white70)
812-
: const TextStyle(fontSize: 16, color: Colors.white70);
813-
814-
return Padding(
815-
padding: const EdgeInsets.all(24.0),
816-
child: SingleChildScrollView(
817-
physics: const BouncingScrollPhysics(),
818-
child: Column(
819-
mainAxisAlignment: MainAxisAlignment.center,
820-
children: [
821-
const Icon(
822-
Icons.battery_charging_full,
823-
size: 100,
824-
color: AppTheme.primaryGreen,
825-
),
826-
const SizedBox(height: 24),
827-
Text(
828-
context.tr('privacy_welcome.background_access_title'),
829-
style: titleStyle,
830-
textAlign: TextAlign.center,
831-
),
832-
const SizedBox(height: 16),
833-
Text(
834-
context.tr('privacy_welcome.background_access_subtitle'),
835-
style: subtitleStyle,
836-
textAlign: TextAlign.center,
837-
),
838-
const SizedBox(height: 32),
839-
// Primary button - Open Settings
840-
SizedBox(
841-
width: double.infinity,
842-
child: ElevatedButton.icon(
843-
onPressed: _openBackgroundSettings,
844-
icon: const Icon(Icons.settings, color: Colors.white),
845-
label: Text(
846-
context.tr('privacy_welcome.open_settings'),
847-
style: const TextStyle(
848-
fontSize: 16,
849-
fontWeight: FontWeight.bold,
850-
color: Colors.white,
851-
),
852-
),
853-
style: ElevatedButton.styleFrom(
854-
backgroundColor: AppTheme.primaryGreen,
855-
padding: const EdgeInsets.symmetric(vertical: 14),
856-
shape: RoundedRectangleBorder(
857-
borderRadius: BorderRadius.circular(8),
858-
),
859-
),
860-
),
861-
),
862-
const SizedBox(height: 24),
863-
],
864-
),
865-
),
866-
);
867-
},
868-
);
869-
}
870-
871694
Widget _buildFreeToUsePage() {
872695
return Consumer<LanguageProvider>(
873696
builder: (context, languageProvider, child) {

lib/screens/telegram_proxy_screen.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ class _TelegramProxyScreenState extends State<TelegramProxyScreen> {
208208
label: Text(
209209
context.tr(TranslationKeys.telegramProxyCopyDetails),
210210
),
211+
style: OutlinedButton.styleFrom(
212+
foregroundColor: Colors.white, // Text color
213+
side: const BorderSide(color: Colors.white), // Border color
214+
),
211215
onPressed: () {
212216
Clipboard.setData(
213217
ClipboardData(
@@ -234,6 +238,10 @@ class _TelegramProxyScreenState extends State<TelegramProxyScreen> {
234238
label: Text(
235239
context.tr(TranslationKeys.telegramProxyCopyUrl),
236240
),
241+
style: OutlinedButton.styleFrom(
242+
foregroundColor: Colors.white, // Text color
243+
side: const BorderSide(color: Colors.white), // Border color
244+
),
237245
onPressed: () {
238246
Clipboard.setData(
239247
ClipboardData(text: proxy.telegramHttpsUrl),

lib/services/server_service.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,4 @@ class ServerService {
147147
return null;
148148
}
149149
}
150-
}
150+
}

0 commit comments

Comments
 (0)