Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule ".flutter"]
path = .flutter
url = https://github.com/flutter/flutter/
[submodule "android_package_manager_fix"]
path = android_package_manager_fix
url = https://github.com/nsNeruno/android_package_manager.git
35 changes: 5 additions & 30 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,43 +22,18 @@ subprojects {
project.evaluationDependsOn(":app")
}

// Special handling for android_package_manager plugin for AGP 9 compatibility
// Fix for android_package_manager plugin namespace issue with AGP 8+
if (project.name == "android_package_manager") {
project.logger.lifecycle("Configuring android_package_manager for AGP 9 compatibility")

// Fix manifest by removing package attribute during build
project.tasks.whenTaskAdded { task ->
if (task.name == "processReleaseManifest" || task.name == "processDebugManifest") {
task.doFirst {
val manifestFile = file("${project.projectDir}/src/main/AndroidManifest.xml")
if (manifestFile.exists()) {
val manifestContent = manifestFile.readText()
val fixedContent = manifestContent.replace(
Regex("""package="[^"]*"""),
""
)
manifestFile.writeText(fixedContent)
project.logger.lifecycle("Fixed AndroidManifest.xml for android_package_manager")
}
}
}
}

project.afterEvaluate {
if (project.hasProperty("android")) {
try {
val android = project.extensions.getByName("android") as com.android.build.gradle.LibraryExtension
if (android.namespace == null) {
android.namespace = "com.android_package_manager"
project.logger.lifecycle("Set namespace for android_package_manager: ${android.namespace}")
val androidExtension = project.extensions.findByName("android")
if (androidExtension is com.android.build.gradle.LibraryExtension) {
if (androidExtension.namespace == null) {
androidExtension.namespace = "com.android_package_manager"
}
} catch (e: Exception) {
println("Warning: Could not configure namespace for android_package_manager: ${e.message}")
}
}
}

return@subprojects
}
}

Expand Down
4 changes: 2 additions & 2 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android.compileSdk=36
android.newDsl=false
android.nonTransitiveRClass=true
android.nonFinalResIds=true
# Kotlin version for compatibility with AGP 9
kotlin.version=2.2.0
# Kotlin version for compatibility with Flutter 3.41.9
kotlin.version=2.3.21
# Suppress android_package_manager manifest validation error
android.disableManifestValidation=true
10 changes: 8 additions & 2 deletions lib/pages/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import 'package:url_launcher/url_launcher_string.dart';
import 'package:provider/provider.dart';
import 'package:markdown/markdown.dart' as md;
import 'package:updatium/components/generated_form.dart';
import 'package:android_intent_plus/android_intent.dart';

// Material 3 spacing tokens
const gap8 = SizedBox(height: 8);
Expand Down Expand Up @@ -817,8 +818,13 @@ class _AppPageState extends State<AppPage> {
icon: Icons.open_in_new,
semanticLabel: tr('open'),
tooltip: tr('open'),
onPressed: () {
pm.openApp(app.app.id);
onPressed: () async {
AndroidIntent intent = AndroidIntent(
action: 'android.intent.action.MAIN',
category: 'android.intent.category.LAUNCHER',
package: app.app.id,
);
await intent.launch();
},
),
if (!updating &&
Expand Down
10 changes: 8 additions & 2 deletions lib/pages/apps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import 'package:updatium/providers/settings_provider.dart';
import 'package:updatium/providers/source_provider.dart';
import 'package:provider/provider.dart';
import 'package:share_plus/share_plus.dart';
import 'package:android_intent_plus/android_intent.dart';
import 'package:url_launcher/url_launcher_string.dart';
import 'package:markdown/markdown.dart' as md;

Expand Down Expand Up @@ -587,8 +588,13 @@ class AppsPageState extends State<AppsPage> with TickerProviderStateMixin {
),
);
},
onDoubleTap: () {
pm.openApp(listedApps[appIndex].app.id);
onDoubleTap: () async {
AndroidIntent intent = AndroidIntent(
action: 'android.intent.action.MAIN',
category: 'android.intent.category.LAUNCHER',
package: listedApps[appIndex].app.id,
);
await intent.launch();
},
onLongPress: () {
Navigator.push(
Expand Down
3 changes: 1 addition & 2 deletions lib/providers/source_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1713,8 +1713,7 @@ class DowngradeError extends UpdatiumError {
}

class InstallError extends UpdatiumError {
InstallError(int code)
: super(PackageInstallerStatus.byCode(code).name.substring(7));
InstallError(int code) : super('${tr('installError')} (code: $code)');
}

class IDChangedError extends UpdatiumError {
Expand Down
14 changes: 11 additions & 3 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.1.2"
installed_apps:
dependency: "direct main"
description:
name: installed_apps
sha256: "62b9cb196e2b34558ef0586024251e5dcc5a08199ea0c55c708f0ecc53116341"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
intl:
dependency: transitive
description:
Expand Down Expand Up @@ -1185,10 +1193,10 @@ packages:
dependency: transitive
description:
name: url_launcher_web
sha256: d0412fcf4c6b31ecfdb7762359b7206ffba3bbffd396c6d9f9c4616ece476c1f
sha256: "85c81589622fbc87c1c683aaea164d3604a7777495a79d91e39ffcdec39ddb34"
url: "https://pub.dev"
source: hosted
version: "2.4.2"
version: "2.4.3"
url_launcher_windows:
dependency: transitive
description:
Expand Down Expand Up @@ -1262,7 +1270,7 @@ packages:
source: hosted
version: "6.6.1"
yaml:
dependency: transitive
dependency: "direct main"
description:
name: yaml
sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce
Expand Down
2 changes: 2 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ dependencies:
animations: ^2.1.1
flutter_app_installer: ^2.0.0
android_package_manager: ^0.7.1
installed_apps: ^2.0.0
share_plus: ^13.1.0
sqflite: ^2.4.2
simple_localization:
Expand Down Expand Up @@ -159,6 +160,7 @@ flutter:
fonts:
- asset: assets/fonts/NotoSansArabic-Regular.ttf


dev_dependencies:
flutter_test:
sdk: flutter
Loading