more progress, rename nexus.federated.Nexus -> nexus.federated.nexus
This commit is contained in:
parent
790caf1d38
commit
79671409de
12 changed files with 55 additions and 68 deletions
2
.github/workflows/flatpak.yml
vendored
2
.github/workflows/flatpak.yml
vendored
|
|
@ -34,4 +34,4 @@ jobs:
|
||||||
uses: actions/upload-artifact@v6
|
uses: actions/upload-artifact@v6
|
||||||
with:
|
with:
|
||||||
name: flatpak-${{ matrix.arch }}
|
name: flatpak-${{ matrix.arch }}
|
||||||
path: result/nexus.federated.Nexus.flatpak
|
path: result/nexus.federated.nexus.flatpak
|
||||||
|
|
@ -30,7 +30,7 @@ if (keystorePropertiesFile.exists()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "nexus.federated.Nexus"
|
namespace = "nexus.federated.nexus"
|
||||||
ndkVersion = flutter.ndkVersion
|
ndkVersion = flutter.ndkVersion
|
||||||
compileSdk = 34
|
compileSdk = 34
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "nexus.federated.Nexus"
|
applicationId = "nexus.federated.nexus"
|
||||||
minSdk = 29
|
minSdk = 29
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode = flutterVersionCode.toInteger()
|
versionCode = flutterVersionCode.toInteger()
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package nexus.federated.Nexus
|
package nexus.federated.nexus
|
||||||
|
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
flatpak = inputs.nix2flatpak.lib.${system}.mkFlatpak {
|
flatpak = inputs.nix2flatpak.lib.${system}.mkFlatpak {
|
||||||
appName = "Nexus";
|
appName = "Nexus";
|
||||||
developer = "QuadRadical";
|
developer = "QuadRadical";
|
||||||
appId = "nexus.federated.Nexus";
|
appId = "nexus.federated.nexus";
|
||||||
package = default;
|
package = default;
|
||||||
runtime = "org.gnome.Platform/49";
|
runtime = "org.gnome.Platform/49";
|
||||||
permissions = {
|
permissions = {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>App</string>
|
<string>App</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>nexus.federated.Nexus</string>
|
<string>nexus.federated.nexus</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
|
|
|
||||||
|
|
@ -387,7 +387,7 @@
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = nexus.federated.Nexus;
|
PRODUCT_BUNDLE_IDENTIFIER = nexus.federated.nexus;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
|
|
@ -519,7 +519,7 @@
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = nexus.federated.Nexus;
|
PRODUCT_BUNDLE_IDENTIFIER = nexus.federated.nexus;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
|
@ -545,7 +545,7 @@
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = nexus.federated.Nexus;
|
PRODUCT_BUNDLE_IDENTIFIER = nexus.federated.nexus;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,19 @@
|
||||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||||
import "package:nexus/controllers/client.dart";
|
import "package:nexus/controllers/client.dart";
|
||||||
import "package:nexus/controllers/client_id.dart";
|
import "package:nexus/controllers/client_id.dart";
|
||||||
|
import "package:nexus/models/oauth_auth_code_response.dart";
|
||||||
|
|
||||||
class AuthUrlController extends AsyncNotifier<Uri> {
|
class AuthUrlController extends AsyncNotifier<OAuthAuthCodeResponse> {
|
||||||
static const prefString = "auth_url";
|
|
||||||
|
|
||||||
final Uri homeserver;
|
final Uri homeserver;
|
||||||
AuthUrlController(this.homeserver);
|
AuthUrlController(this.homeserver);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Uri> build() async {
|
Future<OAuthAuthCodeResponse> build() async => ref
|
||||||
final fetched = await ref
|
|
||||||
.watch(ClientController.provider.notifier)
|
.watch(ClientController.provider.notifier)
|
||||||
.getAuthUrl(
|
.getAuthUrl(
|
||||||
.new(
|
.new(
|
||||||
homeserverUrl: homeserver,
|
homeserverUrl: homeserver,
|
||||||
redirectUri: Uri.https("nexus.federated.nexus"),
|
redirectUri: .new(scheme: "nexus.federated.nexus"),
|
||||||
responseMode: .query,
|
responseMode: .query,
|
||||||
scopes: .new([.clientApi]),
|
scopes: .new([.clientApi]),
|
||||||
clientId: await ref.watch(
|
clientId: await ref.watch(
|
||||||
|
|
@ -24,9 +22,10 @@ class AuthUrlController extends AsyncNotifier<Uri> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
return fetched.url;
|
static final provider =
|
||||||
}
|
AsyncNotifierProvider.family<
|
||||||
|
AuthUrlController,
|
||||||
static final provider = AsyncNotifierProvider.autoDispose
|
OAuthAuthCodeResponse,
|
||||||
.family<AuthUrlController, Uri, Uri>(AuthUrlController.new);
|
Uri
|
||||||
|
>(AuthUrlController.new);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,12 @@
|
||||||
import "package:flutter_riverpod/flutter_riverpod.dart";
|
import "package:flutter_riverpod/flutter_riverpod.dart";
|
||||||
import "package:nexus/controllers/client.dart";
|
import "package:nexus/controllers/client.dart";
|
||||||
import "package:nexus/controllers/shared_prefs.dart";
|
|
||||||
|
|
||||||
class ClientIdController extends AsyncNotifier<String> {
|
class ClientIdController extends AsyncNotifier<String> {
|
||||||
static const prefString = "client_id";
|
|
||||||
|
|
||||||
final Uri homeserver;
|
final Uri homeserver;
|
||||||
ClientIdController(this.homeserver);
|
ClientIdController(this.homeserver);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<String> build() async {
|
Future<String> build() => ref
|
||||||
final prefs = await ref.watch(SharedPrefsController.provider.future);
|
|
||||||
final fromPref = prefs.getString(prefString);
|
|
||||||
|
|
||||||
if (fromPref != null) return fromPref;
|
|
||||||
|
|
||||||
final fetched = await ref
|
|
||||||
.watch(ClientController.provider.notifier)
|
.watch(ClientController.provider.notifier)
|
||||||
.registerClient(
|
.registerClient(
|
||||||
.new(
|
.new(
|
||||||
|
|
@ -29,15 +20,12 @@ class ClientIdController extends AsyncNotifier<String> {
|
||||||
),
|
),
|
||||||
homeserverUrl: homeserver,
|
homeserverUrl: homeserver,
|
||||||
clientUri: Uri.https("nexus.federated.nexus"),
|
clientUri: Uri.https("nexus.federated.nexus"),
|
||||||
redirectUris: .new([.https("nexus.federated.nexus")]),
|
redirectUris: .new([.new(scheme: "nexus.federated.nexus")]),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
await prefs.setString(prefString, fetched);
|
static final provider =
|
||||||
|
AsyncNotifierProvider.family<ClientIdController, String, Uri>(
|
||||||
return fetched;
|
ClientIdController.new,
|
||||||
}
|
);
|
||||||
|
|
||||||
static final provider = AsyncNotifierProvider.autoDispose
|
|
||||||
.family<ClientIdController, String, Uri>(ClientIdController.new);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ class SelectServerPage extends HookConsumerWidget {
|
||||||
AuthUrlController.provider(newUrl).future,
|
AuthUrlController.provider(newUrl).future,
|
||||||
);
|
);
|
||||||
|
|
||||||
print(authUrl);
|
await ref.watch(LaunchHelper.provider).launchUrl(authUrl.url);
|
||||||
// await Navigator.of(context).push(
|
// await Navigator.of(context).push(
|
||||||
// MaterialPageRoute(builder: (_) => LoginPage(homeserver: newUrl)),
|
// MaterialPageRoute(builder: (_) => LoginPage(homeserver: newUrl)),
|
||||||
// );
|
// );
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ project(runner LANGUAGES CXX)
|
||||||
set(BINARY_NAME "nexus")
|
set(BINARY_NAME "nexus")
|
||||||
# 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 "nexus.federated.Nexus")
|
set(APPLICATION_ID "nexus.federated.nexus")
|
||||||
|
|
||||||
# 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.
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ flutter.buildFlutterApplication {
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
install -D assets/icon.svg $out/share/icons/hicolor/scalable/apps/nexus.svg
|
install -D assets/icon.svg $out/share/icons/hicolor/scalable/apps/nexus.svg
|
||||||
install -Dm755 linux/nexus.federated.Nexus.desktop -t $out/share/applications
|
install -Dm755 linux/nexus.federated.nexus.desktop -t $out/share/applications
|
||||||
wrapProgram $out/bin/nexus \
|
wrapProgram $out/bin/nexus \
|
||||||
--suffix LD_LIBRARY_PATH : $out/app/nexus/lib
|
--suffix LD_LIBRARY_PATH : $out/app/nexus/lib
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
|
|
@ -89,11 +89,11 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
BLOCK "040904e4"
|
BLOCK "040904e4"
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "nexus.federated.Nexus" "\0"
|
VALUE "CompanyName", "nexus.federated.nexus" "\0"
|
||||||
VALUE "FileDescription", "nexus" "\0"
|
VALUE "FileDescription", "nexus" "\0"
|
||||||
VALUE "FileVersion", VERSION_AS_STRING "\0"
|
VALUE "FileVersion", VERSION_AS_STRING "\0"
|
||||||
VALUE "InternalName", "nexus" "\0"
|
VALUE "InternalName", "nexus" "\0"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2025 nexus.federated.Nexus. All rights reserved." "\0"
|
VALUE "LegalCopyright", "Copyright (C) 2025 nexus.federated.nexus. All rights reserved." "\0"
|
||||||
VALUE "OriginalFilename", "nexus.exe" "\0"
|
VALUE "OriginalFilename", "nexus.exe" "\0"
|
||||||
VALUE "ProductName", "nexus" "\0"
|
VALUE "ProductName", "nexus" "\0"
|
||||||
VALUE "ProductVersion", VERSION_AS_STRING "\0"
|
VALUE "ProductVersion", VERSION_AS_STRING "\0"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue