Giter Site home page Giter Site logo

qqmusic-snap's Introduction

Unofficial Snap package of QQ Music for Linux

QQ Music
QQ Music

This is the snap for QQ Music, β€œQQ Music provides massive high-quality music for you.”. It works on Ubuntu, Fedora, Debian, and other major Linux distributions.

qqmusic main screen qqmusic song lyrics qqmusic login

Published for with πŸ’ by Snapcrafters

Install

sudo snap install qqmusic-snap

Get it from the Snap Store

(Don't have snapd installed?)

Remaining tasks

Snapcrafters (join us) are working to land snap install documentation and the snapcraft.yaml upstream so QQ Music can authoritatively publish future releases.

  • Click the green "Use this template" button above to create a new repository based on this template
  • Give the newly created repository a sensible name, like godzilla-snap if you're snapping the Godzilla software
  • Update the description of the repository
  • Update logos and references to [QQ Music] and [qqmusic]
  • Create a snap that runs in devmode
  • Register the snap in the store, using the preferred upstream name
  • Add a screenshot to this README.md
  • Publish the devmode snap in the Snap store edge channel
  • Add install instructions to this README.md
  • Update snap store metadata, icons and screenshots
  • Convert the snap to strict confinement, or classic confinement if it qualifies
  • Publish the confined snap in the Snap store beta channel
  • Update the install instructions in this README.md
  • Post a call for testing on the Snapcraft Forum - link
  • Make a post in the Snapcraft Forum asking for a transfer of the snap name from you to snapcrafters - link
  • Ask a Snapcrafters admin to fork your repo into github.com/snapcrafters, and configure the repo for automatic publishing into edge on commit
  • Add the provided Snapcraft build badge to this README.md
  • Publish the snap in the Snap store stable channel
  • Update the install instructions in this README.md
  • Post an announcement in the Snapcraft Forum - link
  • Submit a pull request or patch upstream that adds snap install documentation - link
  • Submit a pull request or patch upstream that adds the snapcraft.yaml and any required assets/launchers - link
  • Add upstream contact information to the README.md
  • If upstream accept the PR:
    • Request upstream create a Snap store account
    • Contact the Snap Advocacy team to request the snap be transferred to upstream
  • Ask the Snap Advocacy team to celebrate the snap - link

If you have any questions, post in the Snapcraft forum.

Development

Build the package

snapcraft snap

The result *.snap will be put in the current directory.

➜ ls -hl *.snap
-rw-r--r-- 1 tao tao 106M Sep 16 19:51 qqmusic-snap_1.1.1_amd64.snap

Retrieve app icon

Update the link variable DEB_LINK in the Makefile if it's necessary, then run:

make icon

The icon will be snap/gui/qqmusic.png.

Install the package from local

sudo snap install --dangerous ./qqmusic-snap_1.1.1_amd64.snap

Known Issues

Tray icon not working properly

As unity7 is missing the path com/canonical/dbusmenu in the profile, so the tray icon is not working at the moment. To fix the problem, the profile can be modified manually.

The profile will be overwritten by reinstall/update the snap, so if the tray icon is not working anymore, you can check whether is the profile problem, and repeat the above again if it's necessary. Those operation should not be necessary after the snap team fix the problem.

Fix by provided fix-tray.sh script

This snap provided a script to help the AppArmor profile modification.

$ sudo /snap/qqmusic-snap/current/fix-tray.sh
Fix AppArmor profile of qqmusic-snap...
patching file /var/lib/snapd/apparmor/profiles/snap.qqmusic-snap.qqmusic-snap
--- /var/lib/snapd/apparmor/profiles/snap.qqmusic-snap.qqmusic-snap.bak	2021-09-24 21:40:15.083746116 +1000
+++ /var/lib/snapd/apparmor/profiles/snap.qqmusic-snap.qqmusic-snap	2021-09-24 21:40:15.083746116 +1000
@@ -973,21 +973,21 @@
 # dbusmenu
 dbus (send)
     bus=session
-    path=/{MenuBar{,/[0-9A-F]*},com/canonical/menu/[0-9A-F]*}
+    path=/{MenuBar{,/[0-9A-F]*},com/canonical/menu/[0-9A-F]*,com/canonical/dbusmenu}
     interface=com.canonical.dbusmenu
     member="{LayoutUpdated,ItemsPropertiesUpdated}"
     peer=(name=org.freedesktop.DBus, label=unconfined),
 
 dbus (receive)
     bus=session
-    path=/{MenuBar{,/[0-9A-F]*},com/canonical/menu/[0-9A-F]*}
+    path=/{MenuBar{,/[0-9A-F]*},com/canonical/menu/[0-9A-F]*,com/canonical/dbusmenu}
     interface="{com.canonical.dbusmenu,org.freedesktop.DBus.Properties}"
     member=Get*
     peer=(label=unconfined),
 
 dbus (receive)
     bus=session
-    path=/{MenuBar{,/[0-9A-F]*},com/canonical/menu/[0-9A-F]*}
+    path=/{MenuBar{,/[0-9A-F]*},com/canonical/menu/[0-9A-F]*,com/canonical/dbusmenu}
     interface=com.canonical.dbusmenu
     member="{AboutTo*,Event*}"
     peer=(label=unconfined),
Reloading the AppArmor profile for qqmusic-snap...
Done.

Rerun the qqmusic-snap, the systray icon should work correctly.

Fix by hand

sudo vi  /var/lib/snapd/apparmor/profiles/snap.qqmusic-snap.qqmusic-snap

use /dbusmenu find the # dbusmenu section, and add the path to the first 3 parts. Don't forget backup the old profile.

--- snap.qqmusic.qqmusic.bak	2021-09-19 12:47:04.518276613 +1000
+++ snap.qqmusic.qqmusic	2021-09-19 12:44:02.897018611 +1000
@@ -973,21 +973,21 @@
 # dbusmenu
 dbus (send)
     bus=session
-    path=/{MenuBar{,/[0-9A-F]*},com/canonical/menu/[0-9A-F]*}
+    path=/{MenuBar{,/[0-9A-F]*},com/canonical/menu/[0-9A-F]*,com/canonical/dbusmenu}
     interface=com.canonical.dbusmenu
     member="{LayoutUpdated,ItemsPropertiesUpdated}"
     peer=(name=org.freedesktop.DBus, label=unconfined),
 
 dbus (receive)
     bus=session
-    path=/{MenuBar{,/[0-9A-F]*},com/canonical/menu/[0-9A-F]*}
+    path=/{MenuBar{,/[0-9A-F]*},com/canonical/menu/[0-9A-F]*,com/canonical/dbusmenu}
     interface="{com.canonical.dbusmenu,org.freedesktop.DBus.Properties}"
     member=Get*
     peer=(label=unconfined),
 
 dbus (receive)
     bus=session
-    path=/{MenuBar{,/[0-9A-F]*},com/canonical/menu/[0-9A-F]*}
+    path=/{MenuBar{,/[0-9A-F]*},com/canonical/menu/[0-9A-F]*,com/canonical/dbusmenu}
     interface=com.canonical.dbusmenu
     member="{AboutTo*,Event*}"
     peer=(label=unconfined),

Then reload the profile:

sudo apparmor_parser -r /var/lib/snapd/apparmor/profiles/snap.qqmusic-snap.qqmusic-snap

Rerun the qqmusic-snap, the systray icon should work correctly.

Uninstall the snap package

sudo snap remove qqmusic-snap

Reinstall and update the snap will keep the user's data, however, remove the snap app will remove the user's data, such as login information.

Reference

qqmusic-snap's People

Contributors

twang2218 avatar

Stargazers

Matias Lavik (马蹄) avatar Stan avatar  avatar Yu Jerry avatar Monst.x avatar Ennis Nian avatar

Watchers

James Cloos avatar  avatar Ding avatar

qqmusic-snap's Issues

No response of click on systray icon.

If the snap is installed in the devmode, everything works correctly, however, if it's installed in strict/dangerouse, the systray icon is not working correctly.

Installed in devmode

sudo snap install --devmode ./qqmusic_1.1.1_amd64.snap

Verify the mode:

➜ snap info --verbose qqmusic                                                       
name:    qqmusic
summary: QQ Music for Linux
health:
  status:  unknown
  message: health has not been set
publisher: –
license:   unset
description: |
  QQ Music provides massive high-quality music for you.
commands:
  - qqmusic
notes:               
  private:           false
  confinement:       strict
  devmode:           true
  jailmode:          false
  trymode:           false
  enabled:           true
  broken:            false
  ignore-validation: false
base:         core18
refresh-date: yesterday at 20:10 AEST
installed:    1.1.1 (x1) 110MB devmode

Launch the qqmusic via cli

➜ qqmusic                                 
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Gtk-Message: 14:24:41.446: Failed to load module "canberra-gtk-module"
Gtk-Message: 14:24:41.465: Failed to load module "canberra-gtk-module"
(electron) The default value of app.allowRendererProcessReuse is deprecated, it is currently "false".  It will change to be "true" in Electron 9.  For more information please check https://github.com/electron/electron/issues/18397
(node:497255) UnhandledPromiseRejectionWarning: undefined
(node:497255) UnhandledPromiseRejectionWarning: undefined
(node:497255) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:497255) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:497255) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:497255) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
login refresh fail
(node:497255) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
(node:497255) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
(electron) 'setUserAgent function' is deprecated and will be removed. Please use 'userAgent property' instead.

