ShizuStore

Ambient Music Mod

KieronQuinn

2.4 · GitHub

Download APK
Customization Android 9+ 2 years ago GPL-3.0
323 ShizuStore
315.9k GitHub
2.5k Stars
28 MB Size

More about this app

Port of Now Playing from Pixels to other Android devices

Ambient Music Mod Banner

Ambient Music Mod | Now Playing

Ambient Music Mod is a Shizuku/Sui app that ports Now Playing from Pixels to other Android devices.

Requirements

  • Android device running Android 9.0 or above (11+ recommended).
  • Shizuku (Android 12+) or Sui Magisk module (Android 9+).
    • Shizuku does not require root, instead needing an ADB command to be run every reboot.

Features

  • Full Now Playing support, based on the latest version from Pixel devices and the latest music databases
  • Automatic Ambient Music recognition, with settings to control how often recognition runs - finding the right balance between battery usage and convenience
  • Now Playing History, Favourites and Summary support
  • Support to trigger recognitions manually, including a homescreen widget
  • On Demand recognition on supported devices, using the Google Assistant-backed recognition engine for songs that are not in the local database (must be triggered manually)
  • Show Now Playing songs on the lock screen (accessibility service required)
  • View the full track list of recognisable songs, and change the database location if your taste does not match your device's locale

Screenshots

Screenshots

Installation

Download the latest APK from the Releases page and install it. Ambient Music Mod will download and install the latest Now Playing APK for you as part of the setup process.

If you have any questions, please read the FAQ before opening an issue or replying to the XDA thread.

Building

Note: If you are building Ambient Music Mod yourself, you must also build Now Playing, since the signatures have to match for security reasons.

  1. Clone the repository
  2. Create a local.properties file in the root of the project, and set it up:
sdk.dir=<path to your Android SDK>
storeFile=<path to your keystore>
keyAlias=<keystore alias>
storePassword=<keystore password>
keyPassword=<key password>
  1. Open the project in Android Studio
  2. Set the Build Variant to release
  3. Run and install a build of app as normal

Building the Magisk Overlay Module

  1. Open the project in Android Studio
  2. Run the :ondemandoverlay:buildOverlay task. A module zip will be built and placed in ondemandoverlay/build/module.

Sources

This repository contains a local version of google/private-compute-services (Apache 2.0 licence)

Read More

Read more, including about how Now Playing works and how it protects your privacy here

Close

How Shizuku is used

Can recognize ambient songs, show them on the lock screen and refresh data via `pm grant`, `am force-stop` and system audio services

This is an AI-assisted analysis of Shizuku-related usages in the app's public source code. It is best effort, so it may not catch every single usage.

How this app uses Shizuku

Ambient Music Mod uses Shizuku to run a privileged helper that brings Pixel Now Playing style recognition to other devices.

  • Recognize ambient music: automatically listens for nearby music and identifies tracks through the system music recognition service, using a privileged binding and background audio capture.
  • Capture background audio: records short snippets from the low power audio path with a privileged audio recorder so recognition works without the microphone being held open.
  • Show track on lockscreen: writes the current song into the lock screen owner info and always on display text with privileged lock settings and the settings put secure commands.
  • Open history from lockscreen: dismisses the keyguard with the privileged window service when tapping the lock screen overlay to jump to history.
  • Refresh song database: force stops the Now Playing companion with am force-stop after editing or deleting tracks and after setup so new data loads.
  • Speed up background work: runs pending scheduled jobs immediately with the cmd jobscheduler run command, with an option to ignore constraints.
  • Enable app permissions: grants notification permission with pm grant and allows the restricted settings access option with appops set so alerts and accessibility features work without manual steps.
  • Respect microphone privacy: checks the system microphone disabled state and listens for changes through the privileged sensor privacy service to pause recognition and update the UI.

Android APIs or commands used

  • android.media.AudioRecord.
  • android.media.AudioRecord#startRecording
  • android.media.AudioRecord#read
  • android.media.AudioRecord#release
  • android.media.AudioAttributes.Builder#setInternalCapturePreset
  • android.app.IActivityManager#bindServiceInstance
  • android.media.musicrecognition.MusicRecognitionManager#beginStreamingSearch
  • android.media.musicrecognition.IMusicRecognitionService#getAttributionTag
  • android.media.musicrecognition.IMusicRecognitionService#onAudioStreamStarted
  • android.app.AppOpsManager#startProxyOp
  • android.app.AppOpsManager#finishProxyOp
  • android.hardware.SensorPrivacyManager#addSensorPrivacyListener
  • android.hardware.SensorPrivacyManager#removeSensorPrivacyListener
  • android.hardware.SensorPrivacyManager#isSensorPrivacyEnabled
  • android.view.IWindowManager#dismissKeyguard
  • com.android.internal.widget.ILockSettings#setBoolean
  • com.android.internal.widget.ILockSettings#setString
  • settings put secure lock_screen_owner_info_enabled
  • settings put secure lock_screen_owner_info
  • settings put secure aod_display_text
  • am force-stop
  • pm grant
  • appops set ACCESS_RESTRICTED_SETTINGS allow
  • cmd jobscheduler run
  • cmd appops set ACCESS_RESTRICTED_SETTINGS allow

Notable details

Writing the track to lock screen owner info only runs when the helper has root, shell alone skips it. Notification and restricted settings grants are applied automatically on Android 13 and above when the privileged service starts.

Close

Changelog

What's new for version 2.4

  • Added new "minimal" widget in the style of the lock screen overlay (requires Android 12 or above). This is ideal for use on devices which support lock screen widgets, instead of using the overlay. This can be configured in the same lock screen settings as the current options.
  • Added option to disable the shadow for the overlay & new widget
  • Enabled in-app predictive back where possible
  • Fixed an issue where the screen on recognition trigger could be invoked while the main toggle was disabled
  • Fixed a suppressed crash when using On Demand recognition on some devices, which was causing the recognition to appear to get stuck
  • Various bug fixes
Close

Permissions

14 permissions requested

  • android.permission.INTERNET
  • android.permission.ACCESS_NETWORK_STATE
  • android.permission.FOREGROUND_SERVICE
  • android.permission.FOREGROUND_SERVICE_SPECIAL_USE
  • android.permission.REQUEST_INSTALL_PACKAGES
  • android.permission.RECEIVE_BOOT_COMPLETED
  • android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
  • android.permission.SCHEDULE_EXACT_ALARM
  • android.permission.POST_NOTIFICATIONS
  • com.kieronquinn.app.ambientmusicmod.ACCESS_SERVICE
  • com.kieronquinn.app.pixelambientmusic.ACCESS_SERVICE
  • android.permission.WAKE_LOCK
  • com.kieronquinn.app.ambientmusicmod.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION
  • moe.shizuku.manager.permission.API_V23
Close