Skip to content

Commit 98bac87

Browse files
committed
fix
1 parent ddf687b commit 98bac87

29 files changed

+1702
-807
lines changed

FA.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ yay -S proxycloud-gui-bin
182182

183183
- [Flutter](https://flutter.dev/) - مجموعه ابزار رابط کاربری برای ساخت برنامه‌های کامپایل شده بومی
184184
- [Xray Core](https://github.com/XTLS/Xray-core) - پلتفرمی برای ساخت پروکسی‌ها برای دور زدن محدودیت‌های شبکه
185-
- [AndroidLibXrayLite](https://github.com/2dust/AndroidLibXrayLite) - کتابخانه اندروید برای هسته Xray
185+
- [AndroidLibV2rayLite](https://github.com/2dust/AndroidLibV2rayLite) - کتابخانه اندروید برای هسته Xray
186186
- [Provider](https://pub.dev/packages/provider) - راه حل مدیریت وضعیت
187187
- تمام مشارکت‌کنندگانی که به شکل‌گیری این پروژه کمک کرده‌اند
188188

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ If you encounter any issues or have questions, please open an issue on our GitHu
191191

192192
- [Flutter](https://flutter.dev/) - UI toolkit for building natively compiled applications
193193
- [Xray Core](https://github.com/XTLS/Xray-core) - A platform for building proxies to bypass network restrictions
194-
- [AndroidLibXrayLite](https://github.com/2dust/AndroidLibXrayLite) - Android library for Xray core
194+
- [AndroidLibV2rayLite](https://github.com/2dust/AndroidLibV2rayLite) - Android library for Xray core
195195
- [Provider](https://pub.dev/packages/provider) - State management solution
196196
- All contributors who have helped shape this project
197197

RU.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ yay -S proxycloud-gui-bin
182182

183183
- [Flutter](https://flutter.dev/) - UI-инструментарий для создания нативно компилируемых приложений
184184
- [Xray Core](https://github.com/XTLS/Xray-core) - Платформа для создания прокси для обхода сетевых ограничений
185-
- [AndroidLibXrayLite](https://github.com/2dust/AndroidLibXrayLite) - Android библиотека для ядра Xray
185+
- [AndroidLibV2rayLite](https://github.com/2dust/AndroidLibV2rayLite) - Android библиотека для ядра Xray
186186
- [Provider](https://pub.dev/packages/provider) - Решение для управления состоянием
187187
- Всем участникам, которые помогли сформировать этот проект
188188

ZH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ yay -S proxycloud-gui-bin
183183

184184
- [Flutter](https://flutter.dev/) - 用于构建原生编译应用程序的UI工具包
185185
- [Xray Core](https://github.com/XTLS/Xray-core) - 一个用于构建绕过网络限制的代理的平台
186-
- [AndroidLibXrayLite](https://github.com/2dust/AndroidLibXrayLite) - Xray核心的Android库
186+
- [AndroidLibV2rayLite](https://github.com/2dust/AndroidLibV2rayLite) - Xray核心的Android库
187187
- [Provider](https://pub.dev/packages/provider) - 状态管理解决方案
188188
- 所有帮助塑造这个项目的贡献者
189189

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 = 48
46-
versionName = "3.7.8"
45+
versionCode = 49
46+
versionName = "3.7.9"
4747

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

android/app/src/main/kotlin/com/cloud/pira/AppListMethodChannel.kt

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ package com.cloud.pira
33
import android.content.Context
44
import android.content.pm.ApplicationInfo
55
import android.content.pm.PackageManager
6+
import android.graphics.Bitmap
7+
import android.graphics.Canvas
8+
import android.graphics.drawable.BitmapDrawable
9+
import android.graphics.drawable.Drawable
10+
import android.util.Base64
11+
import androidx.core.graphics.drawable.toBitmap
612
import io.flutter.embedding.engine.FlutterEngine
713
import io.flutter.plugin.common.MethodCall
814
import io.flutter.plugin.common.MethodChannel
@@ -12,6 +18,7 @@ import kotlinx.coroutines.CoroutineScope
1218
import kotlinx.coroutines.Dispatchers
1319
import kotlinx.coroutines.launch
1420
import kotlinx.coroutines.withContext
21+
import java.io.ByteArrayOutputStream
1522

1623
class AppListMethodChannel(private val context: Context) : MethodCallHandler {
1724
companion object {
@@ -46,10 +53,21 @@ class AppListMethodChannel(private val context: Context) : MethodCallHandler {
4653
val appName = packageManager.getApplicationLabel(appInfo).toString()
4754
val packageName = appInfo.packageName
4855

56+
// Get app icon as base64 string
57+
var iconBase64 = ""
58+
try {
59+
val appIcon = packageManager.getApplicationIcon(appInfo.packageName)
60+
iconBase64 = drawableToBase64(appIcon)
61+
} catch (e: Exception) {
62+
// If we can't get the icon, we'll just leave it empty
63+
iconBase64 = ""
64+
}
65+
4966
appList.add(mapOf(
5067
"name" to appName,
5168
"packageName" to packageName,
52-
"isSystemApp" to ((appInfo.flags and ApplicationInfo.FLAG_SYSTEM) != 0)
69+
"isSystemApp" to ((appInfo.flags and ApplicationInfo.FLAG_SYSTEM) != 0),
70+
"icon" to iconBase64
5371
))
5472
}
5573

@@ -73,4 +91,21 @@ class AppListMethodChannel(private val context: Context) : MethodCallHandler {
7391
}
7492
}
7593
}
94+
95+
private fun drawableToBase64(drawable: Drawable): String {
96+
// Convert drawable to bitmap
97+
val bitmap = if (drawable is BitmapDrawable) {
98+
drawable.bitmap
99+
} else {
100+
drawable.toBitmap(96, 96, Bitmap.Config.ARGB_8888)
101+
}
102+
103+
// Compress bitmap to byte array
104+
val byteArrayOutputStream = ByteArrayOutputStream()
105+
bitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream)
106+
val byteArray = byteArrayOutputStream.toByteArray()
107+
108+
// Convert byte array to base64 string
109+
return Base64.encodeToString(byteArray, Base64.NO_WRAP)
110+
}
76111
}

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.7.8';
9+
static const String currentAppVersion = '3.7.9';
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.7.8'},
67+
parameters: {'version': '3.7.9'},
6868
),
6969
style: const TextStyle(fontSize: 16, color: Colors.grey),
7070
),

0 commit comments

Comments
 (0)