Skip to content

Commit

Permalink
Merge pull request #20 from JICA98/2024.8.1+90
Browse files Browse the repository at this point in the history
2024.8.1+90/91/92/93: Add Review Summary and Upgrade Android Plugin/Flutter SDK to latest
  • Loading branch information
JICA98 authored Aug 30, 2024
2 parents 39d505e + 8efc8ab commit 5fbaa36
Show file tree
Hide file tree
Showing 75 changed files with 1,969 additions and 779 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ app.*.map.json
/android/app/release

.vscode/settings.json
.vscode/PythonImportHelper-v2-Completion.json
.vscode/PythonImportHelper-v2-Completion.json
.dockerrun
14 changes: 11 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ if (keystorePropertiesFile.exists()) {

android {
namespace "com.teen.dailyanimelist"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileSdk 34
ndkVersion = "26.1.10909125"

signingConfigs {
release {
Expand All @@ -43,6 +43,8 @@ android {
}

compileOptions {
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Expand All @@ -58,12 +60,13 @@ android {
defaultConfig {
applicationId "io.github.jica98"
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
manifestPlaceholders = [
'appAuthRedirectScheme': 'com.teen.dailyanimelist'
]
multiDexEnabled = true
}

buildTypes {
Expand All @@ -75,6 +78,11 @@ android {
}
dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.errorprone:error_prone_annotations:2.23.0'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
implementation 'androidx.window:window:1.0.0'
implementation 'androidx.window:window-java:1.0.0'
}
lint {
disable 'InvalidPackage'
Expand Down
37 changes: 37 additions & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Flutter wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-keep class com.google.firebase.** { *; }
-dontwarn io.flutter.embedding.**
-ignorewarnings
## Gson rules
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**
#-keep class com.google.gson.stream.** { *; }

# Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * extends com.google.gson.TypeAdapter
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer

# Prevent R8 from leaving Data object members always null
-keepclassmembers,allowobfuscation class * {
@com.google.gson.annotations.SerializedName <fields>;
}

# Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
Expand All @@ -15,6 +15,7 @@
<application
android:icon="@mipmap/ic_launcher"
android:label="DailyAL"
android:enableOnBackInvokedCallback="true"
android:allowBackup="false">

<receiver android:exported="false" android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
Expand Down
13 changes: 12 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.9.22'
ext.kotlin_version = '1.9.25'
repositories {
google()
mavenCentral()
Expand All @@ -21,6 +21,17 @@ rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
}
}
}
}
subprojects {
project.evaluationDependsOn(':app')
}
Expand Down
3 changes: 3 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "com.android.application" version '8.4.0' apply false
}

include ":app"
Binary file added assets/images/gemini.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 18 additions & 18 deletions dailyal_support/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ packages:
dependency: "direct main"
description:
name: dio
sha256: e17f6b3097b8c51b72c74c9f071a605c47bcc8893839bd66732457a5ebe73714
sha256: "0dfb6b6a1979dac1c1245e17cef824d7b452ea29bd33d3467269f9bef3715fb0"
url: "https://pub.dev"
source: hosted
version: "5.5.0+1"
version: "5.6.0"
dio_web_adapter:
dependency: transitive
description:
name: dio_web_adapter
sha256: "36c5b2d79eb17cdae41e974b7a8284fec631651d2a6f39a8a2ff22327e90aeac"
sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
version: "2.0.0"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -108,26 +108,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.1"
line_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -156,18 +156,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.8.0"
version: "0.11.1"
meta:
dependency: transitive
description:
name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.15.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -233,10 +233,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.7.2"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -321,10 +321,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
url: "https://pub.dev"
source: hosted
version: "13.0.0"
version: "14.2.4"
web:
dependency: transitive
description:
Expand Down
67 changes: 58 additions & 9 deletions dal-api/dal_commons/lib/src/model/html/anime/animereviewhtml.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,65 @@ final reactionBoxes = [
"Creative"
];

class ContentReviewSummary with ToJson {
final List<ReviewItem> pros;
final List<ReviewItem> cons;
final String verdict;
ContentReviewSummary(this.pros, this.cons, this.verdict);

factory ContentReviewSummary.fromJson(Map<String, dynamic>? json) {
return json != null
? ContentReviewSummary(
(json['pros'] as List)
.map((e) => ReviewItem.fromJson(e))
.toList(),
(json['cons'] as List)
.map((e) => ReviewItem.fromJson(e))
.toList(),
json['verdict'])
: ContentReviewSummary([], [], '');
}

@override
Map<String, dynamic> toJson() {
return {
"pros": pros.map((e) => e.toJson()).toList(),
"cons": cons.map((e) => e.toJson()).toList(),
"verdict": verdict
};
}
}

class ReviewItem with ToJson {
final String title;
final String description;
ReviewItem({required this.title, required this.description});

@override
Map<String, dynamic> toJson() {
return {
"title": title,
"description": description
};
}

factory ReviewItem.fromJson(Map<String, dynamic>? json) {
return json != null
? ReviewItem(title: json['title'], description: json['description'])
: ReviewItem(title: '', description: '');
}
}

class AnimeReviewHtml with ToJson {
final String ?userName;
final String ?timeAdded;
final String ?userPicture;
final String ?overallRating;
final String ?reviewText;
final List<String> ?tags;
final List<String> ?reactionBox;
bool ?fromCache;
final dal_node.Node ?relatedNode;
final String? userName;
final String? timeAdded;
final String? userPicture;
final String? overallRating;
final String? reviewText;
final List<String>? tags;
final List<String>? reactionBox;
bool? fromCache;
final dal_node.Node? relatedNode;

AnimeReviewHtml({
this.userName,
Expand Down
9 changes: 9 additions & 0 deletions dal-api/dal_commons/lib/src/model/servers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Servers {
String? dalAPIUrl;
String? telegramLink;
String? storeUrl;
Map<String, bool>? featureFlags;
List<PlatformMaintenances>? platformMaintenances;

Servers({
Expand All @@ -23,6 +24,7 @@ class Servers {
this.errorLogging,
this.maxLoad,
this.platformMaintenances,
this.featureFlags,
});

Servers.fromJson(Map<String, dynamic>? json) {
Expand All @@ -42,6 +44,12 @@ class Servers {
platformMaintenances?.add(PlatformMaintenances.fromJson(v));
});
}
if (json['featureFlags'] != null) {
featureFlags = {};
json['featureFlags'].forEach((k, v) {
featureFlags![k] = v;
});
}
if (json['preferredServers'] != null) {
preferredServers = [];
json['preferredServers'].forEach((v) {
Expand All @@ -63,6 +71,7 @@ class Servers {
data['dalAPIUrl'] = dalAPIUrl;
data['telegramLink'] = telegramLink;
data['storeUrl'] = storeUrl;
data['featureFlags'] = featureFlags;
data['platformMaintenances'] =
platformMaintenances?.map((v) => v.toJson()).toList();
return data;
Expand Down
Loading

0 comments on commit 5fbaa36

Please sign in to comment.