Migrate to Zapstore and zapstore.dev

This commit is contained in:
franzap
2024-11-13 00:15:23 -03:00
parent 68edf5b13e
commit c97922ce17
18 changed files with 46 additions and 32 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2024 zap.store Copyright (c) 2024 Zapstore
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
+2 -2
View File
@@ -29,7 +29,7 @@ if (keystorePropertiesFile.exists()) {
} }
android { android {
namespace "store.zap.app" namespace "dev.zapstore.app"
compileSdk flutter.compileSdkVersion compileSdk flutter.compileSdkVersion
ndkVersion flutter.ndkVersion ndkVersion flutter.ndkVersion
@@ -47,7 +47,7 @@ android {
} }
defaultConfig { defaultConfig {
applicationId "store.zap.app" applicationId "dev.zapstore.app"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
+2 -2
View File
@@ -1,8 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="store.zap.app"> package="dev.zapstore.app">
<application <application
android:label="zap.store" android:label="Zapstore"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/launcher_icon" android:icon="@mipmap/launcher_icon"
android:requestLegacyExternalStorage="true"> android:requestLegacyExternalStorage="true">
@@ -1,4 +1,4 @@
package store.zap.app package dev.zapstore.app
import io.flutter.embedding.android.FlutterActivity import io.flutter.embedding.android.FlutterActivity
+4 -4
View File
@@ -86,11 +86,11 @@ class App extends BaseApp with DataModelMixin<App> {
info: info:
'''There was an APK certificate mismatch for $name ($identifier). '''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. 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: [ actions: [
('Close notice (recommended)', () async {}), ('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 client = http.Client();
final sink = file.openWrite(); final sink = file.openWrite();
final backupUrl = 'https://cdn.zap.store/$hash'; final backupUrl = 'https://cdn.zapstore.dev/$hash';
final url = latestMetadata!.urls.firstOrNull ?? backupUrl; final url = latestMetadata!.urls.firstOrNull ?? backupUrl;
var downloadedBytes = 0; var downloadedBytes = 0;
Uri uri; Uri uri;
+3 -2
View File
@@ -7,6 +7,7 @@ import 'package:json_annotation/json_annotation.dart';
import 'package:zapstore/main.data.dart'; import 'package:zapstore/main.data.dart';
import 'package:zapstore/models/app.dart'; import 'package:zapstore/models/app.dart';
import 'package:zapstore/navigation/app_initializer.dart'; import 'package:zapstore/navigation/app_initializer.dart';
import 'package:zapstore/utils/extensions.dart';
import 'package:zapstore/utils/system_info.dart'; import 'package:zapstore/utils/system_info.dart';
part 'local_app.g.dart'; part 'local_app.g.dart';
@@ -144,9 +145,9 @@ mixin LocalAppAdapter on Adapter<LocalApp> {
} }
var comp = 0; var comp = 0;
if (app.latestMetadata!.versionCode != null) { 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) // (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 + 2000
: installedVersionCode; : installedVersionCode;
comp = app.latestMetadata!.versionCode!.compareTo(code); comp = app.latestMetadata!.versionCode!.compareTo(code);
+1 -1
View File
@@ -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 // 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 = {'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'}; const kSocialRelays = {'wss://relay.damus.io', 'wss://relay.nostr.band'};
mixin NostrAdapter<T extends DataModelMixin<T>> on Adapter<T> { mixin NostrAdapter<T extends DataModelMixin<T>> on Adapter<T> {
+10 -1
View File
@@ -95,11 +95,20 @@ class AppDetailScreen extends HookConsumerWidget {
), ),
Divider(height: 24), Divider(height: 24),
if (curatedBy.isNotEmpty) if (curatedBy.isNotEmpty)
UsersRichText( Container(
decoration: BoxDecoration(
color: Colors.grey[900],
borderRadius: BorderRadius.circular(10),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: UsersRichText(
trailingText: trailingText:
' recommend${curatedBy.length == 1 ? 's' : ''} this app', ' recommend${curatedBy.length == 1 ? 's' : ''} this app',
users: curatedBy.toList(), users: curatedBy.toList(),
), ),
),
),
if (curatedBy.isNotEmpty) Gap(20), if (curatedBy.isNotEmpty) Gap(20),
MarkdownBody( MarkdownBody(
styleSheet: MarkdownStyleSheet( styleSheet: MarkdownStyleSheet(
+3 -3
View File
@@ -25,10 +25,10 @@ class SearchScreen extends HookConsumerWidget {
// Show toast if this app has updates // Show toast if this app has updates
useMemoized(() { useMemoized(() {
final app = ref.apps.appAdapter final app = ref.apps.appAdapter
.findWhereIdentifierInLocal({'store.zap.app'}).first; .findWhereIdentifierInLocal({kZapstoreAppIdentifier}).firstOrNull;
if (app.canUpdate) { if (app?.canUpdate ?? false) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
context.showZapstoreUpdate(app); context.showZapstoreUpdate(app!);
}); });
} }
}); });
+1 -1
View File
@@ -44,7 +44,7 @@ class SettingsScreen extends HookConsumerWidget {
), ),
Gap(10), Gap(10),
Text( Text(
'zap.store is free and open source software', 'Zapstore is free and open source software',
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16), style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
), ),
Gap(10), Gap(10),
+2
View File
@@ -114,3 +114,5 @@ extension StringWidget on String {
} }
const kI = "e593c54f840b32054dcad0fac15d57e4ac6523e31fe26b3087de6b07a2e9af58"; const kI = "e593c54f840b32054dcad0fac15d57e4ac6523e31fe26b3087de6b07a2e9af58";
const kZapstoreAppIdentifier = 'dev.zapstore.app';
+2 -1
View File
@@ -5,13 +5,14 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:system_info2/system_info2.dart'; import 'package:system_info2/system_info2.dart';
import 'package:zapstore/main.dart'; import 'package:zapstore/main.dart';
import 'package:zapstore/main.data.dart'; import 'package:zapstore/main.data.dart';
import 'package:zapstore/utils/extensions.dart';
final deviceInfoPlugin = DeviceInfoPlugin(); final deviceInfoPlugin = DeviceInfoPlugin();
final packageManager = AndroidPackageManager(); final packageManager = AndroidPackageManager();
final systemInfoProvider = FutureProvider((ref) async { final systemInfoProvider = FutureProvider((ref) async {
final zsInfo = final zsInfo =
await packageManager.getPackageInfo(packageName: 'store.zap.app'); await packageManager.getPackageInfo(packageName: kZapstoreAppIdentifier);
final dbInfo = { final dbInfo = {
'apps': ref.apps.countLocal, 'apps': ref.apps.countLocal,
'releases': ref.releases.countLocal, 'releases': ref.releases.countLocal,
+2 -1
View File
@@ -82,9 +82,10 @@ class AppCard extends HookConsumerWidget {
softWrap: true, softWrap: true,
), ),
Gap(6), Gap(6),
// Only show Signed by apps' original authors
if (app.signer.isPresent && if (app.signer.isPresent &&
(app.signer.value!.pubkey != kZapstorePubkey || (app.signer.value!.pubkey != kZapstorePubkey ||
{'store.zap.app'}.contains(app.identifier))) {kZapstoreAppIdentifier}.contains(app.identifier)))
AuthorContainer( AuthorContainer(
user: app.signer.value!, user: app.signer.value!,
text: 'Signed by', text: 'Signed by',
+1 -1
View File
@@ -149,7 +149,7 @@ Future<void> _sendErrorReport(
final client = http.Client(); final client = http.Client();
final event = AppFeedback(content: jsonEncode(map)).sign(kI); 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()), body: jsonEncode(event.toMap()),
headers: {'Content-Type': 'application/json'}); headers: {'Content-Type': 'application/json'});
client.close(); client.close();
+1 -1
View File
@@ -9,7 +9,7 @@ project(runner LANGUAGES CXX)
set(BINARY_NAME "zapstore") set(BINARY_NAME "zapstore")
# The unique GTK application identifier for this application. See: # The unique GTK application identifier for this application. See:
# https://wiki.gnome.org/HowDoI/ChooseApplicationID # 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 # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake. # versions of CMake.
+3 -3
View File
@@ -479,7 +479,7 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = store.zap.app.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = dev.zapstore.app.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zapstore.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zapstore"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zapstore.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zapstore";
@@ -494,7 +494,7 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = store.zap.app.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = dev.zapstore.app.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zapstore.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zapstore"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zapstore.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zapstore";
@@ -509,7 +509,7 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = store.zap.app.RunnerTests; PRODUCT_BUNDLE_IDENTIFIER = dev.zapstore.app.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zapstore.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zapstore"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/zapstore.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/zapstore";
+3 -3
View File
@@ -5,10 +5,10 @@
// 'flutter create' template. // 'flutter create' template.
// The application's name. By default this is also the title of the Flutter window. // 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 // The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = store.zap.app PRODUCT_BUNDLE_IDENTIFIER = dev.zapstore.app
// The copyright displayed in application information // The copyright displayed in application information
PRODUCT_COPYRIGHT = Copyright © 2024 zap.store. All rights reserved. PRODUCT_COPYRIGHT = Copyright © 2024 Zapstore. All rights reserved.
+1 -1
View File
@@ -1,6 +1,6 @@
zapstore: zapstore:
android: android:
repository: https://github.com/zapstore/zapstore repository: https://github.com/zapstore/zapstore
name: zap.store name: zapstore
artifacts: artifacts:
- zapstore-%v.apk - zapstore-%v.apk