At the same time, the /var/log/kern.log content is following:

Sep 17 14:24:42 purrbuntu kernel: [353140.318443] audit: type=1107 audit(1631852682.480:1015366): pid=1682 uid=103 auid=4294967295 ses=4294967295 msg='apparmor="ALLOWED" operation="dbus_method_call"  bus="system" path="/" interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" mask="send" name="org.bluez" pid=497255 label="snap.qqmusic.qqmusic" peer_pid=1677 peer_label="unconfined"
Sep 17 14:24:42 purrbuntu kernel: [353140.318443]  exe="/usr/bin/dbus-daemon" sauid=103 hostname=? addr=? terminal=?'
Sep 17 14:24:43 purrbuntu kernel: [353141.066130] audit: type=1326 audit(1631852683.228:1015367): auid=1000 uid=1000 gid=1000 ses=3 pid=497255 comm="qqmusic" exe="/snap/qqmusic/x1/opt/qqmusic/qqmusic" sig=0 arch=c000003e syscall=92 compat=0 ip=0x7efc3aaa04b7 code=0x7ffc0000
Sep 17 14:24:43 purrbuntu kernel: [353141.126718] audit: type=1107 audit(1631852683.288:1015368): pid=1682 uid=103 auid=4294967295 ses=4294967295 msg='apparmor="ALLOWED" operation="dbus_method_call"  bus="system" path="/" interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" mask="send" name="org.bluez" pid=497255 label="snap.qqmusic.qqmusic" peer_pid=1677 peer_label="unconfined"
Sep 17 14:24:43 purrbuntu kernel: [353141.126718]  exe="/usr/bin/dbus-daemon" sauid=103 hostname=? addr=? terminal=?'
Sep 17 14:24:45 purrbuntu kernel: [353143.008397] audit: type=1326 audit(1631852685.168:1015369): auid=1000 uid=1000 gid=1000 ses=3 pid=497400 comm="qqmusic" exe="/snap/qqmusic/x1/opt/qqmusic/qqmusic" sig=0 arch=c000003e syscall=92 compat=0 ip=0x7f7dfff764b7 code=0x7ffc0000

