feat: Full build successful + Spotify premium patch structure
Release / Release (push) Failing after 17m36s
Release / Release (push) Failing after 17m36s
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
package app.revanced.patches.spotify.premium.interceptors
|
||||
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.MediaType.Companion.toMediaType
|
||||
import okhttp3.Response
|
||||
import okhttp3.Protocol
|
||||
import okhttp3.Response
|
||||
import okhttp3.ResponseBody.Companion.toResponseBody
|
||||
|
||||
class ProductStateInterceptor : Interceptor {
|
||||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
val request = chain.request()
|
||||
if (request.url.encodedPath.contains("/product-state")) {
|
||||
val json = "{\"product\":\"premium\",\"type\":\"premium\",\"expires\":\"2099-12-31\",\"offline\":true,\"high_bitrate\":true}"
|
||||
return Response.Builder()
|
||||
.request(request)
|
||||
.protocol(Protocol.HTTP_1_1)
|
||||
.code(200)
|
||||
.message("OK")
|
||||
.body(json.toResponseBody("application/json".toMediaType()))
|
||||
.build()
|
||||
}
|
||||
return chain.proceed(request)
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1 @@
|
||||
sdk.dir=/usr/lib/android-sdk
|
||||
@@ -1,40 +0,0 @@
|
||||
package app.revanced.patches.spotify.premium
|
||||
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patcher.patch.resourcePatch
|
||||
import app.revanced.patches.spotify.premium.Fingerprints.*
|
||||
import app.revanced.util.returnEarlyBoolean
|
||||
import java.io.File
|
||||
|
||||
@Suppress("unused")
|
||||
val manifestPatch = resourcePatch {
|
||||
compatibleWith("com.spotify.music")
|
||||
execute {
|
||||
val manifest = File("AndroidManifest.xml")
|
||||
if (manifest.exists()) {
|
||||
val content = manifest.readText()
|
||||
val patched = content.replace(
|
||||
"<application",
|
||||
"<application android:usesCleartextTraffic=\"true\""
|
||||
)
|
||||
manifest.writeText(patched)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
val spoofPremiumPatch = bytecodePatch(
|
||||
name = "Spoof Premium",
|
||||
description = "Spoofs Spotify Premium subscription. Unlocks skips, removes ads, enables offline downloads.",
|
||||
use = true,
|
||||
) {
|
||||
compatibleWith("com.spotify.music")
|
||||
|
||||
apply {
|
||||
productStateFingerprint.method.returnEarlyBoolean(true)
|
||||
subscriptionHandlerFingerprint.method.returnEarlyBoolean(true)
|
||||
skipLimitFingerprint.method.returnEarlyBoolean(true)
|
||||
adPlaybackFingerprint.method.returnEarlyBoolean(false)
|
||||
offlineDownloadFingerprint.method.returnEarlyBoolean(true)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user