ads not muted on Spotify / Android 8
unseenlarks opened this issue · comments
using a Sony Xperia X, running Android 8.0
Spotify version currently 8.7.8.233
Ad-silence version 0.5.2
Ad-silence has notification access and is enabled to mute ads. Spotify is enabled under 'select apps', and the Ad-silence notification is always visible on the notification drawer, regardless of Spotify status. battery optimisation is disabled for Ad-silence.
when ads are playing, the Ad-silence notification displays 'listening for ads', same as when music plays, or when Spotify itself is closed.
i also use Spotify Lite, but ads are muted every time (except for the final second), though.
let me know if i can provide any more information. thank you for your time.
It does not work in Android 12 either.
All aps are on latest version as of today.
@unseenlarks spotify lite
works but not spotify
🤔
I'll test this behaviour on a device with android 8
and get back to you. I think it might be related to Sony, if this is the case we can fix it with logcat.
I'll test this behaviour on a device with
android 8
and get back to you. I think it might be related to Sony, if this is the case we can fix it with logcat.
for interest's sake, this is what i'm trying out successfully with the latest Spotify build: https://github.com/abertschi/ad-free
@unseenlarks You'll likely have a better chance of getting it fixed if you provide Phone Model, Rom (stock or link to rom) along with Android version. Additionally you should include a logcat so he can investigate any errors. You can do that running an app like matlog which is available on google play as well as f-droid.org (free open source apps). If you have adb setup with your phone you can do "adb logcat > myerror.log" and then while that's running start the app and a music service....once the error has occured you can cancel the adb logcat with ctrl c.
Matlog is recommended as it has an option in the settings to remove anything important like phone numbers, email etc from the logcat.
Your log will show if it's finding ad's....example:
cat test.log | grep silence
03-26 15:06:15.301 4999 4999 D nodomain.freeyourgadget.gadgetbridge.externalevents.NotificationListener: Notification posted: bluepie.ad_silence: null
03-26 15:06:15.305 17735 17735 I PhoneNotificationListenerService: onNotificationPosted. Key: 0|bluepie.ad_silence|69|null|10455, PostTime: 1648321575076, Application Running: false, zionAccessoryConnected: false, ampdDevice: false
03-26 15:06:15.305 17735 17735 I PhoneNotificationListenerService: broadcastIntent - eventName = NOTIFICATION_POST, SBN Package = bluepie.ad_silence
03-26 15:06:15.305 17735 17735 I PhoneNotificationListenerService: createNotificationIntent - Parsed notification is null - SBN Package: bluepie.ad_silence
03-26 15:06:15.306 17804 17804 I Service : Notification from Ad-silence ignored for reason(s): Ignored app
03-26 15:06:15.337 25886 25886 V LASTMESSAGEi: Received last update Ad-silence - AdSilence, ad-detected
@unseenlarks I had collected physical devices from my friends & family for testing, but none of em have android 8
.
my only option is to run it on an emulator, in which I tested it multiple times..but works fine.
a logcat will greatly help!
android_api_27.mp4
mute log
2022-03-27 13:59:58.235 2723-2723/bluepie.ad_silence V/NotificationListenerService: new notification posted: SPOTIFY
2022-03-27 13:59:58.235 2723-2723/bluepie.ad_silence V/NotificationParser: detected Spotify -> SPOTIFY
2022-03-27 13:59:58.235 2723-2723/bluepie.ad_silence V/NotificationParser: detection in Spotify: Advertisement
2022-03-27 13:59:58.243 2723-2723/bluepie.ad_silence V/NotificationListenerService: 'MusicStream' muted? -> false
2022-03-27 13:59:58.243 2723-2723/bluepie.ad_silence V/NotificationListenerService: Ad detected muting, state-> true to false, currentPackage: SPOTIFY
unmute
2022-03-27 14:00:49.107 2723-2723/bluepie.ad_silence V/NotificationListenerService: new notification posted: SPOTIFY
2022-03-27 14:00:49.114 2723-2723/bluepie.ad_silence V/NotificationParser: detected Spotify -> SPOTIFY
2022-03-27 14:00:49.114 2723-2723/bluepie.ad_silence V/NotificationListenerService: Not an ad, Unmuting, > M
@famewolf thanks for the help!
this is all brilliant, that so many tools exist for debugging... but remember i'm not a dev like you both. so sadly i have no idea what adb is, or how to root my phone to access the full logcat as Matlog requests. i know the above might be something really basic for you both, but some of us can only humbly test something on our devices, as-is.
@unseenlarks You might include screenshots of what the notifications look like from spotify on android 8 when an ad is playing. Also a description of the specifics...does it totally ignore the ad or partially mute it? Regarding how to use adb....I assume you use windows (I use linux) so this might help: https://duckduckgo.com/?t=ffab&q=how+to+setup+adb+android&ia=web
I'm not a dev. Just another user of the app. Hope that helps.
i didn't include screenshots for the app's creator. but you can see i did try to explain what happened on my initial post on this thread.
i'm currently using an old laptop running Xubuntu 18.04. your link helps, i do at least know how to use a search engine. i did also find a thread on xda-developers that shows how to install adb, but it does read like a foreign language to me unfortunately.
so i guess i didn't explain myself properly--there are all sorts of users. working with something like adb might be quite simple for some people. for others, we're rather more afraid of bricking our only existing devices. 😅
I can promise that just using adb or adb logcat will in no way brick your device...it's also a good tool to upload or download files or entire directories using adb push and adb pull. ubuntu has a package that's just the adb and fastboot utils without having to install alot extra you can install via apt. [You'd also need to enable usb debugging on the phone which would require another search on youtube] https://youtu.be/xJMegy986v0
In short the "ad" in adb stands for android debugging and that's pretty much it's intended purpose. It can be overwhelming though so I just mention this so you can learn about it if you choose to.
well, i tried. installed adb and enabled USB debugging, but the error log that generated isn't showing anything like your example. also tried Matlog, allowing it the adb permission/command it requested to access all app logs, but it's not displaying much related to the app/its notifications either. just that it's enabled/running.
so i obviously did something wrong. clearly in over my head, sorry about that, you will obviously need someone who knows what they're doing. :(
Hey you made a lot of progress there. I would choose one of the two and save the log when the error occurs and then upload that file so that the dev can review it himself. He may see something that you and I miss. Also the log we're talking about isn't for one specific app. It's the log that everything gets written to about what's going on with your phone at any given time so it'll have a bunch of information.
the log helps a lot thanks!
NotificationListenerService: new notification posted: SPOTIFY
- From the above log, the app seems to be detecting and running fine.
NotificationParser: detected Spotify -> SPOTIFY
- then the above line is present, but the following
is not, meaning there was no
ads
playing when the log was captured orads
was playing but were undetected.
I think the later is at fault form your previous posts, can you specify whether you got an ad while the log was running?
Also can you take screenshots of the notifications when the ad is playing? If you think its a privacy issue posting stuff in public..please do let me know. I'll share my discord or mail.
yes, an ad did play while the log was running.
however while attempting to get the screenshot, i realised something really interesting (well, to me) today. i speak two languages so i will use my phone in either one or the other. now that isn't the interesting bit... what is, is today my phone's language was set to UK English and the ads were blocked/muted. previously, when ads weren't blocked/ad-silence notification didn't change, the language was set to Latin American Spanish.
Rather than just hardcode each language (I did note that both used the word "advertisement" even title was different you might opt to put all the trigger words into a list and have the app check if the title is in the list. This would allow users to do pr's to simply update that file with additional keywords for languages not currently supported. Just a thought. The user could also add specific keywords to the local file on their phone.
@famewolf that is a good idea.
decompiling spotify
, there are only 63 matches.
We'll add all of them to a file, then based on future changes, this file can be edited.
update
The user could also add specific keywords to the local file on their phone.
for this to work, storage permission is required...🤔. Making a pr seems like a good option, since it would help other users too.