Ad Free is a research project attempting to show flaws in the way how Spotify for Android presents audio advertisement. It is a proof-of-concept of a modularized Ad Blocker written in Kotlin with a modern and simplistic user interface.
- No ROOT required
- Turn off sound when advertisement is playing
- Play arbitrary audio instead of Spotify advertisement
- Plugin based design
Download the latest release from the F-Droid store.
Advertisement detectors are modularized into implementations of AdDetectable. An instance of
AdDetectable can determine if a track being played is a Spotify advertisement or not.
Ad Free registers an NotificationListenerService and is therefore able to parse all incoming notifications on Android. Notifications shown by Spotify are parsed by implementations of
Detector which parses Spotify notifications for certain keywords. In order to avoid false positives, an notification action is provided to unblock wrongly detected advertisements.
Detector which inspects Spotify notifications for properties set in the track navigation bar.
Detector which checks for properties set in the notification bundle.
AudioManager, Android's Audio System provides several streams on which audio can be played. Spotify, alike many music players, plays audio on the stream STREAM_MUSIC. In case of ad detection, Ad Free mutes STREAM MUSIC and calls a configured AdPlugin.
AdPlugins aim to replace Spotify's advertisement. They play music on an alternative stream and are therefore not affected by the mute of STREAM MUSIC.
As the title of this plugin suggests, it only mutes adertisments without playing sound.
Play local music
Play music tracks stored on your phone while advertisement is playing
Due to the lack of notifications on Android TV, Ad Free is currently not compatible with Android TV.
Tested with the following Spotify versions
- 2017-04-19: 22.214.171.1241 armV7
- 2017-09-01: 126.96.36.1990 armV7
- 2017-11-28: 188.8.131.525 armV7
This app is optimized to work on Android 6.0.1 as my phone runs on Android 6.0.1. If you notice problems on a newer version of Android, please fill an issue and we try to tackle down the problem together.
- See Changelog
This app is written in Kotlin. Kotlin by Jetbrains is lisenced by the Apache Lisence 2.0
AppUpdater by javiersantos is licensed by the Apache License 2.0
Videocache is made by danikula and is licensed by the Apache License 2.0
RxAndroid by the RxAndroid authors is licensed by the Apache License 2.0
Fuel is made by Kittinun Vantasin and is licensed by MIT
snakeyaml is licensed by the Apache License 2.0
XStream by Joe Walnes and the XStream Committers is lisenced by BSD license.
This project is lisenced by the Apache Lisence 2.0
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IT IS A PROOF OF CONCEPT AND INTENDED TO BE A RESEARCH PROJECT. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.