1.6.6.2-beta
This commit is contained in:
parent
236f83d161
commit
0b8cd7125f
19 changed files with 59 additions and 5467 deletions
|
|
@ -3,6 +3,12 @@
|
|||
YTDLnis
|
||||
</h1>
|
||||
|
||||
<div align="center">
|
||||
<a href="https://github.com/JunkFood02/Seal/blob/main/README.md">English</a>
|
||||
|
|
||||
Azərbaycanca
|
||||
</div>
|
||||
|
||||
<h3 align="center">
|
||||
YTDLnis Android 6.0 və yuxarı üçün yt-dlp istifadə edən pulsuz və açıq mənbəli video/səs yükləyicidir.
|
||||
</h3>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,12 @@
|
|||
YTDLnis
|
||||
</h1>
|
||||
|
||||
<div align="center">
|
||||
<a href="https://github.com/JunkFood02/Seal/blob/main/README.md">English</a>
|
||||
|
|
||||
Português
|
||||
</div>
|
||||
|
||||
<h3 align="center">
|
||||
YTDLnis é um aplicativo de download de vídeo/áudio gratuito e de código aberto usando yt-dlp para Android 6.0 e superior.
|
||||
</h3>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,14 @@
|
|||
YTDLnis
|
||||
</h1>
|
||||
|
||||
<div align="center">
|
||||
English
|
||||
|
|
||||
<a href="https://github.com/JunkFood02/Seal/blob/main/README-az.md">Azərbaycanca</a>
|
||||
|
|
||||
<a href="https://github.com/JunkFood02/Seal/blob/main/README-pt.md">Português</a>
|
||||
</div>
|
||||
|
||||
<h3 align="center">
|
||||
YTDLnis is a free and open source video/audio downloader using yt-dlp for Android 6.0 and above.
|
||||
</h3>
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
-dontobfuscate
|
||||
|
|
@ -10,7 +10,7 @@ def properties = new Properties()
|
|||
def versionMajor = 1
|
||||
def versionMinor = 6
|
||||
def versionPatch = 6
|
||||
def versionBuild = 1 // bump for dogfood builds, public betas, etc.
|
||||
def versionBuild = 2 // bump for dogfood builds, public betas, etc.
|
||||
def versionExt = ""
|
||||
|
||||
if (versionBuild > 0){
|
||||
|
|
@ -63,43 +63,19 @@ android {
|
|||
release {
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
manifestPlaceholders = [appName: RELEASE_NAME]
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
debuggable false
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
|
||||
beta {
|
||||
minifyEnabled true
|
||||
shrinkResources true
|
||||
manifestPlaceholders = [appName: BETA_NAME]
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
debuggable false
|
||||
signingConfig signingConfigs.debug
|
||||
versionNameSuffix '-beta'
|
||||
}
|
||||
|
||||
debug {
|
||||
minifyEnabled false
|
||||
manifestPlaceholders = [appName: RELEASE_NAME]
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
debuggable true
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
|
||||
benchmark {
|
||||
initWith release
|
||||
manifestPlaceholders = [appName: RELEASE_NAME]
|
||||
proguardFiles 'baseline-profiles-rules.pro'
|
||||
debuggable false
|
||||
matchingFallbacks ['release']
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
}
|
||||
|
||||
lintOptions{
|
||||
disable 'MissingTranslation'
|
||||
}
|
||||
|
||||
android.applicationVariants.configureEach { variant ->
|
||||
variant.outputs.each { output ->
|
||||
|
|
@ -157,7 +133,6 @@ dependencies {
|
|||
implementation "androidx.navigation:navigation-ui-ktx:$navVer"
|
||||
implementation 'androidx.core:core-ktx:1.10.1'
|
||||
implementation 'androidx.test.ext:junit-ktx:1.1.5'
|
||||
implementation 'androidx.benchmark:benchmark-macro:1.1.1'
|
||||
testImplementation "junit:junit:$junitVer"
|
||||
androidTestImplementation "junit:junit:$junitVer"
|
||||
androidTestImplementation "androidx.test.ext:junit:$androidJunitVer"
|
||||
|
|
|
|||
2
app/proguard-rules.pro
vendored
2
app/proguard-rules.pro
vendored
|
|
@ -24,6 +24,8 @@
|
|||
-keep class com.google.gson.** { *; }
|
||||
-keep class com.deniscerri.ytdlnis.database.models.AudioPreferences
|
||||
-keep class com.deniscerri.ytdlnis.database.models.VideoPreferences
|
||||
-keep class com.deniscerri.ytdlnis.database.models.GithubRelease
|
||||
-keep class com.deniscerri.ytdlnis.database.models.GithubReleaseAsset
|
||||
-keepclassmembers,allowobfuscation class * {
|
||||
@com.google.gson.annotations.SerializedName <fields>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
android:enableOnBackInvokedCallback="true"
|
||||
android:extractNativeLibs="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="${appName}"
|
||||
android:label="YTDLnis"
|
||||
android:localeConfig="@xml/locales_config"
|
||||
android:requestLegacyExternalStorage="true"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -2,9 +2,12 @@ package com.deniscerri.ytdlnis.database.repository
|
|||
|
||||
import androidx.paging.Pager
|
||||
import androidx.paging.PagingConfig
|
||||
import com.deniscerri.ytdlnis.App
|
||||
import com.deniscerri.ytdlnis.database.dao.DownloadDao
|
||||
import com.deniscerri.ytdlnis.database.models.DownloadItem
|
||||
import com.deniscerri.ytdlnis.util.FileUtil
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
import java.io.File
|
||||
|
||||
|
||||
class DownloadRepository(private val downloadDao: DownloadDao) {
|
||||
|
|
@ -45,7 +48,16 @@ class DownloadRepository(private val downloadDao: DownloadDao) {
|
|||
}
|
||||
|
||||
suspend fun delete(id: Long){
|
||||
val item = getItemByID(id)
|
||||
downloadDao.delete(id)
|
||||
deleteCache(listOf(item))
|
||||
}
|
||||
|
||||
private fun deleteCache(items: List<DownloadItem>) {
|
||||
val cacheDir = FileUtil.getCachePath(App.instance)
|
||||
items.forEach {
|
||||
File(cacheDir, it.id.toString()).deleteRecursively()
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun update(item: DownloadItem){
|
||||
|
|
@ -87,11 +99,15 @@ class DownloadRepository(private val downloadDao: DownloadDao) {
|
|||
}
|
||||
|
||||
suspend fun deleteCancelled(){
|
||||
val cancelled = getCancelledDownloads()
|
||||
downloadDao.deleteCancelled()
|
||||
deleteCache(cancelled)
|
||||
}
|
||||
|
||||
suspend fun deleteErrored(){
|
||||
val errored = getErroredDownloads()
|
||||
downloadDao.deleteErrored()
|
||||
deleteCache(errored)
|
||||
}
|
||||
|
||||
suspend fun deleteSaved(){
|
||||
|
|
|
|||
|
|
@ -57,7 +57,20 @@ class UpdateUtil(var context: Context) {
|
|||
v = res.first { !it.tag_name.contains("beta", true) }
|
||||
}
|
||||
|
||||
if (BuildConfig.VERSION_NAME == v.tag_name.removePrefix("v")){
|
||||
val current = BuildConfig.VERSION_NAME.replace("-beta", "").replace(".", "").toInt()
|
||||
val incoming = v.tag_name.removePrefix("v").replace("-beta", "").replace(".", "").toInt()
|
||||
|
||||
Log.e("aa", current.toString())
|
||||
Log.e("aa", incoming.toString())
|
||||
|
||||
var isInLatest = true
|
||||
if ((BuildConfig.VERSION_NAME.contains("beta", true) && !useBeta) ||
|
||||
(!BuildConfig.VERSION_NAME.contains("beta", true) && useBeta) ||
|
||||
current < incoming ){
|
||||
isInLatest = false
|
||||
}
|
||||
|
||||
if (isInLatest){
|
||||
result(context.getString(R.string.you_are_in_latest_version))
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class DownloadWorker(
|
|||
val foregroundInfo = ForegroundInfo(Random.nextInt(1000000000), workNotif)
|
||||
setForegroundAsync(foregroundInfo)
|
||||
|
||||
queuedItems.collectLatest { items ->
|
||||
queuedItems.collect { items ->
|
||||
runningYTDLInstances.clear()
|
||||
dao.getActiveDownloadsList().forEach {
|
||||
runningYTDLInstances.add(it.id)
|
||||
|
|
@ -88,7 +88,6 @@ class DownloadWorker(
|
|||
val eligibleDownloads = items.take(if (concurrentDownloads < 0) 0 else concurrentDownloads).filter { it.id !in running }
|
||||
|
||||
eligibleDownloads.forEach{downloadItem ->
|
||||
runningYTDLInstances.add(downloadItem.id)
|
||||
val notification = notificationUtil.createDownloadServiceNotification(pendingIntent, downloadItem.title, downloadItem.id.toInt())
|
||||
notificationUtil.notify(downloadItem.id.toInt(), notification)
|
||||
|
||||
|
|
@ -153,7 +152,6 @@ class DownloadWorker(
|
|||
}
|
||||
}
|
||||
}.onSuccess {
|
||||
runningYTDLInstances.remove(downloadItem.id)
|
||||
val wasQuickDownloaded = updateDownloadItem(downloadItem, infoUtil, dao, resultDao)
|
||||
runBlocking {
|
||||
var finalPaths : List<String>?
|
||||
|
|
@ -233,7 +231,6 @@ class DownloadWorker(
|
|||
}
|
||||
|
||||
}.onFailure {
|
||||
runningYTDLInstances.remove(downloadItem.id)
|
||||
FileUtil.deleteConfigFiles(request)
|
||||
|
||||
withContext(Dispatchers.Main){
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/bottom_sheet_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:maxLines="2"
|
||||
|
|
@ -39,14 +39,14 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/bottom_sheet_subtitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:singleLine="false"
|
||||
android:text="@string/configure_download"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/bottomsheet_schedule_button"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintEnd_toStartOf="@+id/bottomsheet_schedule_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bottom_sheet_title" />
|
||||
|
||||
|
|
|
|||
1
benchmark/.gitignore
vendored
1
benchmark/.gitignore
vendored
|
|
@ -1 +0,0 @@
|
|||
/build
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
import com.android.build.api.dsl.ManagedVirtualDevice
|
||||
|
||||
plugins {
|
||||
id 'com.android.test'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'com.example.benchmark'
|
||||
compileSdk 33
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdk 23
|
||||
targetSdk 33
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
testOptions{
|
||||
managedDevices {
|
||||
devices{
|
||||
pixel2Api31(ManagedVirtualDevice){
|
||||
device = "Pixel 2"
|
||||
apiLevel = 31
|
||||
systemImageSource = "aosp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
// This benchmark buildType is used for benchmarking, and should function like your
|
||||
// release build (for example, with minification on). It's signed with a debug key
|
||||
// for easy local/CI testing.
|
||||
benchmark {
|
||||
debuggable = true
|
||||
signingConfig = debug.signingConfig
|
||||
matchingFallbacks = ["release"]
|
||||
}
|
||||
}
|
||||
|
||||
targetProjectPath = ":app"
|
||||
experimentalProperties["android.experimental.self-instrumenting"] = true
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.test.ext:junit:1.1.5'
|
||||
implementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
implementation 'androidx.test.uiautomator:uiautomator:2.2.0'
|
||||
implementation 'androidx.benchmark:benchmark-macro-junit4:1.1.1'
|
||||
}
|
||||
|
||||
androidComponents {
|
||||
beforeVariants(selector().all()) {
|
||||
enabled = buildType == "benchmark"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<queries>
|
||||
<package android:name="com.deniscerri.ytdl" />
|
||||
</queries>
|
||||
</manifest>
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
package com.example.benchmark
|
||||
|
||||
import androidx.benchmark.macro.StartupMode
|
||||
import androidx.benchmark.macro.StartupTimingMetric
|
||||
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
/**
|
||||
* This is an example startup benchmark.
|
||||
*
|
||||
* It navigates to the device's home screen, and launches the default activity.
|
||||
*
|
||||
* Before running this benchmark:
|
||||
* 1) switch your app's active build variant in the Studio (affects Studio runs only)
|
||||
* 2) add `<profileable android:shell="true" />` to your app's manifest, within the `<application>` tag
|
||||
*
|
||||
* Run this benchmark from Studio to see startup measurements, and captured system traces
|
||||
* for investigating your app's performance.
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleStartupBenchmark {
|
||||
@get:Rule
|
||||
val benchmarkRule = MacrobenchmarkRule()
|
||||
|
||||
@Test
|
||||
fun startup() = benchmarkRule.measureRepeated(
|
||||
packageName = "com.deniscerri.ytdl",
|
||||
metrics = listOf(StartupTimingMetric()),
|
||||
iterations = 5,
|
||||
startupMode = StartupMode.COLD
|
||||
) {
|
||||
pressHome()
|
||||
startActivityAndWait()
|
||||
}
|
||||
}
|
||||
|
|
@ -25,9 +25,6 @@ buildscript {
|
|||
media3_version = "1.1.1"
|
||||
agp_version = '8.1.0'
|
||||
agp_version1 = '7.4.2'
|
||||
|
||||
RELEASE_NAME = 'YTDLnis'
|
||||
BETA_NAME = 'YTDLnis [BETA]'
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ android.enableJetifier=true
|
|||
android.nonFinalResIds=false
|
||||
android.nonTransitiveRClass=false
|
||||
android.useAndroidX=true
|
||||
org.gradle.jvmargs=-Xmx4608m -Dfile.encoding=UTF-8
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
|
|
|
|||
|
|
@ -21,4 +21,3 @@ dependencyResolutionManagement {
|
|||
rootProject.name = "YTDLnis"
|
||||
|
||||
include ':common', ':app', ':library', ':ffmpeg'
|
||||
include ':benchmark'
|
||||
|
|
|
|||
Loading…
Reference in a new issue