Giter Site home page Giter Site logo

export_music's Introduction

项目介绍

此项目旨在从你的手机里导出音乐。

使用环境

  1. 你的手机必须已经root

  2. 手机和电脑必须在同一个局域网

使用指南

  1. 确保您的设备满足所需的环境。

  2. 在手机上使用 Root 权限开启一个可访问整个手机目录的http服务:

    1. 前往 F-Droid 下载并安装 Termux

    2. 使用下列两个命令,更新 Termux 的软件源和软件

        pkg update
        pkg upgrade
    1. 安装 Python
    pkg install python
    1. 获取Root权限
    su
    1. 设置环境变量或进入指定目录(二选一)

      1. 设置环境变量(推荐)
        执行如下指令:
        export PATH=/data/data/com.termux/files/usr/bin:$PATH
      2. 进入指定路径(不推荐)
        路径为 /data/data/com.termux/files/usr/bin 。不推荐方法不给出相应指令,请自行解决。
    2. 查看局域网地址

      1. 在 Termux 内查看
        执行 ifconfig 。可能会有多个地址,请一一尝试。
      2. 在 系统设置 查看
        如果使用的是 Wi-Fi ,则可查看 Wi-Fi 的详细信息以找到手机的局域网地址。
    3. 启动 http 服务

      1. 若你设置了环境变量,则直接执行如下命令
            python -m http.server -d /
      2. 若你进入指定文件夹:该方法不推荐,请自行修改命令。
  3. 克隆或下载此项目的源代码。

  4. 安装 Python 3

  5. 安装项目依赖

        pip install -r requirements.txt
  6. 运行

    python main.py

并按提示输入你获取到的手机的IP地址。

更新日志

  • 2022.11.15 1.初版上线

export_music's People

Contributors

592767809 avatar acrobat-pro avatar jixunmoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

export_music's Issues

不依赖模拟器获取汽水音乐解密密钥

#include <iostream>
#include <cstdint>
#include <string>
#include <vector>
#include <algorithm>
#include <bitset>

// https://github.com/zaphoyd/websocketpp/blob/master/websocketpp/base64/base64.hpp
#include "base64.hpp"

uint8_t decode_base36(uint8_t c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	if (c >= 'a' && c <= 'z') {
		return c - 'a' + 10;
	}
	return 0xff;
}

template<typename ItBegin, typename ItEnd>
inline void decrypt_spade_inner(ItBegin spade_key, ItEnd spade_key_end) {
	std::vector<uint8_t> buff(spade_key_end - spade_key + 2);
	buff[0] = 0xFA;
	buff[1] = 0x55;
	std::copy(spade_key, spade_key_end, buff.begin() + 2);

	const uint8_t* p_table = buff.data();
	for (uint32_t i = 0; spade_key < spade_key_end; spade_key++) {
		auto pop_count = static_cast<uint8_t>(std::bitset<32>(i).count()); // popcnt 指令
		*spade_key = (*spade_key ^ *p_table) - pop_count - 21;

		p_table++;
		i++;
	}
}

template<typename ItBegin, typename ItEnd>
std::string decrypt_spade(ItBegin spade_key, ItEnd spade_key_end) {
	size_t spade_key_len = spade_key_end - spade_key;
	if (spade_key_len < 3) {
		return {};
	}

	uint8_t padding_len = (spade_key[0] ^ spade_key[1] ^ spade_key[2]) - '0';
	if (spade_key_len < static_cast<size_t>(padding_len) + 2) {
		return {}; // overflow
	}
	size_t decoded_message_len = spade_key_len - padding_len - 2;
	std::vector<uint8_t> tmp_buff(&spade_key[1], &spade_key[spade_key_len - padding_len]);
	decrypt_spade_inner(tmp_buff.begin(), tmp_buff.end());

	auto skip_bytes = decode_base36(tmp_buff[0]);
	return std::string(&tmp_buff[1], &tmp_buff[1 + decoded_message_len - skip_bytes]);
}

std::string decrypt_spade_a(std::string const& spade_a) {
	auto spade = websocketpp::base64_decode(spade_a); // base64 解码
	return decrypt_spade(spade.cbegin(), spade.cend());
}

int main()
{
	// uint8_t szInput[] = { 0x90, 0xbc, 0x1e, 0xfa, 0x56, 0xbd, 0x06, 0xf6, 0x4b, 0xbf, 0x0c, 0xef, 0x71, 0xa2, 0x3d, 0xec, 0x73, 0xa7, 0x3c, 0xef, 0x42, 0x94, 0x0a, 0xe8, 0x45, 0xb8, 0x0a, 0xf1, 0x76, 0xb9, 0x08, 0xf0, 0x42, 0xb8, 0x0a, 0x83, 0x83 };
	// std::string key = decrypt_spade(szInput, szInput+sizeof(szInput));
	auto key = decrypt_spade_a("kLwe+la9BvZLvwzvcaI97HOnPO9ClAroRbgK8Xa5CPBCuAqDgw==");

	auto key_ok = key == "5011945309e6465581fd0d6971c0e002";
	std::cout << key << " -- " << (key_ok ? "OK" : "BAD") << std::endl;
}

在手机上运行这个脚本报错

Traceback (most recent call last):
File "/data/data/com.termux/files/home/export_music/main.py", line 2, in
from server import *
File "/data/data/com.termux/files/home/export_music/server/init.py", line 2, in
from server import qqmusic, kugoumusic, kugoulitemusic, wangyiyunmusic, qishuimusic, xuelang, wufanyouxiting
File "/data/data/com.termux/files/home/export_music/server/qqmusic.py", line 8, in
from utils.tc_tea import tc_tea_decrypt
ModuleNotFoundError: No module named 'utils.tc_tea'

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.