Skip to content
Open
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
24 changes: 24 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
- name: Get Flutter dependencies
run: flutter pub get
shell: bash
- name: Generate i18n translations
run: dart run slang
shell: bash
- name: Generate MobX code
run: flutter pub run build_runner build --delete-conflicting-outputs
shell: bash
- name: Inject DanDan API Credentials
run: |
sed -i "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart
Expand Down Expand Up @@ -74,6 +80,10 @@
distribution: 'temurin'
java-version: '18'
- run: flutter pub get
- name: Generate i18n translations
run: dart run slang
- name: Generate MobX code
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Inject DanDan API Credentials
env:
DANDANAPI_APPID: ${{ secrets.DANDANAPI_APPID }}
Expand Down Expand Up @@ -118,6 +128,12 @@
- name: Get Flutter dependencies
run: flutter pub get
shell: bash
- name: Generate i18n translations
run: dart run slang
shell: bash
- name: Generate MobX code
run: flutter pub run build_runner build --delete-conflicting-outputs
shell: bash
- name: Inject DanDan API Credentials
run: |
sed -i "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart
Expand Down Expand Up @@ -157,6 +173,10 @@
channel: stable
flutter-version-file: pubspec.yaml
- run: flutter pub get
- name: Generate i18n translations
run: dart run slang
- name: Generate MobX code
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Inject DanDan API Credentials
run: |
sed -i '' "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart
Expand Down Expand Up @@ -188,6 +208,10 @@
channel: stable
flutter-version-file: pubspec.yaml
- run: flutter pub get
- name: Generate i18n translations
run: dart run slang
- name: Generate MobX code
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Inject DanDan API Credentials
run: |
sed -i '' "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart
Expand Down
54 changes: 46 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
- name: Clone repository
uses: actions/checkout@v4
- name: Extract tag name
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
run: echo "tag=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV
shell: bash
- name: Echo build progress
run: echo "oneAnime_android_${{ env.tag }}.apk build progress"
Expand All @@ -44,6 +44,12 @@
- name: Get Flutter dependencies
run: flutter pub get
shell: bash
- name: Generate i18n translations
run: dart run slang
shell: bash
- name: Generate MobX code
run: flutter pub run build_runner build --delete-conflicting-outputs
shell: bash
- name: Inject DanDan API Credentials
run: |
sed -i "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart
Expand All @@ -52,7 +58,7 @@
run: flutter build apk --split-per-abi
shell: bash
- name: Package android build output
run: cp build/app/outputs/flutter-apk/app-arm64-v8a-release.apk oneAnime_android_${env:tag}.apk
run: cp build/app/outputs/flutter-apk/app-arm64-v8a-release.apk oneAnime_android_${{ env.tag }}.apk
shell: bash

