diff --git a/LICENSE.md b/LICENSE.md index 6027cf1..e9fbbc8 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 zap.store +Copyright (c) 2024 Zapstore Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/android/app/build.gradle b/android/app/build.gradle index c7de3ce..4447442 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -29,7 +29,7 @@ if (keystorePropertiesFile.exists()) { } android { - namespace "store.zap.app" + namespace "dev.zapstore.app" compileSdk flutter.compileSdkVersion ndkVersion flutter.ndkVersion @@ -47,7 +47,7 @@ android { } defaultConfig { - applicationId "store.zap.app" + applicationId "dev.zapstore.app" minSdkVersion 21 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 1afb1d6..33c0a12 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + package="dev.zapstore.app"> diff --git a/android/app/src/main/kotlin/com/example/zapstore/MainActivity.kt b/android/app/src/main/kotlin/com/example/zapstore/MainActivity.kt index ad00ff8..54fc934 100644 --- a/android/app/src/main/kotlin/com/example/zapstore/MainActivity.kt +++ b/android/app/src/main/kotlin/com/example/zapstore/MainActivity.kt @@ -1,4 +1,4 @@ -package store.zap.app +package dev.zapstore.app import io.flutter.embedding.android.FlutterActivity diff --git a/lib/models/app.dart b/lib/models/app.dart index 5d80053..8d2658f 100644 --- a/lib/models/app.dart +++ b/lib/models/app.dart @@ -86,11 +86,11 @@ class App extends BaseApp with DataModelMixin { info: '''There was an APK certificate mismatch for $name ($identifier). -This could mean a malicious developer signed this update. +This could mean a malicious developer signed this update. It could also mean the original developer signed this update with a different key. Please contact them. + +If you installed $name through another app store, you can choose to turn off Zapstore updates. If you want to update anyway, you need to manually uninstall the app and install it again. - -It could also mean the original developer signed with a different key. If you are sure you installed $name through another app store, you can choose to turn off zap.store updates. ''', actions: [ ('Close notice (recommended)', () async {}), @@ -165,7 +165,7 @@ It could also mean the original developer signed with a different key. If you ar final client = http.Client(); final sink = file.openWrite(); - final backupUrl = 'https://cdn.zap.store/$hash'; + final backupUrl = 'https://cdn.zapstore.dev/$hash'; final url = latestMetadata!.urls.firstOrNull ?? backupUrl; var downloadedBytes = 0; Uri uri; diff --git a/lib/models/local_app.dart b/lib/models/local_app.dart index 49acbfa..fe13c01 100644 --- a/lib/models/local_app.dart +++ b/lib/models/local_app.dart @@ -7,6 +7,7 @@ import 'package:json_annotation/json_annotation.dart'; import 'package:zapstore/main.data.dart'; import 'package:zapstore/models/app.dart'; import 'package:zapstore/navigation/app_initializer.dart'; +import 'package:zapstore/utils/extensions.dart'; import 'package:zapstore/utils/system_info.dart'; part 'local_app.g.dart'; @@ -144,9 +145,9 @@ mixin LocalAppAdapter on Adapter { } var comp = 0; if (app.latestMetadata!.versionCode != null) { - // NOTE: zap.store development versions always carry a lower version code + // NOTE: Zapstore development versions always carry a lower version code // (e.g. 12) than published ones (e.g. 2012) - final code = app.identifier == 'store.zap.app' && !kReleaseMode + final code = app.identifier == kZapstoreAppIdentifier && !kReleaseMode ? installedVersionCode + 2000 : installedVersionCode; comp = app.latestMetadata!.versionCode!.compareTo(code); diff --git a/lib/models/nostr_adapter.dart b/lib/models/nostr_adapter.dart index 2891abd..3a9587c 100644 --- a/lib/models/nostr_adapter.dart +++ b/lib/models/nostr_adapter.dart @@ -12,7 +12,7 @@ import 'package:zapstore/widgets/latest_releases_container.dart'; // NOTE: Very important to use const in relay args to preserve equality in Riverpod families // const kAppRelays = {'ws://10.0.2.2:3000'}; -const kAppRelays = {'wss://relay.zap.store'}; +const kAppRelays = {'wss://relay.zapstore.dev'}; const kSocialRelays = {'wss://relay.damus.io', 'wss://relay.nostr.band'}; mixin NostrAdapter> on Adapter { diff --git a/lib/screens/app_detail_screen.dart b/lib/screens/app_detail_screen.dart index 09d02e0..fdfffc8 100644 --- a/lib/screens/app_detail_screen.dart +++ b/lib/screens/app_detail_screen.dart @@ -95,10 +95,19 @@ class AppDetailScreen extends HookConsumerWidget { ), Divider(height: 24), if (curatedBy.isNotEmpty) - UsersRichText( - trailingText: - ' recommend${curatedBy.length == 1 ? 's' : ''} this app', - users: curatedBy.toList(), + Container( + decoration: BoxDecoration( + color: Colors.grey[900], + borderRadius: BorderRadius.circular(10), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: UsersRichText( + trailingText: + ' recommend${curatedBy.length == 1 ? 's' : ''} this app', + users: curatedBy.toList(), + ), + ), ), if (curatedBy.isNotEmpty) Gap(20), MarkdownBody( diff --git a/lib/screens/search_screen.dart b/lib/screens/search_screen.dart index bbcfa48..152af15 100644 --- a/lib/screens/search_screen.dart +++ b/lib/screens/search_screen.dart @@ -25,10 +25,10 @@ class SearchScreen extends HookConsumerWidget { // Show toast if this app has updates useMemoized(() { final app = ref.apps.appAdapter - .findWhereIdentifierInLocal({'store.zap.app'}).first; - if (app.canUpdate) { + .findWhereIdentifierInLocal({kZapstoreAppIdentifier}).firstOrNull; + if (app?.canUpdate ?? false) { WidgetsBinding.instance.addPostFrameCallback((_) { - context.showZapstoreUpdate(app); + context.showZapstoreUpdate(app!); }); } }); diff --git a/lib/screens/settings_screen.dart b/lib/screens/settings_screen.dart index 9999af2..03646a4 100644 --- a/lib/screens/settings_screen.dart +++ b/lib/screens/settings_screen.dart @@ -44,7 +44,7 @@ class SettingsScreen extends HookConsumerWidget { ), Gap(10), Text( - 'zap.store is free and open source software', + 'Zapstore is free and open source software', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16), ), Gap(10), diff --git a/lib/utils/extensions.dart b/lib/utils/extensions.dart index 5d6ac90..5027af1 100644 --- a/lib/utils/extensions.dart +++ b/lib/utils/extensions.dart @@ -114,3 +114,5 @@ extension StringWidget on String { } const kI = "e593c54f840b32054dcad0fac15d57e4ac6523e31fe26b3087de6b07a2e9af58"; + +const kZapstoreAppIdentifier = 'dev.zapstore.app'; diff --git a/lib/utils/system_info.dart b/lib/utils/system_info.dart index 3017e12..27f6108 100644 --- a/lib/utils/system_info.dart +++ b/lib/utils/system_info.dart @@ -5,13 +5,14 @@ import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:system_info2/system_info2.dart'; import 'package:zapstore/main.dart'; import 'package:zapstore/main.data.dart'; +import 'package:zapstore/utils/extensions.dart'; final deviceInfoPlugin = DeviceInfoPlugin(); final packageManager = AndroidPackageManager(); final systemInfoProvider = FutureProvider((ref) async { final zsInfo = - await packageManager.getPackageInfo(packageName: 'store.zap.app'); + await packageManager.getPackageInfo(packageName: kZapstoreAppIdentifier); final dbInfo = { 'apps': ref.apps.countLocal, 'releases': ref.releases.countLocal, diff --git a/lib/widgets/app_card.dart b/lib/widgets/app_card.dart index 30c6553..142ab92 100644 --- a/lib/widgets/app_card.dart +++ b/lib/widgets/app_card.dart @@ -82,9 +82,10 @@ class AppCard extends HookConsumerWidget { softWrap: true, ), Gap(6), + // Only show Signed by apps' original authors if (app.signer.isPresent && (app.signer.value!.pubkey != kZapstorePubkey || - {'store.zap.app'}.contains(app.identifier))) + {kZapstoreAppIdentifier}.contains(app.identifier))) AuthorContainer( user: app.signer.value!, text: 'Signed by', diff --git a/lib/widgets/error_container.dart b/lib/widgets/error_container.dart index b40546e..957f9ea 100644 --- a/lib/widgets/error_container.dart +++ b/lib/widgets/error_container.dart @@ -149,7 +149,7 @@ Future _sendErrorReport( final client = http.Client(); final event = AppFeedback(content: jsonEncode(map)).sign(kI); - await client.post(Uri.parse('https://relay.zap.store/'), + await client.post(Uri.parse('https://relay.zapstore.dev/'), body: jsonEncode(event.toMap()), headers: {'Content-Type': 'application/json'}); client.close(); diff --git a/linux/CMakeLists.txt b/linux/CMakeLists.txt index 1c502cf..9d5d809 100644 --- a/linux/CMakeLists.txt +++ b/linux/CMakeLists.txt @@ -9,7 +9,7 @@ project(runner LANGUAGES CXX) set(BINARY_NAME "zapstore") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "store.zap.app") +set(APPLICATION_ID "dev.zapstore.app") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/macos/Runner.xcodeproj/project.pbxproj b/macos/Runner.xcodeproj/project.pbxproj index 23d166f..0a68692 100644 --- a/macos/Runner.xcodeproj/project.pbxproj +++ b/macos/Runner.xcodeproj/project.pbxproj @@ -479,7 +479,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = store.zap.app.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.zapstore.app.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zapstore.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zapstore"; @@ -494,7 +494,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = store.zap.app.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.zapstore.app.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zapstore.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zapstore"; @@ -509,7 +509,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = store.zap.app.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = dev.zapstore.app.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zapstore.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zapstore"; diff --git a/macos/Runner/Configs/AppInfo.xcconfig b/macos/Runner/Configs/AppInfo.xcconfig index 80cc612..0263612 100644 --- a/macos/Runner/Configs/AppInfo.xcconfig +++ b/macos/Runner/Configs/AppInfo.xcconfig @@ -5,10 +5,10 @@ // 'flutter create' template. // The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = zap.store +PRODUCT_NAME = Zapstore // The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = store.zap.app +PRODUCT_BUNDLE_IDENTIFIER = dev.zapstore.app // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2024 zap.store. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2024 Zapstore. All rights reserved. diff --git a/zapstore.yaml b/zapstore.yaml index 733a7e1..0089f35 100644 --- a/zapstore.yaml +++ b/zapstore.yaml @@ -1,6 +1,6 @@ zapstore: android: repository: https://github.com/zapstore/zapstore - name: zap.store + name: zapstore artifacts: - zapstore-%v.apk \ No newline at end of file