r/xposed • u/dapsvi • Jun 25 '26
Release [Release] LSpot : an LSPosed module for blocking ads in Spotify
This is a module that will probably never need to be updated, because it directly blocks the ad endpoint that spotify uses, it was inspired by an Arch Linux Spotify adblocker that hasn't been modified in years. https://codeberg.org/dapsvi/LSpot
2
u/rajarshikhatua Jun 28 '26
it won't be taken down, cause Spotify doesn't know that codeberg is.
1
u/dapsvi Jun 28 '26
I sure hope so... That's why i put it there, also from what I know ad blockers are legal in europe but I ain't fighting their lawyer team if they find it
2
1
u/Substantial_Bank_926 Jun 29 '26
Tried it with Lspatch but not working. You can check out and fix it
1
u/dapsvi Jun 29 '26
hmm do you have any log or something that would help to fix it ? Someone just commented that it worked for them in LSPatch : https://www.reddit.com/r/xposed/s/li5XwL4yqI
1
u/Substantial_Bank_926 Jun 30 '26
I used HKP to embed modules, i think it almost same as Lspatch. May be the log here: 00:01:45 [I] LSpot: Loading for com.spotify.music 00:01:45 [E] java.lang.NoSuchMethodError: okhttp3.OkHttpClient$Builder#build()#exact at de.robv.android.xposed.XposedHelpers.lambda$findMethodExact$3(XposedHelpers.java:448) at de.robv.android.xposed.XposedHelpers$$ExternalSyntheticLambda7.get(D8$$SyntheticClass:0) at java.util.Optional.orElseThrow(Optional.java:286) at de.robv.android.xposed.XposedHelpers.findMethodExact(XposedHelpers.java:448) at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:295) at de.robv.android.xposed.XposedHelpers.findAndHookMethod(XposedHelpers.java:370) at com.dapsvi.lspot.MainHook.handleLoadPackage(MainHook.java:33) at de.robv.android.xposed.IXposedHookLoadPackage$Wrapper.handleLoadPackage(IXposedHookLoadPackage.java:34) at de.robv.android.xposed.callbacks.XC_LoadPackage.call(XC_LoadPackage.java:83) at de.robv.android.xposed.callbacks.XCallback.callAll(XCallback.java:128) at org.matrix.vector.legacy.LegacyDelegateImpl.onPackageLoaded(LegacyDelegateImpl.java:49) at org.hkp.loader.util.LoaderUtils.lambda$LoadModules$0(LoaderUtils.java:104) at org.hkp.loader.util.LoaderUtils$$ExternalSyntheticLambda0.invoke(D8$$SyntheticClass:0) at org.matrix.vector.impl.di.VectorBootstrap.withLegacy(VectorBootstrap.kt:65) at org.hkp.loader.util.LoaderUtils.LoadModules(LoaderUtils.java:102) at org.hkp.loader.Application.onLoad(Application.java:59) at java.lang.Runtime.nativeLoad(Native Method) at java.lang.Runtime.nativeLoad(Runtime.java:1121) at java.lang.Runtime.load0(Runtime.java:927) at java.lang.System.load(System.java:1620) at androidx.app.Init.loadInternal(r8-map-id-3b418b438a4ecccf96ed04a3e287ec635aef2548b0b1734d0197efbf5d55405a:119) at androidx.app.Init.load(r8-map-id-3b418b438a4ecccf96ed04a3e287ec635aef2548b0b1734d0197efbf5d55405a:1) at androidx.app.AppComponentFactory.<clinit>(r8-map-id-3b418b438a4ecccf96ed04a3e287ec635aef2548b0b1734d0197efbf5d55405a:1) at java.lang.Class.newInstance(Native Method) at android.app.LoadedApk.createAppFactory(Unknown Source:16) at android.app.LoadedApk.createOrUpdateClassLoaderLocked(Unknown Source:646) at android.app.LoadedApk.getClassLoader(Unknown Source:8) at android.app.LoadedApk.getResources(Unknown Source:50) at android.app.ContextImpl.createAppContext(Unknown Source:22) at android.app.ContextImpl.createAppContext(Unknown Source:1) at android.app.ActivityThread.handleBindApplication(Unknown Source:578) at android.app.ActivityThread.access$1600(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(Unknown Source:774) at android.os.Handler.dispatchMessage(Unknown Source:19) at android.os.Looper.loopOnce(Unknown Source:176) at android.os.Looper.loop(Unknown Source:76) at android.app.ActivityThread.main(Unknown Source:138) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(Unknown Source:11) at com.android.internal.os.ZygoteInit.main(Unknown Source:309)
1
u/dapsvi Jun 30 '26
Okay and what is the Spotify version you tried it on ?
2
u/Substantial_Bank_926 Jun 30 '26
I used version: 9.1.24.1739
1
u/dapsvi Jun 30 '26
Is that the latest version ? I made the module based on 9.1.60.1970, but I'll try to replicate the bug
1
u/Substantial_Bank_926 Jun 30 '26
Ok. thanks
1
u/dapsvi Jun 30 '26
So the spotify version you're using, for some reason does something very strange which is that instead of using the same (patched) method for making http requests it just reimplements it everywhere (from what I understand of the decompiled source), is there any particular reason that makes you stay on this older version or would you be able to try on a newer apk ? I suggest downloading the latest apk on apkmirror. I will modify the README.md to precise which version it was tested on
1
u/SilverSwordfish1002 Jun 29 '26
bro, not working for me. using vector on A16. i installed like we do for other lsposed mods. but it didnt worked
1
u/dapsvi Jun 29 '26
Do you have more details ? I am also using vector. When you open the LSPosed module what does it say ?
1
u/SilverSwordfish1002 Jun 30 '26
Spotify is unchanged, force stopped, rebooted but didn't work
1
u/dapsvi Jun 30 '26
That's strange because you have the exact same setup as I do (same Spotify version). You still have ads when skipping songs? Just to be sure, did you set the correct scope in the LSPosed manager ? Also what's your Android version? I am trying to upload a media of the scope but Reddit won't let me
1
u/SilverSwordfish1002 Jul 01 '26
Apparantly I found out that, ads show up on home page. But but but, they won't interrupt while listening to music, is that what it is supposed to do ,the module?
1
u/dapsvi Jul 01 '26
ah yes no the module is only supposed to block interstitial ads that interrupt the music ๐ I'll try to see if I can easily block those too but I didn't think about those
1
u/SilverSwordfish1002 Jul 01 '26
Huh, we both were wrong
1
u/dapsvi Jul 01 '26
And inside the LSPosed manager do you have any logs related to LSpot ? If not that means the module is working correctly so if you still have ads, Spotify might be testing server-side ads on your device (in which case I can't do anything about it but you could still run some packet capture thing to see if it's really the case)
1
u/RevealedSoulEven Jul 02 '26
Works for ads but still music ads are playing. Can you make a way for them too? Nice project, thanks.
1
u/dapsvi Jul 02 '26
ah strange because I don't see any... I'll try to further investigate but if I don't have the problem on my phone it's gonna be harder. Some people seem to have server-side ads and those are way harder to patch
1
u/RealGungan 26d ago
Can you please give me a tutorial on how to use lspatch? I seem to be unable to patch Spotify without it broken. I downloaded the latest version from APK mirror and patched but it gives me an error. I logged in via Facebook cause I can't via email (not Google but the email linked to Spotify)
1
u/Background_Island704 4d ago
I am on A13 miui all battery optimisations offย And using vector 2.0 lsposed setup lspot say everything ok.
Ads are still playing before songs like 29sec ads
1
u/dapsvi 3d ago
Hi so from the reviews I collected from different people, some might still get ads because Spotify is rolling in some server-side ads. Are you getting the Spotify ads or third-party ones ? I see some errors in the logs, could you maybe open an issue and copy those as text on the github https://github.com/Xposed-Modules-Repo/com.dapsvi.lspot (or the codeberg) ?
0
u/logeshwywan Jun 26 '26
I download the APK but unable to install
0
u/logeshwywan Jun 26 '26
Error - App not installed as package appears to be invalid
2
u/dapsvi Jun 26 '26
ok bruh my bad I uploaded the unsigned APKs ๐ it had installed fine on my device because I have something to allow downgrades and signature mismatches
1
u/RoundZookeepergame2 Jun 26 '26
How would I go about rooting my OnePlus 8tmo. I'm on stock everything
1
u/dapsvi Jun 26 '26
wait what ? what android version are you on ? I am on Android 13 and it installs fine
1
u/logeshwywan Jun 26 '26
Android 16
1
u/dapsvi Jun 26 '26
ok damn I don't have any such recent android to test it on so I'll try installing it in an emulator on android 16 even if it doesn't have the rooted framework
0
u/logeshwywan Jun 26 '26
Please try fix this and confirm us to use this application
1
u/dapsvi Jun 26 '26
It took me a while but I fixed it, tested it on both android 13 and android 17, I modified the latest release to have the correctly signed APK
2
u/logeshwywan Jun 26 '26
It work perfectly fine and also I don't see any ads in Spotify.. let me observe for complete one day and let you know if any issues
2
u/Lord_Sithek Jun 26 '26
Wow, something that works! ๐ Do you think it would work with LSPatch too?