- name: Upload android outputs
Expand All @@ -70,8 +76,8 @@
- name: Clone repository
uses: actions/checkout@v4
- run: |
$tag = "${{ github.ref }}".Replace('refs/tags/', '')
echo "tag=$(echo $tag)" >> $env:GITHUB_ENV
$tag = "${{ github.ref_name }}".Replace('/', '-').Replace('\', '-')
echo "tag=$tag" >> $env:GITHUB_ENV
- run: echo "oneAnime_windows_${env:tag}.zip build progress"
- run: choco install yq
- name: Set up Flutter
Expand All @@ -85,6 +91,10 @@
distribution: 'temurin'
java-version: '18'
- run: flutter pub get
- name: Generate i18n translations
run: dart run slang
- name: Generate MobX code
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Inject DanDan API Credentials
env:
DANDANAPI_APPID: ${{ secrets.DANDANAPI_APPID }}
Expand Down Expand Up @@ -117,7 +127,7 @@
- name: Clone repository
uses: actions/checkout@v4
- name: Extract tag name
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
run: echo "tag=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV
shell: bash
- name: Echo build progress
run: echo "oneAnime_linux_${{ env.tag }}.tar.gz build progress"
Expand All @@ -135,6 +145,12 @@
- name: Get Flutter dependencies
run: flutter pub get
shell: bash
- name: Generate i18n translations
run: dart run slang
shell: bash
- name: Generate MobX code
run: flutter pub run build_runner build --delete-conflicting-outputs
shell: bash
- name: Inject DanDan API Credentials
run: |
sed -i "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart
Expand Down Expand Up @@ -196,7 +212,7 @@
- name: Clone repository
uses: actions/checkout@v4
- name: Extract tag name
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
run: echo "tag=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV
- name: Echo build progress
run: echo "oneAnime_macos_${{ env.tag }}.dmg build progress"
- name: Set up Flutter
Expand All @@ -205,6 +221,10 @@
channel: stable
flutter-version-file: pubspec.yaml
- run: flutter pub get
- name: Generate i18n translations
run: dart run slang
- name: Generate MobX code
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Inject DanDan API Credentials
run: |
sed -i '' "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart
Expand All @@ -227,7 +247,7 @@
- name: Clone repository
uses: actions/checkout@v4
- name: Extract tag name
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
run: echo "tag=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV
- name: Echo build progress
run: echo "oneAnime_ios_${{ env.tag }}.ipa build progress"
- name: Set up Flutter
Expand All @@ -236,6 +256,10 @@
channel: stable
flutter-version-file: pubspec.yaml
- run: flutter pub get
- name: Generate i18n translations
run: dart run slang
- name: Generate MobX code
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Inject DanDan API Credentials
run: |
sed -i '' "s/kvpx7qkqjh/${{ secrets.DANDANAPI_APPID }}/g" lib/utils/mortis.dart
Expand Down Expand Up @@ -263,7 +287,7 @@
- name: Clone repository
uses: actions/checkout@v4
- name: Extract tag name
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
run: echo "tag=${GITHUB_REF_NAME//\//-}" >> $GITHUB_ENV
shell: bash
- name: Set up JDK 17
uses: actions/setup-java@v4
Expand Down Expand Up @@ -343,9 +367,23 @@
run: cp ${{steps.sign_app.outputs.signedReleaseFile}} build/signed/oneAnime_android_${{ env.tag }}.apk

- name: Create release
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v2
with:
files: |
build/signed/*.apk
oneAnime_windows_*.zip
oneAnime_macos_*.dmg
oneAnime_ios_*.ipa
oneAnime_linux_*.tar.gz
oneAnime_linux_*.AppImage

- name: Upload release bundle as artifact
if: github.ref_type != 'tag'
uses: actions/upload-artifact@v4
with:
name: release_bundle
path: |
build/signed/*.apk
oneAnime_windows_*.zip
oneAnime_macos_*.dmg
Expand Down
11 changes: 10 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<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">
<application
android:label="oneAnime"
android:name="${applicationName}"
Expand Down Expand Up @@ -30,12 +31,20 @@
<meta-data
android:name="flutterEmbedding"
android:value="2" />

<!-- Background downloader foreground service for Android 14+ -->
<service
android:name="androidx.work.impl.foreground.SystemForegroundService"
android:foregroundServiceType="dataSync"
tools:node="merge" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility?hl=en and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.8.10'
ext.kotlin_version = '2.1.0'
repositories {
google()
mavenCentral()
Expand Down
1 change: 1 addition & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.7.0" apply false
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
}

include ":app"
45 changes: 45 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Uncomment this line to define a global platform for your project
platform :ios, '14.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end

5 changes: 5 additions & 0 deletions ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import UIKit
import Flutter
import UserNotifications

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
Expand All @@ -8,6 +9,10 @@ import Flutter
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)

// Set notification delegate for background_downloader
UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate

return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
4 changes: 4 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>UIFileSharingEnabled</key>
<true/>
</dict>
</plist>
Loading