And the systray icon works correctly.

2021-09-17 14-25-11 ηš„ε±εΉ•ζˆͺε›Ύ

Installed in strict/dangerous mode

sudo snap install --dangerous ./qqmusic_1.1.1_amd64.snap

The mode can be verified by CLI:

➜ snap info --verbose qqmusic                                                         
name:    qqmusic
summary: QQ Music for Linux
health:
  status:  unknown
  message: health has not been set
publisher: –
license:   unset
description: |
  QQ Music provides massive high-quality music for you.
commands:
  - qqmusic
notes:               
  private:           false
  confinement:       strict
  devmode:           false
  jailmode:          false
  trymode:           false
  enabled:           true
  broken:            false
  ignore-validation: false
base:         core18
refresh-date: today at 14:29 AEST
installed:    1.1.1 (x1) 110MB -

Launch the qqmusic from command line:

➜ qqmusic
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Gtk-Message: 14:32:50.482: Failed to load module "canberra-gtk-module"
Gtk-Message: 14:32:50.485: Failed to load module "canberra-gtk-module"
(electron) The default value of app.allowRendererProcessReuse is deprecated, it is currently "false".  It will change to be "true" in Electron 9.  For more information please check https://github.com/electron/electron/issues/18397
(node:501785) UnhandledPromiseRejectionWarning: undefined
(node:501785) UnhandledPromiseRejectionWarning: undefined
(node:501785) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:501785) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:501785) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:501785) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
login refresh fail
(node:501785) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
(node:501785) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
stderr: dbus-monitor: unable to enable new-style monitoring: org.freedesktop.DBus.Error.AccessDenied: "An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.18543" (uid=1000 pid=501935 comm="dbus-monitor --session type='signal',interface='or" label="snap.qqmusic.qqmusic (enforce)") interface="org.freedesktop.DBus.Monitoring" member="BecomeMonitor" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)". Falling back to eavesdropping.

