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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release
**/ios/Flutter/ephemeral/
64 changes: 31 additions & 33 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
plugins {
id "com.android.application"
id "org.jetbrains.kotlin.android"
id "dev.flutter.flutter-gradle-plugin"
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33

namespace "com.hustlecreatives.flood_mobile"
compileSdkVersion 36

defaultConfig {
multiDexEnabled true
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
multiDexEnabled true
applicationId "com.hustlecreatives.flood_mobile"
minSdkVersion 21
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
minSdkVersion flutter.minSdkVersion
targetSdkVersion 36
versionCode flutter.versionCode
versionName flutter.versionName
}

dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'io.flutter:flutter_embedding_debug:1.0.0-d2913632a4578ee4d0b8b1c4a69888c8a0672c4b'

implementation project(':awesome_notifications')
implementation project(':file_picker')
implementation project(':flutter_downloader')
implementation project(':flutter_keyboard_visibility')
implementation project(':flutter_plugin_android_lifecycle')
implementation project(':fluttertoast')
implementation project(':optimize_battery')
implementation project(':package_info_plus')
implementation project(':path_provider_android')
implementation project(':permission_handler_android')
implementation project(':shared_preferences_android')
implementation project(':app_links')
implementation project(':uri_to_file')
implementation project(':url_launcher_android')
implementation project(':video_player_android')
implementation project(':wakelock_plus')
}

buildTypes {
Expand All @@ -53,4 +51,4 @@ android {

flutter {
source '../..'
}
}
4 changes: 4 additions & 0 deletions android/app/src/main/res/xml/provider_paths.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<external-path name="external_files" path="."/>
</paths>
50 changes: 34 additions & 16 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://storage.googleapis.com/download.flutter.io' }
}
}

Expand All @@ -23,9 +11,39 @@ subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'androidx.core' && details.requested.name == 'core') {
details.useVersion "1.13.1"
}
if (details.requested.group == 'androidx.core' && details.requested.name == 'core-ktx') {
details.useVersion "1.13.1"
}
if (details.requested.group == 'androidx.browser' && details.requested.name == 'browser') {
details.useVersion "1.8.0"
}
}
}
afterEvaluate { project ->
if (project.hasProperty("android")) {
project.dependencies {
compileOnly 'io.flutter:flutter_embedding_debug:1.0.0-d2913632a4578ee4d0b8b1c4a69888c8a0672c4b'
}
project.android {
if (namespace == null) {
def manifestFile = project.file('src/main/AndroidManifest.xml')
if (manifestFile.exists()) {
def manifest = new XmlSlurper().parse(manifestFile)
def packageName = manifest.@package.text()
namespace packageName
}
}
}
}
}
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
delete rootProject.buildDir
tasks.register("clean", Delete) {
delete rootProject.layout.buildDirectory
}
4 changes: 2 additions & 2 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4096M
android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=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 @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
61 changes: 53 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,56 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

plugins {
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
id "com.android.application" version "8.3.0" apply false
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
}

include ":app"

def plugins = [
'awesome_notifications': '/home/anurag/.pub-cache/hosted/pub.dev/awesome_notifications-0.10.1',
'file_picker': '/home/anurag/.pub-cache/hosted/pub.dev/file_picker-10.3.7',
'flutter_downloader': '/home/anurag/.pub-cache/hosted/pub.dev/flutter_downloader-1.12.0',
'flutter_keyboard_visibility': '/home/anurag/.pub-cache/hosted/pub.dev/flutter_keyboard_visibility-5.4.1',
'flutter_plugin_android_lifecycle': '/home/anurag/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.33',
'fluttertoast': '/home/anurag/.pub-cache/hosted/pub.dev/fluttertoast-9.0.0',
'optimize_battery': '/home/anurag/.pub-cache/hosted/pub.dev/optimize_battery-0.0.4',
'package_info_plus': '/home/anurag/.pub-cache/hosted/pub.dev/package_info_plus-9.0.0',
'path_provider_android': '/home/anurag/.pub-cache/hosted/pub.dev/path_provider_android-2.2.22',
'permission_handler_android': '/home/anurag/.pub-cache/hosted/pub.dev/permission_handler_android-13.0.1',
'shared_preferences_android': '/home/anurag/.pub-cache/hosted/pub.dev/shared_preferences_android-2.4.18',
'app_links': '/home/anurag/.pub-cache/hosted/pub.dev/app_links-6.4.1',
'uri_to_file': '/home/anurag/.pub-cache/hosted/pub.dev/uri_to_file-1.0.0',
'url_launcher_android': '/home/anurag/.pub-cache/hosted/pub.dev/url_launcher_android-6.3.28',
'video_player_android': '/home/anurag/.pub-cache/hosted/pub.dev/video_player_android-2.8.22',
'wakelock_plus': '/home/anurag/.pub-cache/hosted/pub.dev/wakelock_plus-1.4.0'
]

plugins.each { name, path ->
def pluginDirectory = new File(path, 'android')
if (pluginDirectory.exists()) {
include ":$name"
project(":$name").projectDir = pluginDirectory
} else {
println "Plugin $name android directory not found at $pluginDirectory"
}
}

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
2 changes: 1 addition & 1 deletion lib/Api/event_handler_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class EventHandlerApi {
),
abbreviated: true,
),
progress: homeModel.torrentList[id].percentComplete.round(),
progress: homeModel.torrentList[id].percentComplete,
summary: isPaused ? 'Paused' : 'Downloading',
locked: true,
autoDismissible: false,
Expand Down
Loading