Skip to content

Commit

Permalink
Merge pull request #28 from BobbyESP/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbyESP committed Apr 5, 2023
2 parents 8531e08 + 723f8b5 commit e7f6435
Show file tree
Hide file tree
Showing 80 changed files with 7,032 additions and 1,493 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ A Spotify songs downloader powered by [spotDL](https://github.com/spotDL/spotify
</div>

## ⚠️ Warning
The Spotify mods downloader has been deleted by request of the xManager team. This is because having the mod downloader in Spowlo meant an avoid of their ads/earning methods. xManager has to pay servers and they pay those just for making the users have free Spotify, I hope that you all understand.

please, instead use the [xManager app](https://github.com/xManager-App/xManager). Maybe somme day I create an app for them who knows haha
Spowlo uses YT Music and YouTube to download the songs. This is because Spotify DRM bypassing can lead to an account ban and legal issues. If YT Music isn't available in your country, don't worry, you can still use YouTube as audio provider or use a VPN. We are working on making a regional bypass so don't matter your region. Thank you for understanding.

## 🔮 Features

Expand All @@ -51,6 +49,11 @@ For most devices, it is recommended to install the **ARM64-v8a** version of the

- Download the latest stable version from [GitHub releases](https://github.com/BobbyESP/Spowlo/releases/latest)

## Translation

We are using Hosted Weblate for the translations of the app. if you want to contribute follow [this link](https://hosted.weblate.org/engage/spowlo/) 🖇️


## 📖Credits
Thanks to [xnetcat](https://github.com/xnetcat) for it's help with some spotDL related things!

Expand Down
46 changes: 36 additions & 10 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ sealed class Version(

val currentVersion: Version = Version.Stable(
versionMajor = 1,
versionMinor = 2,
versionPatch = 1,
versionMinor = 3,
versionPatch = 0,
)

val keystorePropertiesFile = rootProject.file("keystore.properties")
Expand All @@ -71,7 +71,7 @@ android {
applicationId = "com.bobbyesp.spowlo"
minSdk = 26
targetSdk = 33
versionCode = 10201
versionCode = 10300

versionName = currentVersion.toVersionName().run {
if (!splitApks) "$this-(F-Droid)"
Expand Down Expand Up @@ -110,18 +110,42 @@ android {
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
packagingOptions {
resources.excludes.add("META-INF/*.kotlin_module")
}
if (keystorePropertiesFile.exists())
signingConfig = signingConfigs.getByName("debug")
//add client id and secret to build config
buildConfigField("String", "CLIENT_ID", "\"${project.properties["CLIENT_ID"]}\"")
buildConfigField(
"String",
"CLIENT_SECRET",
"\"${project.properties["CLIENT_SECRET"]}\""
)
matchingFallbacks.add(0, "debug")
matchingFallbacks.add(1, "release")
}
debug {
if (keystorePropertiesFile.exists())
signingConfig = signingConfigs.getByName("debug")
packagingOptions {
resources.excludes.add("META-INF/*.kotlin_module")
}
buildConfigField("String", "CLIENT_ID", "\"${project.properties["CLIENT_ID"]}\"")
buildConfigField(
"String",
"CLIENT_SECRET",
"\"${project.properties["CLIENT_SECRET"]}\""
)
matchingFallbacks.add(0, "debug")
matchingFallbacks.add(1, "release")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}
Expand Down Expand Up @@ -183,10 +207,11 @@ dependencies {
implementation(libs.accompanist.permissions)
implementation(libs.accompanist.navigation.animation)
implementation(libs.accompanist.webview)
implementation(libs.accompanist.pager.layouts)
implementation(libs.accompanist.pager.indicators)
implementation(libs.accompanist.flowlayout)
implementation(libs.accompanist.material)
implementation(libs.accompanist.pager.indicators)
implementation(libs.paging.compose)
implementation(libs.paging.runtime)

implementation(libs.coil.kt.compose)

Expand Down Expand Up @@ -214,13 +239,14 @@ dependencies {

implementation(libs.markdown)
//Exoplayer
implementation(libs.exoplayer.core)
implementation(libs.exoplayer.ui)
implementation(libs.exoplayer.dash)
implementation(libs.exoplayer.smoothstreaming)
implementation(libs.exoplayer.extension.mediasession)
// implementation(libs.exoplayer.core)
// implementation(libs.exoplayer.ui)
// implementation(libs.exoplayer.dash)
// implementation(libs.exoplayer.smoothstreaming)
// implementation(libs.exoplayer.extension.mediasession)

implementation(libs.customtabs)
// implementation(libs.shimmer)

debugImplementation(libs.crash.handler)

Expand Down
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
android:value="true" />
</service>

<service android:name=".DownloaderKeepUpService"
android:enabled="true"
android:exported="false" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.bobbyesp.spowlo.provider"
Expand All @@ -101,6 +105,7 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
<receiver android:name=".NotificationActionReceiver" />
</application>

</manifest>
72 changes: 42 additions & 30 deletions app/src/main/java/com/bobbyesp/spowlo/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,27 @@ import android.annotation.SuppressLint
import android.app.Application
import android.content.ClipData
import android.content.ClipboardManager
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.ServiceConnection
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.net.ConnectivityManager
import android.os.Build
import android.os.Environment
import android.os.IBinder
import android.os.Looper
import androidx.core.content.getSystemService
import com.bobbyesp.ffmpeg.FFmpeg
import com.bobbyesp.library.SpotDL
import com.bobbyesp.spowlo.utils.AUDIO_DIRECTORY
import com.bobbyesp.spowlo.utils.DownloaderUtil
import com.bobbyesp.spowlo.utils.EXTRA_DIRECTORY
import com.bobbyesp.spowlo.utils.FilesUtil
import com.bobbyesp.spowlo.utils.FilesUtil.createEmptyFile
import com.bobbyesp.spowlo.utils.FilesUtil.getCookiesFile
import com.bobbyesp.spowlo.utils.NotificationsUtil
import com.bobbyesp.spowlo.utils.PreferencesUtil
import com.bobbyesp.spowlo.utils.PreferencesUtil.getString
import com.bobbyesp.spowlo.utils.ToastUtil
Expand Down Expand Up @@ -69,12 +75,17 @@ class App : Application() {
getString(R.string.app_name)
).absolutePath
)
extraDownloadDir = EXTRA_DIRECTORY.getString(
""
)
if (Build.VERSION.SDK_INT >= 26) NotificationsUtil.createNotificationChannel()
}

companion object {
private const val PRIVATE_DIRECTORY_SUFFIX = ".Spowlo"
lateinit var clipboard: ClipboardManager
lateinit var audioDownloadDir: String
lateinit var extraDownloadDir: String
lateinit var applicationScope: CoroutineScope
lateinit var connectivityManager: ConnectivityManager
lateinit var packageInfo: PackageInfo
Expand All @@ -83,36 +94,37 @@ class App : Application() {
const val userAgentHeader =
"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Mobile Safari/537.36 Edg/105.0.1343.53"

/* var isServiceRunning = false
private val connection = object : ServiceConnection {
override fun onServiceConnected(className: ComponentName, service: IBinder) {
val binder = service as DownloadService.DownloadServiceBinder
isServiceRunning = true
}
override fun onServiceDisconnected(arg0: ComponentName) {
}
}
fun startService() {
if (isServiceRunning) return
Intent(context.applicationContext, DownloadService::class.java).also { intent ->
context.applicationContext.bindService(intent, connection, Context.BIND_AUTO_CREATE)
}
}
fun stopService() {
if (!isServiceRunning) return
try {
isServiceRunning = false
context.applicationContext.run {
unbindService(connection)
}
} catch (e: Exception) {
e.printStackTrace()
}
}*/
var isServiceRunning = false

private val connection = object : ServiceConnection {
override fun onServiceConnected(className: ComponentName, service: IBinder) {
val binder = service as DownloaderKeepUpService.DownloadServiceBinder
isServiceRunning = true
}

override fun onServiceDisconnected(arg0: ComponentName) {

}
}

fun startService() {
if (isServiceRunning) return
Intent(context.applicationContext, DownloaderKeepUpService::class.java).also { intent ->
context.applicationContext.bindService(intent, connection, Context.BIND_AUTO_CREATE)
}
}

fun stopService() {
if (!isServiceRunning) return
try {
isServiceRunning = false
context.applicationContext.run {
unbindService(connection)
}
} catch (e: Exception) {
e.printStackTrace()
}
}


fun getPrivateDownloadDirectory(): String =
Expand Down
Loading

0 comments on commit e7f6435

Please sign in to comment.