(electron) 'setUserAgent function' is deprecated and will be removed. Please use 'userAgent property' instead.

The /var/log/kern.log output for the launch is:

Sep 17 14:32:50 purrbuntu kernel: [353628.627303] audit: type=1107 audit(1631853170.758:1015479): pid=1682 uid=103 auid=4294967295 ses=4294967295 msg='apparmor="DENIED" operation="dbus_method_call"  bus="system" path="/" interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" mask="send" name="org.bluez" pid=501785 label="snap.qqmusic.qqmusic" peer_pid=1677 peer_label="unconfined"
Sep 17 14:32:50 purrbuntu kernel: [353628.627303]  exe="/usr/bin/dbus-daemon" sauid=103 hostname=? addr=? terminal=?'
Sep 17 14:32:50 purrbuntu kernel: [353628.748537] audit: type=1326 audit(1631853170.882:1015480): auid=1000 uid=1000 gid=1000 ses=3 pid=501785 comm="qqmusic" exe="/snap/qqmusic/x1/opt/qqmusic/qqmusic" sig=0 arch=c000003e syscall=92 compat=0 ip=0x7f6d221ff4b7 code=0x50000
Sep 17 14:32:51 purrbuntu kernel: [353629.560219] audit: type=1326 audit(1631853171.694:1015481): auid=1000 uid=1000 gid=1000 ses=3 pid=501921 comm="qqmusic" exe="/snap/qqmusic/x1/opt/qqmusic/qqmusic" sig=0 arch=c000003e syscall=92 compat=0 ip=0x7f4e52b624b7 code=0x50000

And nothing happened if click on the qqmusic systray icon.

Problem

The bluez error should not be the problem, I can overcome it by connecting it to bluez interface, and the result is the same.

The following error caught my eyes, and I'm not sure whether it's the cause of the problem:

stderr: dbus-monitor: unable to enable new-style monitoring: org.freedesktop.DBus.Error.AccessDenied: "An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.18543" (uid=1000 pid=501935 comm="dbus-monitor --session type='signal',interface='or" label="snap.qqmusic.qqmusic (enforce)") interface="org.freedesktop.DBus.Monitoring" member="BecomeMonitor" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)". Falling back to eavesdropping.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.