UnblockMusicPro_Xposed

repository·master·Indexed 23 days ago

https://github.com/nining377/unblockmusicpro_xposed

An Xposed module for Android and a corresponding service (@nondanee/unblockneteasemusic v0.25.3) designed to unlock grayed-out (restricted) songs within the NetEase Cloud Music client. The project includes a web extension port, Docker Compose deployment options, and a provider system that matches music IDs to playable URLs across services such as QQ, Kuwo, Migu, Baidu, Kugou, Xiami, Joox, and YouTube.

Tokens
2.7K
Snippets
2
Records
19
Agent score
80%

What's inside UnblockMusicPro_Xposed

  1. Install UnblockMusicPro_Xposed for Android

    master

    UnblockMusicPro_Xposed is an Android-based Xposed module designed to unlock grayed-out songs in the NetEase Cloud Music client.

    To install the module, download the package from the Lanzou cloud link provided below. You will need the access password to download the file.

    Download Link: Lanzou Cloud Access Password: 23fj

  2. Configure requests with proxy and host translation

    master

    The request utility supports custom proxy configurations and host translation via global objects.

    Proxy Configuration

    Pass a proxy object to the request function. If the target URL uses https:, the utility uses the CONNECT method to tunnel the request.

    Host Translation

    The utility uses a translate function which looks up hostnames in a global global.hosts object. This allows mapping specific hostnames to different addresses.

    Global Configuration

    • global.proxy: Can be set to define a default proxy for all requests if one isn't provided to the request call.
    • global.hosts: An object used for hostname translation (e.g., { 'api.example.com': '127.0.0.1' }).
  3. Configure option actions and nargs

    master

    The cli utility supports specific action types and nargs behaviors to handle different command-line patterns:

    Actions

    • store_true / store_false: Used for boolean flags. If store_true is used, the property is set to true if the flag is present.
    • help: Automatically prints the usage guide and exits.
    • version: Automatically prints the program version and exits.

    Argument Consumption (nargs)

    • +: Expects at least one argument. In help text, this is represented as [name ...].
    • Standard behavior: Consumes a single value unless specified otherwise.
  4. Deploy unblockneteasemusic using Docker Compose

    master

    You can deploy the unblockneteasemusic service using Docker Compose. The configuration uses the nondanee/unblockneteasemusic image and maps port 8080 on the host to port 8080 in the container. The service runs in production mode by default via the NODE_ENV environment variable.

    version: '3'
    
    services:
      unblockneteasemusic:
        image: nondanee/unblockneteasemusic
        environment:
          NODE_ENV: production
        ports:
          - 8080:8080
  5. Configure UnblockMusicPro_Xposed settings

    master

    The module's behavior is controlled via XSharedPreferences (using the name share). These settings are typically modified through the Xposed module configuration UI in the Android system settings. The following keys are used to manage the module's state and logic:

    • enable (boolean): Determines if the module is active. Defaults to true.
    • log (boolean): Enables or disables logging. Defaults to false.
    • originString (string): Sets the music source provider name (e.g., 酷我). Defaults to 酷我.
    • nodejs (string): Configures the Node.js related path or identifier. Defaults to a value derived from Tools.Start + Tools.origin[0].
  6. Use the Kugou music provider

    master
    The Kugou provider implements the music search and track retrieval logic for the Kugou music service. It exposes two primary methods: search for finding song IDs based on keywords and check for resolving a song's metadata and playable URL. The check method is the preferred entry point for retrieving playable content as it combines searching and track fetching with caching.
  7. Match music IDs to playable URLs with match()

    master

    The match function is the primary entrypoint for resolving a music ID into a playable song object. It searches for the music metadata and then attempts to find valid streaming URLs across multiple music providers.

    Parameters

    • id: The unique identifier for the music track.
    • source (optional): An array of provider names to prioritize (e.g., ['qq', 'kuwo']). If not provided, it defaults to ['qq', 'kuwo', 'migu'] or uses global.source if available.

    Supported Providers

    The following providers are supported for matching:

    • netease
    • qq
    • xiami
    • baidu
    • kugou
    • kuwo
    • migu
    • joox
    • youtube

    Return Value

    Returns a Promise that resolves to a song object containing:

    • url: The playable streaming URL.
    • size: The file size in bytes.
    • br: The bitrate (in bps).
    • md5: The MD5 hash of the track (if available from the provider).

    If no playable URL is found, the promise rejects.

  8. Define and parse CLI commands with the cli object

    master

    The cli object provides a lightweight interface for building command-line interfaces in JavaScript. It allows you to define a program name, register options (both positional and optional), and parse process.argv into a usable object.

    Workflow

    1. Initialize the program: Use .program({ name: 'my-app', version: '1.0.0' }) to set the metadata.
    2. Define options: Use .option(flags, addition) to register flags or positional arguments.
    3. Parse arguments: Call .parse(argv) to process the command-line arguments. The resulting object will have properties corresponding to the dest of each option.

    Option Configuration

    When calling .option(flags, addition), the addition object supports several keys:

    • dest: The attribute name on the returned object. If omitted, it is automatically derived from the flags (e.g., --foo-bar becomes fooBar).
    • action: Defines how the argument is handled:
      • store: Default behavior.
      • store_true: Sets the value to true if the flag is present.
      • store_false: Sets the value to false if the flag is present.
      • help: Triggers the help menu.
      • version: Triggers the version output.
    • nargs: Controls how many arguments are consumed (N, ?, *, +, REMAINDER).
    • metavar: A name used for the argument in usage/help messages.
    • help: A description of the argument.
    • required: Boolean indicating if the option must be present.
    • default: The value used if the argument is absent.
    • type: The type to convert the argument to.
    • choices: A list of allowed values.