unibdg-fetch-9.0.56.zip
Some checks failed
Build And Push Docker Image / build (push) Has been cancelled
Some checks failed
Build And Push Docker Image / build (push) Has been cancelled
This commit is contained in:
commit
60d3132381
1
.github/ISSUE_TEMPLATE.md
vendored
Normal file
1
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@ -0,0 +1 @@
|
||||
## 问题咨询、讨论,请在 [Discussions](../discussions) 发帖。issues 仅用于提交 Bug。
|
79
.github/workflows/build_docker_image.yml
vendored
Normal file
79
.github/workflows/build_docker_image.yml
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
name: Build And Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
# Sequence of patterns matched against refs/tags
|
||||
tags:
|
||||
- v[0-9]+.*
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set time zone
|
||||
uses: szenius/set-timezone@v1.1
|
||||
with:
|
||||
timezoneLinux: "Asia/Shanghai"
|
||||
timezoneMacos: "Asia/Shanghai"
|
||||
timezoneWindows: "China Standard Time"
|
||||
|
||||
# # 如果有 dockerhub 账户,可以在github的secrets中配置下面两个,然后取消下面注释的这几行,并在meta步骤的images增加一行 ${{ github.repository }}
|
||||
# - name: Login to DockerHub
|
||||
# uses: docker/login-action@v1
|
||||
# with:
|
||||
# username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
ghcr.io/${{ github.repository }}
|
||||
# generate Docker tags based on the following events/attributes
|
||||
# nightly, master, pr-2, 1.2.3, 1.2, 1
|
||||
tags: |
|
||||
type=schedule,pattern=nightly
|
||||
type=edge
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
platforms: linux/amd64,linux/arm64
|
43
.github/workflows/gradle.yml
vendored
Normal file
43
.github/workflows/gradle.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
name: Java CI with Gradle
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- '.github/**'
|
||||
- '.run/**'
|
||||
- '**.md'
|
||||
- '!.github/workflows/gradle.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- '.github/**'
|
||||
- '.run/**'
|
||||
- '**.md'
|
||||
- '!.github/workflows/gradle.yml'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: 11
|
||||
java-package: jdk
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Build and Package
|
||||
run: |
|
||||
./gradlew distZip
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: unidbg-fetch-qsign
|
||||
path: ${{ github.workspace }}/build/distributions/unidbg-fetch-qsign-*.zip
|
43
.github/workflows/release.yml
vendored
Normal file
43
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v[0-9]+.*
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RELEASE_VERSION: ${{ github.ref }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'temurin'
|
||||
- name: Build distribution zip
|
||||
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
|
||||
with:
|
||||
arguments: distZip
|
||||
- name: Create Release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
- name: Upload Release Assets
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
||||
asset_path: build/distributions/unidbg-fetch-qsign-${{ github.ref }}.zip
|
||||
asset_name: unidbg-fetch-qsign-${{ github.ref }}.zip
|
||||
asset_content_type: application/zip
|
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# 项目排除路径
|
||||
/.gradle/
|
||||
/build/
|
||||
/build/classes/kotlin/main/
|
||||
/.idea
|
27
Dockerfile
Normal file
27
Dockerfile
Normal file
@ -0,0 +1,27 @@
|
||||
# 第一阶段:使用Gradle镜像构建Jar文件
|
||||
FROM gradle:7.4.2-jdk11 AS builder
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 复制项目文件到容器的工作目录中
|
||||
COPY . /app
|
||||
|
||||
# 构建项目
|
||||
RUN gradle build
|
||||
|
||||
# 第二阶段:使用JRE镜像运行应用程序
|
||||
FROM openjdk:11-jre-slim
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 从第一阶段复制构建好的Jar文件到当前镜像
|
||||
COPY --from=builder /app/build/libs/unidbg-fetch-qsign-*-all.jar ./unidbg-fetch-qsign-all.jar
|
||||
COPY --from=builder /app/txlib ./txlib
|
||||
|
||||
# 暴露项目运行的端口号
|
||||
EXPOSE 8080
|
||||
|
||||
# 启动项目
|
||||
CMD ["java", "-jar", "unidbg-fetch-qsign-all.jar", "--basePath=./txlib/8.9.71"]
|
674
LICENSE
Normal file
674
LICENSE
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
3
META-INF/MANIFEST.MF
Normal file
3
META-INF/MANIFEST.MF
Normal file
@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: MainKt
|
||||
|
84
README.md
Normal file
84
README.md
Normal file
@ -0,0 +1,84 @@
|
||||
# --- Astral-QSignigngnn ---
|
||||
|
||||
## Fork版本 Started at 9.0.56
|
||||
|
||||
获取QQSign参数通过Unidbg,开放HTTP API。unidbg-fetch-sign最低从QQ8.9.33(不囊括)开始支持,TIM不支持。
|
||||
|
||||
从qsign删库跑路开始(9.0)不支持,俺懒得适配旧版本。
|
||||
|
||||
**从9.0.56开始支持。**
|
||||
|
||||
## 切记
|
||||
|
||||
- 公共API具有高风险可能
|
||||
- 请使用与协议对应版本的libfekit.so文件
|
||||
- QSign基于Android平台,其它平台Sign计算的参数不同,不互通(例如:IPad)。
|
||||
- 不支持载入Tim.apk的so文件。
|
||||
- 为了保证作者的人身**氨醛**,作者绕过了一些致命性检测,但是`故意保留`了一部分,使用本签名将会被腾讯精准检测,具体表现是:4小时内出现冻结,每15天扫脸解封一次,请确认你的账号具有扫脸解封条件,否则请不要使用。
|
||||
|
||||
## 使用限制
|
||||
本签名程序禁止由木落开发的SealDice(简称海豹骰)及其开发分支,通过gocq或包括但不限于在其他协议端进行直接调用或间接调用,整合和使用。
|
||||
当您使用本程序默认你同意了上述限制。
|
||||
|
||||
## 部署方法
|
||||
(编写中!)
|
||||
|
||||
## 你可能需要的项目
|
||||
|
||||
- [fix-protocol-version](https://github.com/cssxsh/fix-protocol-version):基于**mirai**的qsign api对接。
|
||||
|
||||
## 使用API
|
||||
|
||||
### [初始化QSign&刷新token](https://github.com/fuqiuluo/unidbg-fetch-qsign/blob/master/refresh_token/README.md)
|
||||
|
||||
#### 原始energy
|
||||
|
||||
```kotlin
|
||||
# http://host:port/custom_energy?uin=[QQ]&salt=[SALT HEX]&data=[DATA]
|
||||
```
|
||||
| 参数名 | 意义 | 例子 |
|
||||
|-----|---------|--------|
|
||||
| UIN | Bot的QQ号 | 114514 |
|
||||
|
||||
> 非专业人员勿用。
|
||||
|
||||
#### sign
|
||||
|
||||
```kotlin
|
||||
# http://host:port/sign?uin=[UIN]&qua=[QUA]&cmd=[CMD]&seq=[SEQ]&buffer=[BUFFER]
|
||||
```
|
||||
| 参数名 | 意义 | 例子 |
|
||||
|--------|---------------------------------------------------|-----------------------------|
|
||||
| UIN | Bot的QQ号 | 114514 |
|
||||
| QUA | QQ User-Agent,与QQ版本有关 | V1_AND_SQ_8.9.68_4264_YYB_D |
|
||||
| CMD | 指令类型,CMD有很多种,目前登录、发信息均需要sign | wtlogin.login |
|
||||
| SEQ | 数据包序列号,用于指示请求的序列或顺序。它是一个用于跟踪请求的顺序的数值,确保请求按正确的顺序处理 | 2333 |
|
||||
| BUFFER | 数据包包体,不需要长度,将byte数组转换为HEX发送 | 020348010203040506 |
|
||||
|
||||
<details>
|
||||
<summary>POST的支持</summary>
|
||||
|
||||
如果buffer过长,会超出get请求方式的长度上限,因此sign的请求也支持POST的方式。
|
||||
|
||||
请求头 `Content-Type: application/x-www-form-urlencoded`
|
||||
|
||||
POST的内容:"uin=" + uin + "&qua=" + qua + "&cmd=" + cmd + "&seq=" + seq + "&buffer=" + buffer
|
||||
</details>
|
||||
|
||||
#### 登录包energy(tlv544)
|
||||
|
||||
下面这个只是个例子
|
||||
|
||||
```kotlin
|
||||
# http://host:port/energy?version=[VERSION]&uin=[UIN]&guid=[GUID]&data=[DATA]
|
||||
```
|
||||
|
||||
| 参数名 | 意义 | 例子 |
|
||||
|---------|--------------------------------------------------------------|----------------------------------|
|
||||
| VERSION | **注意!**这里的VERSION指的**不是QQ的版本号,而是SDK Version**,可以在QQ安装包中找到此信息 | 6.0.0.2549 |
|
||||
| UIN | Bot的QQ号 | 114514 |
|
||||
| GUID | 登录设备的GUID,将byte数组转换为HEX发送,必须是32长度的HEX字符串 | ABCDABCDABCDABCDABCDABCDABCDABCD |
|
||||
| DATA | QQ发送登录包的CmdId和SubCmdId,例子中810是登陆CmdId,9是SubCmdId | 810_9 |
|
||||
|
||||
## 其他
|
||||
- 由于项目的特殊性,我们可能~~随时删除本项目~~且不会做出任何声明
|
80
build.gradle.kts
Normal file
80
build.gradle.kts
Normal file
@ -0,0 +1,80 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
val ktor_version: String by project
|
||||
val logback_version: String by project
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "1.8.0"
|
||||
application
|
||||
id("org.jetbrains.kotlin.plugin.serialization") version "1.8.22"
|
||||
id("com.github.johnrengelman.shadow") version "7.1.2"
|
||||
}
|
||||
|
||||
group = "moe.fuqiuluo"
|
||||
version = "1.1.9"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://kotlin.bintray.com/ktor")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation(kotlin("test"))
|
||||
implementation("io.ktor:ktor-server-content-negotiation-jvm:$ktor_version")
|
||||
implementation("io.ktor:ktor-serialization-kotlinx-json-jvm:$ktor_version")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:1.3.3")
|
||||
implementation("io.ktor:ktor-server-core-jvm:$ktor_version")
|
||||
implementation("io.ktor:ktor-server-netty-jvm:$ktor_version")
|
||||
implementation("io.ktor:ktor-server-status-pages:$ktor_version")
|
||||
implementation("ch.qos.logback:logback-classic:$logback_version")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
|
||||
|
||||
implementation(fileTree(mapOf(
|
||||
"dir" to "libs",
|
||||
"include" to listOf("*.jar")
|
||||
)))
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(8)
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("MainKt")
|
||||
}
|
||||
|
||||
distributions {
|
||||
main {
|
||||
contents {
|
||||
from(".") {
|
||||
include("txlib/**")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tasks {
|
||||
register("generateProjectFile") {
|
||||
val dir = File("src/main/java/project").apply { mkdirs() }
|
||||
dir.resolve("BuildConfig.java").also {
|
||||
if (!it.exists()) it.createNewFile()
|
||||
}.writer().use {
|
||||
it.write("package project;")
|
||||
it.write("public class BuildConfig {")
|
||||
it.write(" public static String version = \"${project.version}\";")
|
||||
it.write("}")
|
||||
}
|
||||
}
|
||||
named("prepareKotlinBuildScriptModel").configure {
|
||||
dependsOn("generateProjectFile")
|
||||
}
|
||||
named("processResources") {
|
||||
dependsOn("generateProjectFile")
|
||||
}
|
||||
}
|
3
gradle.properties
Normal file
3
gradle.properties
Normal file
@ -0,0 +1,3 @@
|
||||
kotlin.code.style=official
|
||||
ktor_version=2.3.1
|
||||
logback_version=1.2.11
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
5
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
5
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
234
gradlew
vendored
Normal file
234
gradlew
vendored
Normal file
@ -0,0 +1,234 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
89
gradlew.bat
vendored
Normal file
89
gradlew.bat
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
BIN
libs/unidbg-android.jar
Normal file
BIN
libs/unidbg-android.jar
Normal file
Binary file not shown.
120
refresh_token/README.md
Normal file
120
refresh_token/README.md
Normal file
@ -0,0 +1,120 @@
|
||||
# 初始化Sign
|
||||
|
||||
- 执行```/register```请求,注册对应QQ实例进系统。
|
||||
|
||||
```kotlin
|
||||
http://host:port/register?uin=[QQ]&android_id=[ANDROID_ID]&guid=[GUID]&qimei36=[QIMEI36]&key=[KEY]
|
||||
```
|
||||
|
||||
如果是第一次注册实例则会出现以下返回
|
||||
|
||||
```json5
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "Instance loaded successfully.",
|
||||
"data": ""
|
||||
}
|
||||
```
|
||||
|
||||
如果这个QQ已经注册实例了,但是又执行一次,则会以下返回
|
||||
|
||||
```json5
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "The QQ has already loaded an instance, so this time it is deleting the existing instance and creating a new one.",
|
||||
"data": ""
|
||||
}
|
||||
```
|
||||
|
||||
未注册实例请求API会出现以下返回
|
||||
|
||||
```json5
|
||||
{
|
||||
"code": 1,
|
||||
"msg": "Uin is not registered.",
|
||||
"data": "/sign?uin=xxx&qua=V1_AND_SQ_8.9.63_4188_HDBM_T&cmd=xxx&seq=xxx&buffer=xxx"
|
||||
}
|
||||
```
|
||||
|
||||
### 关于自动注册实例的说明
|
||||
|
||||
- 如果不想使用```/register```注册实例,想直接使用```/energy```和```/sign```请求,可以在config.json修改auto_register参数为true,启用自动注册实例功能。
|
||||
- 此外,需要注意的是,在首次请求```/sign```或```/energy```需提交额外的参数```android_id```和```guid```,后续请求即可省略。
|
||||
|
||||
# 联网更新Token
|
||||
|
||||
- 当首次调用```/sign```的时候会有类似以下返回
|
||||
|
||||
```json5
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "success",
|
||||
"data": {
|
||||
"token": "xxx",
|
||||
"extra": "xxx",
|
||||
"sign": "xxx",
|
||||
"o3did": "xxx",
|
||||
"requestCallback": [
|
||||
{
|
||||
"cmd": "trpc.o3.ecdh_access.EcdhAccess.SsoSecureA2Establish",
|
||||
"body": "xxx",
|
||||
"callbackId": 0
|
||||
},
|
||||
{
|
||||
"cmd": "trpc.o3.ecdh_access.EcdhAccess.SsoSecureA2Establish",
|
||||
"body": "xxx",
|
||||
"callbackId": 1
|
||||
},
|
||||
{
|
||||
"cmd": "trpc.o3.ecdh_access.EcdhAccess.SsoSecureA2Establish",
|
||||
"body": "xxx",
|
||||
"callbackId": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- 你需要发送```requestCallback```内的Packet(部分Packet需要签sign或者登录后才能发送),并携带callback_id提交返回包给API。
|
||||
|
||||
```kotlin
|
||||
http://host:port/submit?uin=[QQ]&cmd=[CMD]&callback_id=[CALLBACK_ID]&buffer=[BUFFER]
|
||||
```
|
||||
|
||||
> WARN: 其中```buffer```参数无需携带4字节(32bit)的长度。
|
||||
|
||||
# 刷新Token
|
||||
|
||||
sign的token会过期(过期时间在1小时左右,建议每隔30~40分钟请求刷新token)
|
||||
|
||||
```kotlin
|
||||
http://host:port/request_token?uin=[QQ]
|
||||
```
|
||||
|
||||
# 销毁实例
|
||||
|
||||
可以主动销毁已经注册的实例,使用本API至少需要1.1.6版本及以上的支持。
|
||||
|
||||
```kotlin
|
||||
http://host:port/destroy?uin=[QQ]&key=[key]
|
||||
```
|
||||
|
||||
成功销毁实例返回
|
||||
|
||||
```json5
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "Instance destroyed successfully.",
|
||||
"data": ""
|
||||
}
|
||||
```
|
||||
|
||||
如果该实例未注册则返回
|
||||
|
||||
```json5
|
||||
{
|
||||
"code": 1,
|
||||
"msg": "Instance does not exist.",
|
||||
"data": "failed"
|
||||
}
|
||||
```
|
2
settings.gradle.kts
Normal file
2
settings.gradle.kts
Normal file
@ -0,0 +1,2 @@
|
||||
rootProject.name = "unidbg-fetch-qsign"
|
||||
|
383
src/main/java/com/tencent/crypt/Crypt.java
Normal file
383
src/main/java/com/tencent/crypt/Crypt.java
Normal file
@ -0,0 +1,383 @@
|
||||
package com.tencent.crypt;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.Random;
|
||||
|
||||
public class Crypt {
|
||||
// 指向当前的明文块
|
||||
private byte[] plain;
|
||||
// 这指向前面一个明文块
|
||||
private byte[] prePlain;
|
||||
// 输出的密文或者明文
|
||||
private byte[] out;
|
||||
// 当前加密的密文位置和上一次加密的密文块位置,他们相差8
|
||||
private int crypt, preCrypt;
|
||||
// 当前处理的加密解密块的位置
|
||||
private int pos;
|
||||
// 填充数
|
||||
private int padding;
|
||||
// 密钥
|
||||
private byte[] key;
|
||||
// 用于加密时,表示当前是否是第一个8字节块,因为加密算法是反馈的
|
||||
// 但是最开始的8个字节没有反馈可用,所有需要标明这种情况
|
||||
private boolean header = true;
|
||||
// 这个表示当前解密开始的位置,之所以要这么一个变量是为了避免当解密到最后时
|
||||
// 后面已经没有数据,这时候就会出错,这个变量就是用来判断这种情况免得出错
|
||||
private int contextStart;
|
||||
// 随机数对象
|
||||
private static final Random random = new Random();
|
||||
// 字节输出流
|
||||
private final ByteArrayOutputStream bas;
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
public Crypt() {
|
||||
bas = new ByteArrayOutputStream(8);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解密
|
||||
*
|
||||
* @param in 密文
|
||||
* @param offset 密文开始的位置
|
||||
* @param len 密文长度
|
||||
* @param k 密钥
|
||||
* @return 明文
|
||||
*/
|
||||
public byte[] decrypt(byte[] in, int offset, int len, byte[] k) {
|
||||
// 检查密钥
|
||||
if (k == null)
|
||||
return null;
|
||||
|
||||
crypt = preCrypt = 0;
|
||||
this.key = k;
|
||||
int count;
|
||||
byte[] m = new byte[offset + 8];
|
||||
|
||||
// 因为QQ消息加密之后至少是16字节,并且肯定是8的倍数,这里检查这种情况
|
||||
if ((len % 8 != 0) || (len < 16)) return null;
|
||||
// 得到消息的头部,关键是得到真正明文开始的位置,这个信息存在第一个字节里面,所以其用解密得到的第一个字节与7做与
|
||||
prePlain = decipher(in, offset);
|
||||
pos = prePlain[0] & 0x7;
|
||||
// 得到真正明文的长度
|
||||
count = len - pos - 10;
|
||||
// 如果明文长度小于0,那肯定是出错了,比如传输错误之类的,返回
|
||||
if (count < 0) return null;
|
||||
|
||||
// 这个是临时的preCrypt,和加密时第一个8字节块没有prePlain一样,解密时
|
||||
// 第一个8字节块也没有preCrypt,所有这里建一个全0的
|
||||
for (int i = offset; i < m.length; i++)
|
||||
m[i] = 0;
|
||||
// 通过了上面的代码,密文应该是没有问题了,我们分配输出缓冲区
|
||||
out = new byte[count];
|
||||
// 设置preCrypt的位置等于0,注意目前的preCrypt位置是指向m的,因为java没有指针,所以我们在后面要控制当前密文buf的引用
|
||||
preCrypt = 0;
|
||||
// 当前的密文位置,为什么是8不是0呢?注意前面我们已经解密了头部信息了,现在当然该8了
|
||||
crypt = 8;
|
||||
// 自然这个也是8
|
||||
contextStart = 8;
|
||||
// 加1,和加密算法是对应的
|
||||
pos++;
|
||||
|
||||
// 开始跳过头部,如果在这个过程中满了8字节,则解密下一块
|
||||
// 因为是解密下一块,所以我们有一个语句 m = in,下一块当然有preCrypt了,我们不再用m了
|
||||
// 但是如果不满8,这说明了什么?说明了头8个字节的密文是包含了明文信息的,当然还是要用m把明文弄出来
|
||||
// 所以,很显然,满了8的话,说明了头8个字节的密文除了一个长度信息有用之外,其他都是无用的填充
|
||||
padding = 1;
|
||||
while (padding <= 2) {
|
||||
if (pos < 8) {
|
||||
pos++;
|
||||
padding++;
|
||||
}
|
||||
if (pos == 8) {
|
||||
m = in;
|
||||
decrypt8Bytes(in, offset, len);
|
||||
}
|
||||
}
|
||||
|
||||
// 这里是解密的重要阶段,这个时候头部的填充都已经跳过了,开始解密
|
||||
// 注意如果上面一个while没有满8,这里第一个if里面用的就是原始的m,否则这个m就是in了
|
||||
int i = 0;
|
||||
while (count != 0) {
|
||||
if (pos < 8) {
|
||||
out[i] = (byte) (m[offset + preCrypt + pos] ^ prePlain[pos]);
|
||||
i++;
|
||||
count--;
|
||||
pos++;
|
||||
}
|
||||
if (pos == 8) {
|
||||
m = in;
|
||||
preCrypt = crypt - 8;
|
||||
decrypt8Bytes(in, offset, len);
|
||||
}
|
||||
}
|
||||
|
||||
// 最后的解密部分,上面一个while已经把明文都解出来了,就剩下尾部的填充了,应该全是0
|
||||
// 所以这里有检查是否解密了之后是不是0,如果不是的话那肯定出错了,返回null
|
||||
for (padding = 1; padding < 8; padding++) {
|
||||
if (pos < 8) {
|
||||
if ((m[offset + preCrypt + pos] ^ prePlain[pos]) != 0)
|
||||
return null;
|
||||
pos++;
|
||||
}
|
||||
if (pos == 8) {
|
||||
m = in;
|
||||
preCrypt = crypt;
|
||||
decrypt8Bytes(in, offset, len);
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
public byte[] decrypt(byte[] in, byte[] k) {
|
||||
return decrypt(in, 0, in.length, k);
|
||||
}
|
||||
|
||||
public byte[] encrypt(byte[] in, int offset, int len, byte[] k) {
|
||||
// 检查密钥
|
||||
if (k == null)
|
||||
return in;
|
||||
|
||||
plain = new byte[8];
|
||||
prePlain = new byte[8];
|
||||
padding = 0;
|
||||
crypt = preCrypt = 0;
|
||||
this.key = k;
|
||||
header = true;
|
||||
|
||||
// 计算头部填充字节数
|
||||
pos = (len + 0x0A) % 8;
|
||||
if (pos != 0)
|
||||
pos = 8 - pos;
|
||||
// 计算输出的密文长度
|
||||
out = new byte[len + pos + 10];
|
||||
// 这里的操作把pos存到了plain的第一个字节里面
|
||||
// 0xF8后面三位是空的,正好留给pos,因为pos是0到7的值,表示文本开始的字节位置
|
||||
plain[0] = (byte) ((rand() & 0xF8) | pos);
|
||||
|
||||
// 这里用随机产生的数填充plain[1]到plain[pos]之间的内容
|
||||
for (int i = 1; i <= pos; i++)
|
||||
plain[i] = (byte) (rand() & 0xFF);
|
||||
pos++;
|
||||
// 这个就是prePlain,第一个8字节块当然没有prePlain,所以我们做一个全0的给第一个8字节块
|
||||
for (int i = 0; i < 8; i++)
|
||||
prePlain[i] = 0x0;
|
||||
|
||||
// 继续填充2个字节的随机数,这个过程中如果满了8字节就加密之
|
||||
padding = 1;
|
||||
while (padding <= 2) {
|
||||
if (pos < 8) {
|
||||
plain[pos++] = (byte) (rand() & 0xFF);
|
||||
padding++;
|
||||
}
|
||||
if (pos == 8)
|
||||
encrypt8Bytes();
|
||||
}
|
||||
|
||||
// 头部填充完了,这里开始填真正的明文了,也是满了8字节就加密,一直到明文读完
|
||||
int i = offset;
|
||||
while (len > 0) {
|
||||
if (pos < 8) {
|
||||
plain[pos++] = in[i++];
|
||||
len--;
|
||||
}
|
||||
if (pos == 8)
|
||||
encrypt8Bytes();
|
||||
}
|
||||
|
||||
// 最后填上0,以保证是8字节的倍数
|
||||
padding = 1;
|
||||
while (padding <= 7) {
|
||||
if (pos < 8) {
|
||||
plain[pos++] = 0x0;
|
||||
padding++;
|
||||
}
|
||||
if (pos == 8)
|
||||
encrypt8Bytes();
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
public byte[] encrypt(byte[] in, byte[] k) {
|
||||
return encrypt(in, 0, in.length, k);
|
||||
}
|
||||
|
||||
private byte[] encipher(byte[] in) {
|
||||
// 迭代次数,16次
|
||||
int loop = 0x10;
|
||||
// 得到明文和密钥的各个部分,注意java没有无符号类型,所以为了表示一个无符号的整数
|
||||
// 我们用了long,这个long的前32位是全0的,我们通过这种方式模拟无符号整数,后面用到的long也都是一样的
|
||||
// 而且为了保证前32位为0,需要和0xFFFFFFFF做一下位与
|
||||
long y = getUnsignedInt(in, 0, 4);
|
||||
long z = getUnsignedInt(in, 4, 4);
|
||||
long a = getUnsignedInt(key, 0, 4);
|
||||
long b = getUnsignedInt(key, 4, 4);
|
||||
long c = getUnsignedInt(key, 8, 4);
|
||||
long d = getUnsignedInt(key, 12, 4);
|
||||
// 这是算法的一些控制变量,为什么delta是0x9E3779B9呢?
|
||||
// 这个数是TEA算法的delta,实际是就是(sqr(5) - 1) * 2^31 (根号5,减1,再乘2的31次方)
|
||||
long sum = 0;
|
||||
long delta = 0x9E3779B9;
|
||||
delta &= 0xFFFFFFFFL;
|
||||
|
||||
// 开始迭代了,乱七八糟的,我也看不懂,反正和DES之类的差不多,都是这样倒来倒去
|
||||
while (loop-- > 0) {
|
||||
sum += delta;
|
||||
sum &= 0xFFFFFFFFL;
|
||||
y += ((z << 4) + a) ^ (z + sum) ^ ((z >>> 5) + b);
|
||||
y &= 0xFFFFFFFFL;
|
||||
z += ((y << 4) + c) ^ (y + sum) ^ ((y >>> 5) + d);
|
||||
z &= 0xFFFFFFFFL;
|
||||
}
|
||||
|
||||
// 最后,我们输出密文,因为我用的long,所以需要强制转换一下变成int
|
||||
bas.reset();
|
||||
writeInt((int) y);
|
||||
writeInt((int) z);
|
||||
return bas.toByteArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 解密从offset开始的8字节密文
|
||||
*
|
||||
* @param in 密文字节数组
|
||||
* @param offset 密文开始位置
|
||||
* @return 明文
|
||||
*/
|
||||
private byte[] decipher(byte[] in, int offset) {
|
||||
// 迭代次数,16次
|
||||
int loop = 0x10;
|
||||
// 得到密文和密钥的各个部分,注意java没有无符号类型,所以为了表示一个无符号的整数
|
||||
// 我们用了long,这个long的前32位是全0的,我们通过这种方式模拟无符号整数,后面用到的long也都是一样的
|
||||
// 而且为了保证前32位为0,需要和0xFFFFFFFF做一下位与
|
||||
long y = getUnsignedInt(in, offset, 4);
|
||||
long z = getUnsignedInt(in, offset + 4, 4);
|
||||
long a = getUnsignedInt(key, 0, 4);
|
||||
long b = getUnsignedInt(key, 4, 4);
|
||||
long c = getUnsignedInt(key, 8, 4);
|
||||
long d = getUnsignedInt(key, 12, 4);
|
||||
// 算法的一些控制变量,sum在这里也有数了,这个sum和迭代次数有关系
|
||||
// 因为delta是这么多,所以sum如果是这么多的话,迭代的时候减减减,减16次,最后
|
||||
// 得到0。反正这就是为了得到和加密时相反顺序的控制变量,这样才能解密呀~~
|
||||
long sum = 0xE3779B90;
|
||||
sum &= 0xFFFFFFFFL;
|
||||
long delta = 0x9E3779B9;
|
||||
delta &= 0xFFFFFFFFL;
|
||||
|
||||
// 迭代开始了, @_@
|
||||
while (loop-- > 0) {
|
||||
z -= ((y << 4) + c) ^ (y + sum) ^ ((y >>> 5) + d);
|
||||
z &= 0xFFFFFFFFL;
|
||||
y -= ((z << 4) + a) ^ (z + sum) ^ ((z >>> 5) + b);
|
||||
y &= 0xFFFFFFFFL;
|
||||
sum -= delta;
|
||||
sum &= 0xFFFFFFFFL;
|
||||
}
|
||||
|
||||
bas.reset();
|
||||
writeInt((int) y);
|
||||
writeInt((int) z);
|
||||
return bas.toByteArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 写入一个整型到输出流,高字节优先
|
||||
*/
|
||||
private void writeInt(int t) {
|
||||
bas.write(t >>> 24);
|
||||
bas.write(t >>> 16);
|
||||
bas.write(t >>> 8);
|
||||
bas.write(t);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解密
|
||||
*
|
||||
* @param in 密文
|
||||
* @return 明文
|
||||
*/
|
||||
private byte[] decipher(byte[] in) {
|
||||
return decipher(in, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加密8字节
|
||||
*/
|
||||
private void encrypt8Bytes() {
|
||||
// 这部分完成我上面所说的 plain ^ preCrypt,注意这里判断了是不是第一个8字节块,如果是的话,那个prePlain就当作preCrypt用
|
||||
for (pos = 0; pos < 8; pos++) {
|
||||
if (header)
|
||||
plain[pos] ^= prePlain[pos];
|
||||
else
|
||||
plain[pos] ^= out[preCrypt + pos];
|
||||
}
|
||||
// 这个完成我上面说的 f(plain ^ preCrypt)
|
||||
byte[] crypted = encipher(plain);
|
||||
// 这个没什么,就是拷贝一下,java不像c,所以我只好这么干,c就不用这一步了
|
||||
System.arraycopy(crypted, 0, out, crypt, 8);
|
||||
|
||||
// 这个完成了 f(plain ^ preCrypt) ^ prePlain,ok,下面拷贝一下就行了
|
||||
for (pos = 0; pos < 8; pos++)
|
||||
out[crypt + pos] ^= prePlain[pos];
|
||||
System.arraycopy(plain, 0, prePlain, 0, 8);
|
||||
|
||||
// 完成了加密,现在是调整crypt,preCrypt等等东西的时候了
|
||||
preCrypt = crypt;
|
||||
crypt += 8;
|
||||
pos = 0;
|
||||
header = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解密8个字节
|
||||
*
|
||||
* @param in 密文字节数组
|
||||
* @param offset 从何处开始解密
|
||||
* @param len 密文的长度
|
||||
* @return true表示解密成功
|
||||
*/
|
||||
private void decrypt8Bytes(byte[] in, int offset, int len) {
|
||||
// 这里第一步就是判断后面还有没有数据,没有就返回,如果有,就执行 crypt ^ prePlain
|
||||
for (pos = 0; pos < 8; pos++) {
|
||||
if (contextStart + pos >= len)
|
||||
return;
|
||||
prePlain[pos] ^= in[offset + crypt + pos];
|
||||
}
|
||||
|
||||
// 好,这里执行到了 d(crypt ^ prePlain)
|
||||
prePlain = decipher(prePlain);
|
||||
|
||||
// 解密完成,最后一步好像没做?
|
||||
// 这里最后一步放到decrypt里面去做了,因为解密的步骤有点不太一样
|
||||
// 调整这些变量的值先
|
||||
contextStart += 8;
|
||||
crypt += 8;
|
||||
pos = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 这是个随机因子产生器,用来填充头部的,如果为了调试,可以用一个固定值
|
||||
* 随机因子可以使相同的明文每次加密出来的密文都不一样
|
||||
*
|
||||
* @return 随机因子
|
||||
*/
|
||||
private int rand() {
|
||||
return random.nextInt();
|
||||
}
|
||||
|
||||
public static long getUnsignedInt(byte[] in, int offset, int len) {
|
||||
long ret = 0L;
|
||||
int end;
|
||||
if (len > 8)
|
||||
end = offset + 8;
|
||||
else
|
||||
end = offset + len;
|
||||
for (int i = offset; i < end; i++) {
|
||||
ret <<= 8;
|
||||
ret |= in[i] & 0xff;
|
||||
}
|
||||
return ret & 0xffffffffL | ret >>> 32;
|
||||
}
|
||||
}
|
151
src/main/java/com/tencent/mobileqq/dt/model/FEBound.java
Normal file
151
src/main/java/com/tencent/mobileqq/dt/model/FEBound.java
Normal file
@ -0,0 +1,151 @@
|
||||
package com.tencent.mobileqq.dt.model;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import kotlin.io.FilesKt;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
public class FEBound {
|
||||
private static final int LEVEL1 = 32;
|
||||
private static final int LEVEL2 = 16;
|
||||
private static final int Type_Decode = 2;
|
||||
private static final int Type_Encode = 1;
|
||||
private static final byte[][] mConfigEnCode = {
|
||||
new byte[]{15, 10, 13, 4, 0, 5, 3, 1, 11, 12, 7, 2, 14, 6, 9, 8},
|
||||
new byte[]{12, 1, 13, 4, 14, 9, 8, 6, 5, 3, 10, 7, 11, 2, 0, 15},
|
||||
new byte[]{10, 5, 14, 0, 9, 1, 7, 4, 11, 8, 3, 15, 12, 6, 13, 2},
|
||||
new byte[]{7, 11, 2, 14, 3, 10, 1, 8, 0, 15, 9, 6, 13, 4, 5, 12},
|
||||
new byte[]{5, 15, 1, 2, 4, 13, 7, 8, 3, 6, 11, 0, 9, 10, 12, 14},
|
||||
new byte[]{2, 5, 0, 9, 3, 15, 11, 7, 8, 13, 10, 4, 1, 14, 6, 12},
|
||||
new byte[]{15, 12, 6, 14, 7, 2, 0, 10, 11, 13, 3, 5, 1, 4, 9, 8},
|
||||
new byte[]{13, 2, 0, 1, 8, 10, 4, 14, 11, 12, 7, 3, 15, 9, 5, 6},
|
||||
new byte[]{10, 6, 7, 8, 9, 3, 15, 1, 2, 5, 11, 12, 13, 14, 0, 4},
|
||||
new byte[]{8, 10, 4, 2, 13, 15, 12, 7, 6, 3, 14, 0, 1, 5, 9, 11},
|
||||
new byte[]{5, 7, 12, 6, 0, 2, 14, 3, 1, 13, 9, 10, 15, 11, 8, 4},
|
||||
new byte[]{2, 7, 12, 1, 9, 10, 4, 8, 13, 11, 6, 3, 0, 5, 15, 14},
|
||||
new byte[]{0, 11, 9, 3, 12, 8, 14, 13, 5, 4, 10, 15, 7, 2, 1, 6},
|
||||
new byte[]{13, 1, 0, 12, 6, 14, 7, 11, 3, 10, 2, 5, 15, 8, 4, 9},
|
||||
new byte[]{10, 7, 5, 1, 0, 6, 9, 13, 14, 8, 3, 15, 11, 12, 4, 2},
|
||||
new byte[]{7, 14, 5, 13, 4, 11, 15, 10, 8, 0, 12, 2, 3, 1, 9, 6},
|
||||
new byte[]{5, 2, 1, 12, 10, 14, 4, 15, 9, 8, 6, 0, 13, 11, 7, 3},
|
||||
new byte[]{2, 8, 6, 5, 1, 3, 14, 10, 0, 12, 4, 13, 7, 15, 9, 11},
|
||||
new byte[]{0, 12, 3, 11, 10, 5, 4, 14, 9, 7, 1, 2, 13, 8, 6, 15},
|
||||
new byte[]{13, 3, 7, 11, 4, 10, 15, 0, 5, 2, 6, 12, 14, 9, 8, 1},
|
||||
new byte[]{11, 7, 4, 6, 3, 0, 14, 5, 2, 9, 13, 15, 10, 8, 12, 1},
|
||||
new byte[]{8, 13, 0, 11, 4, 1, 3, 9, 10, 15, 12, 5, 14, 7, 6, 2},
|
||||
new byte[]{5, 3, 11, 10, 13, 6, 1, 15, 12, 8, 2, 4, 9, 14, 0, 7},
|
||||
new byte[]{3, 7, 9, 6, 0, 5, 10, 14, 1, 13, 11, 4, 2, 15, 8, 12},
|
||||
new byte[]{0, 14, 12, 15, 11, 1, 3, 10, 8, 2, 9, 6, 13, 5, 7, 4},
|
||||
new byte[]{13, 4, 8, 6, 3, 7, 10, 0, 14, 5, 9, 1, 15, 12, 2, 11},
|
||||
new byte[]{11, 8, 13, 5, 3, 14, 6, 9, 1, 0, 12, 15, 2, 7, 10, 4},
|
||||
new byte[]{8, 14, 13, 10, 7, 3, 0, 6, 11, 12, 5, 1, 15, 4, 9, 2},
|
||||
new byte[]{6, 2, 14, 10, 15, 1, 5, 8, 9, 7, 11, 13, 4, 3, 12, 0},
|
||||
new byte[]{3, 9, 2, 4, 5, 8, 1, 7, 11, 10, 12, 0, 15, 13, 6, 14},
|
||||
new byte[]{0, 15, 6, 14, 11, 2, 1, 3, 13, 4, 10, 12, 7, 5, 8, 9},
|
||||
new byte[]{13, 5, 10, 7, 2, 4, 11, 0, 14, 8, 1, 9, 3, 12, 6, 15}
|
||||
};
|
||||
private static final byte[][] mConfigDeCode = {
|
||||
new byte[]{13, 7, 12, 2, 14, 11, 3, 8, 5, 9, 10, 6, 1, 15, 0, 4},
|
||||
new byte[]{13, 8, 4, 1, 9, 15, 12, 2, 11, 7, 10, 0, 3, 5, 6, 14},
|
||||
new byte[]{7, 3, 9, 13, 2, 6, 14, 1, 5, 0, 8, 4, 11, 12, 10, 15},
|
||||
new byte[]{9, 5, 14, 13, 7, 10, 0, 6, 2, 15, 3, 4, 11, 1, 8, 12},
|
||||
new byte[]{11, 1, 4, 9, 0, 2, 6, 10, 5, 8, 14, 15, 7, 3, 12, 13},
|
||||
new byte[]{3, 0, 12, 10, 5, 13, 15, 1, 11, 2, 7, 4, 8, 9, 6, 14},
|
||||
new byte[]{1, 13, 15, 12, 10, 6, 11, 4, 5, 3, 7, 9, 14, 2, 0, 8},
|
||||
new byte[]{3, 8, 1, 11, 6, 4, 13, 10, 15, 7, 2, 5, 0, 14, 12, 9},
|
||||
new byte[]{7, 6, 13, 9, 5, 14, 3, 15, 1, 0, 10, 4, 11, 8, 2, 12},
|
||||
new byte[]{7, 14, 15, 5, 6, 11, 9, 0, 4, 10, 8, 2, 1, 12, 3, 13},
|
||||
new byte[]{8, 5, 14, 1, 0, 4, 7, 13, 6, 10, 15, 3, 12, 9, 11, 2},
|
||||
new byte[]{15, 0, 5, 2, 7, 3, 8, 12, 11, 1, 13, 4, 14, 6, 9, 10},
|
||||
new byte[]{12, 8, 10, 6, 15, 5, 14, 9, 7, 3, 13, 11, 2, 1, 4, 0},
|
||||
new byte[]{15, 6, 4, 1, 2, 5, 13, 11, 9, 14, 3, 12, 0, 10, 7, 8},
|
||||
new byte[]{6, 4, 8, 9, 3, 12, 14, 2, 10, 0, 1, 15, 11, 13, 5, 7},
|
||||
new byte[]{9, 13, 11, 12, 4, 2, 15, 0, 8, 14, 7, 5, 10, 3, 1, 6},
|
||||
new byte[]{1, 4, 8, 10, 0, 7, 15, 9, 2, 3, 14, 13, 11, 6, 5, 12},
|
||||
new byte[]{4, 0, 10, 3, 13, 7, 11, 9, 5, 6, 1, 14, 2, 12, 15, 8},
|
||||
new byte[]{3, 4, 14, 8, 5, 13, 10, 9, 6, 2, 11, 15, 12, 7, 1, 0},
|
||||
new byte[]{6, 10, 12, 7, 4, 1, 13, 8, 5, 3, 11, 14, 0, 2, 15, 9},
|
||||
new byte[]{2, 11, 14, 13, 3, 9, 8, 12, 4, 1, 0, 15, 7, 10, 5, 6},
|
||||
new byte[]{6, 15, 3, 4, 9, 7, 11, 0, 5, 14, 13, 10, 12, 8, 2, 1},
|
||||
new byte[]{4, 14, 2, 5, 0, 1, 10, 7, 3, 13, 6, 15, 12, 8, 11, 9},
|
||||
new byte[]{11, 13, 0, 3, 5, 14, 9, 7, 4, 1, 8, 15, 6, 12, 10, 2},
|
||||
new byte[]{11, 3, 1, 8, 7, 12, 6, 10, 5, 9, 15, 14, 2, 13, 4, 0},
|
||||
new byte[]{10, 13, 3, 14, 15, 12, 1, 2, 11, 7, 4, 6, 0, 5, 9, 8},
|
||||
new byte[]{1, 15, 5, 3, 2, 6, 7, 4, 8, 11, 0, 14, 12, 13, 10, 9},
|
||||
new byte[]{1, 10, 5, 7, 15, 14, 12, 0, 11, 8, 4, 2, 3, 6, 13, 9},
|
||||
new byte[]{1, 2, 12, 14, 8, 0, 6, 10, 3, 9, 7, 15, 11, 4, 13, 5},
|
||||
new byte[]{10, 5, 0, 14, 15, 13, 3, 11, 8, 2, 4, 1, 6, 7, 12, 9},
|
||||
new byte[]{8, 1, 4, 12, 11, 7, 9, 5, 14, 6, 10, 3, 13, 2, 15, 0},
|
||||
new byte[]{7, 10, 4, 12, 5, 1, 14, 3, 9, 11, 2, 6, 13, 0, 8, 15}
|
||||
};
|
||||
|
||||
public static void initAssertConfig(File baseDir) {
|
||||
File target = new File(baseDir, "dtconfig.json");
|
||||
String text = FilesKt.readText(target, Charset.defaultCharset());
|
||||
|
||||
JSONObject object = JSON.parseObject(text);
|
||||
|
||||
JSONArray en = object.getJSONArray("en");
|
||||
for (int i = 0; i < en.size(); i++) {
|
||||
JSONArray keys = en.getJSONArray(i);
|
||||
for (int j = 0; j < keys.size(); j++) {
|
||||
mConfigEnCode[i][j] = keys.getByteValue(j);
|
||||
}
|
||||
}
|
||||
|
||||
JSONArray de = object.getJSONArray("de");
|
||||
for (int i = 0; i < de.size(); i++) {
|
||||
JSONArray keys = de.getJSONArray(i);
|
||||
for (int j = 0; j < keys.size(); j++) {
|
||||
mConfigDeCode[i][j] = keys.getByteValue(j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static int checkCurrent() {
|
||||
int tmp = 0;
|
||||
for (byte[] bytes : mConfigEnCode) {
|
||||
for (byte aByte : bytes) {
|
||||
tmp += aByte;
|
||||
}
|
||||
}
|
||||
for (byte[] bytes : mConfigDeCode) {
|
||||
for (byte aByte : bytes) {
|
||||
tmp += aByte;
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public static byte[] transform(int i, byte[] bArr) {
|
||||
try {
|
||||
byte[] bArr2 = new byte[bArr.length];
|
||||
byte[][] bArr3 = mConfigEnCode;
|
||||
if (bArr3.length == LEVEL1 && i == Type_Encode) {
|
||||
transformInner(bArr, bArr2, bArr3);
|
||||
} else {
|
||||
byte[][] bArr4 = mConfigDeCode;
|
||||
if (bArr4.length == LEVEL1 && i == Type_Decode) {
|
||||
transformInner(bArr, bArr2, bArr4);
|
||||
} else {
|
||||
//a.a(TAG, (int) Type_Encode, "transform error!");
|
||||
}
|
||||
}
|
||||
return bArr2;
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
//a.a(TAG, (int) Type_Encode, "encode error!" + th);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static void transformInner(byte[] bArr, byte[] bArr2, byte[][] bArr3) {
|
||||
for (int i = 0; i < bArr.length; i += Type_Encode) {
|
||||
int i2 = i * Type_Decode;
|
||||
bArr2[i] = (byte) (bArr3[(i2 + Type_Encode) % LEVEL1][(byte) (bArr[i] & 15)] | (bArr3[i2 % LEVEL1][(byte) ((bArr[i] >> 4) & 15)] << 4));
|
||||
}
|
||||
}
|
||||
}
|
176
src/main/java/com/tencent/mobileqq/qsec/qsecest/SelfBase64.java
Normal file
176
src/main/java/com/tencent/mobileqq/qsec/qsecest/SelfBase64.java
Normal file
@ -0,0 +1,176 @@
|
||||
package com.tencent.mobileqq.qsec.qsecest;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
public class SelfBase64 {
|
||||
|
||||
public static class Encoder {
|
||||
|
||||
private final boolean doPadding;
|
||||
private final boolean isURL;
|
||||
private final int linemax;
|
||||
private final byte[] newline;
|
||||
private static final String base64chars = "EBnuvwxCD+FGHIopqrstJKLRSTUlmyz012VWXYZaMNOPQbcdefghijk3456789A/";
|
||||
private static final char[] toBase64 = base64chars.toCharArray();
|
||||
private static final char[] toBase64URL = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_'};
|
||||
private static final byte[] CRLF = {13, 10};
|
||||
public static final Encoder RFC4648 = new Encoder(false, null, -1, true);
|
||||
static final Encoder RFC4648_URLSAFE = new Encoder(true, null, -1, true);
|
||||
private static final int MIMELINEMAX = 76;
|
||||
static final Encoder RFC2045 = new Encoder(false, CRLF, MIMELINEMAX, true);
|
||||
|
||||
private Encoder(boolean z, byte[] bArr, int i, boolean z2) {
|
||||
this.isURL = z;
|
||||
this.newline = bArr;
|
||||
this.linemax = i;
|
||||
this.doPadding = z2;
|
||||
}
|
||||
|
||||
private final int outLength(int i) {
|
||||
int i2;
|
||||
if (this.doPadding) {
|
||||
i2 = ((i + 2) / 3) * 4;
|
||||
} else {
|
||||
int i3 = i % 3;
|
||||
i2 = (i3 == 0 ? 0 : i3 + 1) + ((i / 3) * 4);
|
||||
}
|
||||
if (this.linemax > 0) {
|
||||
return i2 + (((i2 - 1) / this.linemax) * this.newline.length);
|
||||
}
|
||||
return i2;
|
||||
}
|
||||
|
||||
public byte[] encode(byte[] bArr) {
|
||||
try {
|
||||
byte[] bArr2 = new byte[outLength(bArr.length)];
|
||||
int encode0 = encode0(bArr, 0, bArr.length, bArr2);
|
||||
if (encode0 != bArr2.length) {
|
||||
return Arrays.copyOf(bArr2, encode0);
|
||||
}
|
||||
return bArr2;
|
||||
} catch (Throwable th) {
|
||||
th.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public ByteBuffer encode(ByteBuffer byteBuffer) {
|
||||
int encode0;
|
||||
byte[] bArr = new byte[outLength(byteBuffer.remaining())];
|
||||
if (byteBuffer.hasArray()) {
|
||||
encode0 = encode0(byteBuffer.array(), byteBuffer.arrayOffset() + byteBuffer.position(), byteBuffer.arrayOffset() + byteBuffer.limit(), bArr);
|
||||
byteBuffer.position(byteBuffer.limit());
|
||||
} else {
|
||||
byte[] bArr2 = new byte[byteBuffer.remaining()];
|
||||
byteBuffer.get(bArr2);
|
||||
encode0 = encode0(bArr2, 0, bArr2.length, bArr);
|
||||
}
|
||||
return ByteBuffer.wrap(encode0 != bArr.length ? Arrays.copyOf(bArr, encode0) : bArr);
|
||||
}
|
||||
|
||||
public int encode(byte[] bArr, byte[] bArr2) {
|
||||
if (bArr2.length < outLength(bArr.length)) {
|
||||
throw new IllegalArgumentException("Output byte array is too small for encoding all input bytes");
|
||||
}
|
||||
return encode0(bArr, 0, bArr.length, bArr2);
|
||||
}
|
||||
|
||||
public String encodeToString(byte[] bArr) {
|
||||
try {
|
||||
byte[] encode = encode(bArr);
|
||||
return new String(encode, 0, 0, encode.length);
|
||||
} catch (Throwable th) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public OutputStream wrap(OutputStream outputStream) {
|
||||
//Objects.requireNonNull(outputStream);
|
||||
//return new SelfBase64.EncOutputStream(outputStream, this.isURL ? toBase64URL : toBase64, this.newline, this.linemax, this.doPadding);
|
||||
return null;
|
||||
}
|
||||
|
||||
public Encoder withoutPadding() {
|
||||
return !this.doPadding ? this : new Encoder(this.isURL, this.newline, this.linemax, false);
|
||||
}
|
||||
|
||||
private int encode0(byte[] bArr, int i, int i2, byte[] bArr2) {
|
||||
int i3;
|
||||
char[] cArr = this.isURL ? toBase64URL : toBase64;
|
||||
int i4 = ((i2 - i) / 3) * 3;
|
||||
int i5 = i + i4;
|
||||
if (this.linemax > 0 && i4 > (this.linemax / 4) * 3) {
|
||||
i4 = (this.linemax / 4) * 3;
|
||||
}
|
||||
int i6 = 0;
|
||||
int i7 = i;
|
||||
while (i7 < i5) {
|
||||
int min = Math.min(i7 + i4, i5);
|
||||
int i8 = i6;
|
||||
int i9 = i7;
|
||||
while (i9 < min) {
|
||||
int i10 = i9 + 1;
|
||||
int i11 = i10 + 1;
|
||||
int i12 = ((bArr[i10] & 255) << 8) | ((bArr[i9] & 255) << 16);
|
||||
i9 = i11 + 1;
|
||||
int i13 = i12 | (bArr[i11] & 255);
|
||||
int i14 = i8 + 1;
|
||||
bArr2[i8] = (byte) cArr[(i13 >>> 18) & 63];
|
||||
int i15 = i14 + 1;
|
||||
bArr2[i14] = (byte) cArr[(i13 >>> 12) & 63];
|
||||
int i16 = i15 + 1;
|
||||
bArr2[i15] = (byte) cArr[(i13 >>> 6) & 63];
|
||||
i8 = i16 + 1;
|
||||
bArr2[i16] = (byte) cArr[i13 & 63];
|
||||
}
|
||||
int i17 = ((min - i7) / 3) * 4;
|
||||
i6 += i17;
|
||||
if (i17 == this.linemax && min < i2) {
|
||||
byte[] bArr3 = this.newline;
|
||||
int length = bArr3.length;
|
||||
int i18 = 0;
|
||||
while (i18 < length) {
|
||||
bArr2[i6] = bArr3[i18];
|
||||
i18++;
|
||||
i6++;
|
||||
}
|
||||
}
|
||||
i7 = min;
|
||||
}
|
||||
if (i7 < i2) {
|
||||
int i19 = i7 + 1;
|
||||
int i20 = bArr[i7] & 255;
|
||||
int i21 = i6 + 1;
|
||||
bArr2[i6] = (byte) cArr[i20 >> 2];
|
||||
if (i19 == i2) {
|
||||
i3 = i21 + 1;
|
||||
bArr2[i21] = (byte) cArr[(i20 << 4) & 63];
|
||||
if (this.doPadding) {
|
||||
int i22 = i3 + 1;
|
||||
bArr2[i3] = 61;
|
||||
int i23 = i22 + 1;
|
||||
bArr2[i22] = 61;
|
||||
return i23;
|
||||
}
|
||||
} else {
|
||||
int i24 = i19 + 1;
|
||||
int i25 = bArr[i19] & 255;
|
||||
int i26 = i21 + 1;
|
||||
bArr2[i21] = (byte) cArr[((i20 << 4) & 63) | (i25 >> 4)];
|
||||
i3 = i26 + 1;
|
||||
bArr2[i26] = (byte) cArr[(i25 << 2) & 63];
|
||||
if (this.doPadding) {
|
||||
int i27 = i3 + 1;
|
||||
bArr2[i3] = 61;
|
||||
return i27;
|
||||
}
|
||||
}
|
||||
return i3;
|
||||
}
|
||||
return i6;
|
||||
}
|
||||
}
|
||||
}
|
1
src/main/java/project/BuildConfig.java
Normal file
1
src/main/java/project/BuildConfig.java
Normal file
@ -0,0 +1 @@
|
||||
package project;public class BuildConfig { public static String version = "1.1.9";}
|
77
src/main/kotlin/Main.kt
Normal file
77
src/main/kotlin/Main.kt
Normal file
@ -0,0 +1,77 @@
|
||||
import com.tencent.mobileqq.dt.model.FEBound
|
||||
import io.ktor.serialization.kotlinx.json.*
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.engine.*
|
||||
import io.ktor.server.netty.*
|
||||
import io.ktor.server.plugins.contentnegotiation.*
|
||||
import io.ktor.server.plugins.statuspages.*
|
||||
import io.ktor.server.request.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.server.routing.*
|
||||
import kotlinx.serialization.json.Json
|
||||
import moe.fuqiuluo.api.*
|
||||
import moe.fuqiuluo.comm.QSignConfig
|
||||
import moe.fuqiuluo.comm.checkIllegal
|
||||
import moe.fuqiuluo.comm.invoke
|
||||
import java.io.File
|
||||
|
||||
lateinit var CONFIG: QSignConfig
|
||||
lateinit var BASE_PATH: File
|
||||
|
||||
private val API_LIST = arrayOf(
|
||||
Routing::index,
|
||||
Routing::sign,
|
||||
Routing::energy,
|
||||
Routing::submit,
|
||||
Routing::requestToken,
|
||||
Routing::register
|
||||
)
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
args().also {
|
||||
val baseDir = File(it["basePath", "Lack of basePath."]).also {
|
||||
BASE_PATH = it
|
||||
}
|
||||
if (!baseDir.exists() ||
|
||||
!baseDir.isDirectory ||
|
||||
!baseDir.resolve("libfekit.so").exists() ||
|
||||
!baseDir.resolve("config.json").exists()
|
||||
|| !baseDir.resolve("dtconfig.json").exists()
|
||||
) {
|
||||
error("The base path is invalid, perhaps it is not a directory or something is missing inside.")
|
||||
} else {
|
||||
val json = Json { ignoreUnknownKeys = true }
|
||||
FEBound.initAssertConfig(baseDir)
|
||||
println("FEBond sum = ${FEBound.checkCurrent()}")
|
||||
CONFIG = json.decodeFromString<QSignConfig>(baseDir.resolve("config.json").readText())
|
||||
.apply { checkIllegal() }
|
||||
println("Load Package = ${CONFIG.protocol}")
|
||||
}
|
||||
}
|
||||
CONFIG.server.also {
|
||||
embeddedServer(Netty, host = it.host, port = it.port, module = Application::init)
|
||||
.start(wait = true)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun Application.init() {
|
||||
install(ContentNegotiation) {
|
||||
json(Json {
|
||||
prettyPrint = true
|
||||
isLenient = true
|
||||
ignoreUnknownKeys = true
|
||||
})
|
||||
}
|
||||
install(StatusPages) {
|
||||
exception<Throwable> { call, cause ->
|
||||
if (CONFIG.unidbg.debug) {
|
||||
cause.printStackTrace()
|
||||
}
|
||||
call.respond(APIResult(1, cause.message ?: cause.javaClass.name, call.request.uri))
|
||||
}
|
||||
}
|
||||
routing {
|
||||
API_LIST.forEach { it(this) }
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.tencent.mobileqq.channel
|
||||
|
||||
import com.github.unidbg.linux.android.dvm.DvmObject
|
||||
import moe.fuqiuluo.unidbg.QSecVM
|
||||
|
||||
object ChannelManager {
|
||||
fun setChannelProxy(vm: QSecVM, proxy: DvmObject<*>) {
|
||||
vm.newInstance("com/tencent/mobileqq/channel/ChannelManager", unique = true)
|
||||
.callJniMethod(vm.emulator, "setChannelProxy(Lcom/tencent/mobileqq/channel/ChannelProxy;)V", proxy)
|
||||
}
|
||||
|
||||
fun initReport(vm: QSecVM, qua: String, version: String, androidOs: String = "12", brand: String = "Redmi", model: String = "23013RK75C",
|
||||
qimei36: String = vm.global["qimei36"] as? String ?: "", guid: String = vm.global["guid"] as? String ?: "") {
|
||||
runCatching {
|
||||
vm.newInstance("com/tencent/mobileqq/channel/ChannelManager", unique = true)
|
||||
.callJniMethod(vm.emulator, "initReport(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V",
|
||||
qua, version, androidOs, brand + model, qimei36, guid
|
||||
)
|
||||
}.onFailure {
|
||||
vm.newInstance("com/tencent/mobileqq/channel/ChannelManager", unique = true)
|
||||
.callJniMethod(vm.emulator, "initReport(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V",
|
||||
qua, version, androidOs, brand + model
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun onNativeReceive(vm: QSecVM, cmd: String, data: ByteArray, callbackId: Long) {
|
||||
vm.newInstance("com/tencent/mobileqq/channel/ChannelManager", unique = true)
|
||||
.callJniMethod(vm.emulator, "onNativeReceive(Ljava/lang/String;[BZJ)V",
|
||||
cmd, data, true, callbackId)
|
||||
}
|
||||
}
|
14
src/main/kotlin/com/tencent/mobileqq/channel/SsoPacket.kt
Normal file
14
src/main/kotlin/com/tencent/mobileqq/channel/SsoPacket.kt
Normal file
@ -0,0 +1,14 @@
|
||||
@file:OptIn(ExperimentalSerializationApi::class)
|
||||
package com.tencent.mobileqq.channel
|
||||
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.JsonNames
|
||||
|
||||
@Serializable
|
||||
data class SsoPacket(
|
||||
val cmd: String,
|
||||
val body: String,
|
||||
@JsonNames("callback_id")
|
||||
val callbackId: Long
|
||||
)
|
27
src/main/kotlin/com/tencent/mobileqq/dt/Dtn.kt
Normal file
27
src/main/kotlin/com/tencent/mobileqq/dt/Dtn.kt
Normal file
@ -0,0 +1,27 @@
|
||||
package com.tencent.mobileqq.dt
|
||||
|
||||
import com.github.unidbg.linux.android.dvm.DvmObject
|
||||
import moe.fuqiuluo.unidbg.QSecVM
|
||||
|
||||
object Dtn {
|
||||
fun initContext(vm: QSecVM, context: DvmObject<*>) {
|
||||
runCatching {
|
||||
vm.newInstance("com/tencent/mobileqq/dt/Dtn", unique = true)
|
||||
.callJniMethod(vm.emulator, "initContext(Landroid/content/Context;)V", context)
|
||||
}.onFailure {
|
||||
vm.newInstance("com/tencent/mobileqq/dt/Dtn", unique = true)
|
||||
.callJniMethod(vm.emulator, "initContext(Landroid/content/Context;Ljava/lang/String;)V",
|
||||
context, "/data/user/0/${vm.envData.packageName}/files/5463306EE50FE3AA")
|
||||
}
|
||||
}
|
||||
|
||||
fun initLog(vm: QSecVM, logger: DvmObject<*>) {
|
||||
vm.newInstance("com/tencent/mobileqq/dt/Dtn", unique = true)
|
||||
.callJniMethod(vm.emulator, "initLog(Lcom/tencent/mobileqq/fe/IFEKitLog;)V", logger)
|
||||
}
|
||||
|
||||
fun initUin(vm: QSecVM, uin: String) {
|
||||
vm.newInstance("com/tencent/mobileqq/dt/Dtn", unique = true)
|
||||
.callJniMethod(vm.emulator, "initUin(Ljava/lang/String;)V", uin)
|
||||
}
|
||||
}
|
40
src/main/kotlin/com/tencent/mobileqq/fe/FEKit.kt
Normal file
40
src/main/kotlin/com/tencent/mobileqq/fe/FEKit.kt
Normal file
@ -0,0 +1,40 @@
|
||||
package com.tencent.mobileqq.fe
|
||||
|
||||
import com.tencent.mobileqq.channel.ChannelManager
|
||||
import com.tencent.mobileqq.dt.Dtn
|
||||
import com.tencent.mobileqq.qsec.qsecurity.DeepSleepDetector
|
||||
import com.tencent.mobileqq.qsec.qsecurity.QSec
|
||||
import com.tencent.mobileqq.sign.QQSecuritySign
|
||||
import moe.fuqiuluo.unidbg.QSecVM
|
||||
|
||||
object FEKit {
|
||||
fun init(vm: QSecVM, uin: String = "0") {
|
||||
if ("fekit" in vm.global) return
|
||||
vm.global["uin"] = uin
|
||||
|
||||
if ("DeepSleepDetector" !in vm.global) {
|
||||
vm.global["DeepSleepDetector"] = DeepSleepDetector()
|
||||
}
|
||||
|
||||
QQSecuritySign.initSafeMode(vm, false)
|
||||
QQSecuritySign.dispatchEvent(vm, "Kicked", uin)
|
||||
|
||||
val context = vm.newInstance("android/content/Context", unique = true)
|
||||
Dtn.initContext(vm, context)
|
||||
|
||||
Dtn.initLog(vm, vm.newInstance("com/tencent/mobileqq/fe/IFEKitLog"))
|
||||
Dtn.initUin(vm, uin)
|
||||
|
||||
QSec.doSomething(vm, context)
|
||||
|
||||
ChannelManager.setChannelProxy(vm, vm.newInstance("com/tencent/mobileqq/channel/ChannelProxy"))
|
||||
ChannelManager.initReport(vm, vm.envData.qua, "6.100.248") // TODO(maybe check?)
|
||||
}
|
||||
|
||||
fun changeUin(vm: QSecVM, uin: String) {
|
||||
vm.global["uin"] = uin
|
||||
|
||||
Dtn.initUin(vm, uin)
|
||||
QQSecuritySign.dispatchEvent(vm, "Kicked", uin)
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
@file:Suppress("LocalVariableName")
|
||||
package com.tencent.mobileqq.qsec.qsecdandelionsdk
|
||||
|
||||
import com.github.unidbg.linux.android.dvm.DvmObject
|
||||
import moe.fuqiuluo.unidbg.QSecVM
|
||||
|
||||
object Dandelion {
|
||||
@JvmStatic
|
||||
fun energy(vm: QSecVM, data: String, salt: ByteArray): ByteArray {
|
||||
val Dandelion = vm.newInstance("com.tencent.mobileqq.qsec.qsecdandelionsdk/Dandelion", unique = true)
|
||||
return Dandelion.callJniMethodObject<DvmObject<*>>(vm.emulator,
|
||||
"energy(Ljava/lang/Object;Ljava/lang/Object;)[B", data, salt).value as ByteArray
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.tencent.mobileqq.qsec.qsecurity
|
||||
class DeepSleepDetector {
|
||||
val lock: Any = Any()
|
||||
val checkRunnable = CheckRunnable()
|
||||
var stopped: Boolean = false
|
||||
|
||||
init {
|
||||
Thread(checkRunnable).start()
|
||||
}
|
||||
|
||||
fun getCheckResult(): Float {
|
||||
return checkRunnable.c()
|
||||
}
|
||||
|
||||
inner class CheckRunnable: Runnable {
|
||||
var f: Long = 0
|
||||
val st = System.currentTimeMillis()
|
||||
|
||||
fun c(): Float {
|
||||
val ela = System.currentTimeMillis() - st
|
||||
return (ela / 1000.0f) - f
|
||||
}
|
||||
|
||||
override fun run() {
|
||||
while (!stopped) {
|
||||
synchronized(lock) {
|
||||
f++
|
||||
Thread.sleep(1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
20
src/main/kotlin/com/tencent/mobileqq/qsec/qsecurity/QSec.kt
Normal file
20
src/main/kotlin/com/tencent/mobileqq/qsec/qsecurity/QSec.kt
Normal file
@ -0,0 +1,20 @@
|
||||
package com.tencent.mobileqq.qsec.qsecurity
|
||||
|
||||
import com.github.unidbg.linux.android.dvm.DvmObject
|
||||
import com.github.unidbg.linux.android.dvm.array.ByteArray
|
||||
import moe.fuqiuluo.unidbg.QSecVM
|
||||
|
||||
object QSec {
|
||||
fun doSomething(vm: QSecVM, context: DvmObject<*>) {
|
||||
vm.newInstance("com/tencent/mobileqq/qsec/qsecurity/QSec", unique = true)
|
||||
.callJniMethodInt(vm.emulator, "doSomething(Landroid/content/Context;I)I", context, 1)
|
||||
}
|
||||
|
||||
fun getEst(vm: QSecVM): ByteArray? {
|
||||
val context = vm.newInstance("android/content/Context", unique = true)
|
||||
return vm.newInstance("com/tencent/mobileqq/qsec/qsecest/QsecEst", unique = true)
|
||||
.callJniMethodObject(
|
||||
vm.emulator, "d(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)[B",
|
||||
context, vm.envData.guid, "")
|
||||
}
|
||||
}
|
57
src/main/kotlin/com/tencent/mobileqq/sign/QQSecuritySign.kt
Normal file
57
src/main/kotlin/com/tencent/mobileqq/sign/QQSecuritySign.kt
Normal file
@ -0,0 +1,57 @@
|
||||
package com.tencent.mobileqq.sign
|
||||
|
||||
import com.github.unidbg.linux.android.dvm.BaseVM
|
||||
import com.github.unidbg.linux.android.dvm.DvmObject
|
||||
import moe.fuqiuluo.unidbg.QSecVM
|
||||
import moe.fuqiuluo.utils.BytesUtil
|
||||
import moe.fuqiuluo.utils.EMPTY_BYTE_ARRAY
|
||||
|
||||
object QQSecuritySign {
|
||||
data class SignResult(
|
||||
var sign: ByteArray = EMPTY_BYTE_ARRAY,
|
||||
var extra: ByteArray = EMPTY_BYTE_ARRAY,
|
||||
var token: ByteArray = EMPTY_BYTE_ARRAY
|
||||
)
|
||||
|
||||
class SignResultObject(vm: BaseVM, signResult: SignResult = SignResult()): DvmObject<SignResult>(vm.resolveClass("com/tencent/mobileqq/sign/QQSecuritySign\$SignResult"), signResult) {
|
||||
fun setToken(token: ByteArray) {
|
||||
value.token = token
|
||||
}
|
||||
|
||||
fun setSign(sign: ByteArray) {
|
||||
value.sign = sign
|
||||
}
|
||||
|
||||
fun setExtra(extra: ByteArray) {
|
||||
value.extra = extra
|
||||
}
|
||||
}
|
||||
|
||||
fun initSafeMode(vm: QSecVM, safe: Boolean) {
|
||||
vm.newInstance("com/tencent/mobileqq/sign/QQSecuritySign", unique = true)
|
||||
.callJniMethod(vm.emulator, "initSafeMode(Z)V", safe)
|
||||
}
|
||||
|
||||
fun dispatchEvent(vm: QSecVM, cmd: String = "", uin: String = "0") {
|
||||
runCatching {
|
||||
vm.newInstance("com/tencent/mobileqq/sign/QQSecuritySign", unique = true)
|
||||
.callJniMethod(vm.emulator, "dispatchEvent(Ljava/lang/String;Ljava/lang/String;Lcom/tencent/mobileqq/fe/EventCallback;)V",
|
||||
cmd, uin, vm.newInstance("com/tencent/mobileqq/fe/EventCallback", unique = true))
|
||||
}.onFailure {
|
||||
vm.newInstance("com/tencent/mobileqq/sign/QQSecuritySign", unique = true)
|
||||
.callJniMethod(vm.emulator, "dispatchEvent(Ljava/lang/String;Ljava/lang/String;)V", cmd, uin)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun requestToken(vm: QSecVM) {
|
||||
vm.newInstance("com/tencent/mobileqq/sign/QQSecuritySign", unique = true)
|
||||
.callJniMethod(vm.emulator, "requestToken()V")
|
||||
}
|
||||
|
||||
fun getSign(vm: QSecVM, qua: String, cmd: String, buffer: ByteArray, seq: Int, uin: String, qsec: DvmObject<*> = vm.newInstance("com/tencent/mobileqq/qsec/qsecurity/QSec", unique = true)): SignResultObject {
|
||||
return (vm.newInstance("com/tencent/mobileqq/sign/QQSecuritySign", unique = true)
|
||||
.callJniMethodObject(vm.emulator, "getSign(Lcom/tencent/mobileqq/qsec/qsecurity/QSec;Ljava/lang/String;Ljava/lang/String;[B[BLjava/lang/String;)Lcom/tencent/mobileqq/sign/QQSecuritySign\$SignResult;",
|
||||
qsec, qua, cmd, buffer, BytesUtil.int32ToBuf(seq), uin) as SignResultObject)
|
||||
}
|
||||
}
|
18
src/main/kotlin/com/tencent/secprotocol/ByteData.kt
Normal file
18
src/main/kotlin/com/tencent/secprotocol/ByteData.kt
Normal file
@ -0,0 +1,18 @@
|
||||
@file:Suppress("UNUSED_VARIABLE", "LocalVariableName")
|
||||
package com.tencent.secprotocol
|
||||
|
||||
import com.github.unidbg.linux.android.dvm.DvmObject
|
||||
import com.github.unidbg.linux.android.dvm.array.ArrayObject
|
||||
import moe.fuqiuluo.unidbg.QSecVM
|
||||
|
||||
object ByteData {
|
||||
fun getByte(vm: QSecVM, uin: String, data: String, salt: ByteArray, guid: String): ByteArray {
|
||||
val context = vm.newInstance("android/content/Context", unique = true)
|
||||
val method = "getByte(Landroid/content/Context;JJJJLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)[B"
|
||||
val ByteData = vm.newInstance("com/tencent/secprotocol/ByteData", unique = true)
|
||||
val obj = ArrayObject.newStringArray(vm.vm, *arrayOf("1", "1", uin, data, guid, "0", "", "init", vm.envData.packageName + ":MSF"))
|
||||
return ByteData.callJniMethodObject<DvmObject<*>>(vm.emulator, method,
|
||||
context, 1L, 0L, 0L, 0L, obj, "", uin, salt
|
||||
).value as ByteArray
|
||||
}
|
||||
}
|
227
src/main/kotlin/moe/fuqiuluo/api/energy.kt
Normal file
227
src/main/kotlin/moe/fuqiuluo/api/energy.kt
Normal file
@ -0,0 +1,227 @@
|
||||
package moe.fuqiuluo.api
|
||||
|
||||
import CONFIG
|
||||
import com.tencent.crypt.Crypt
|
||||
import com.tencent.mobileqq.qsec.qsecdandelionsdk.Dandelion
|
||||
import com.tencent.secprotocol.ByteData
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.server.routing.*
|
||||
import moe.fuqiuluo.comm.EnvData
|
||||
import moe.fuqiuluo.ext.failure
|
||||
import moe.fuqiuluo.ext.fetchGet
|
||||
import moe.fuqiuluo.ext.hex2ByteArray
|
||||
import moe.fuqiuluo.ext.toHexString
|
||||
import moe.fuqiuluo.unidbg.session.SessionManager
|
||||
import moe.fuqiuluo.utils.EMPTY_BYTE_ARRAY
|
||||
import moe.fuqiuluo.utils.MD5
|
||||
import java.nio.ByteBuffer
|
||||
|
||||
fun Routing.energy() {
|
||||
get("/custom_energy") {
|
||||
val uin = fetchGet("uin")!!.toLong()
|
||||
val data = fetchGet("data")!!
|
||||
val salt = fetchGet("salt")!!.hex2ByteArray()
|
||||
|
||||
val session = initSession(uin) ?: run {
|
||||
val androidId = fetchGet("android_id", def = "")
|
||||
val guid = fetchGet("guid", def = "")
|
||||
if (androidId.isNullOrEmpty() || guid.isNullOrEmpty()) {
|
||||
throw MissingKeyError
|
||||
}
|
||||
SessionManager.register(EnvData(uin, androidId, guid.lowercase(), "", CONFIG.protocol.qua, CONFIG.protocol.version, CONFIG.protocol.code))
|
||||
findSession(uin)
|
||||
}
|
||||
|
||||
val sign = session.withLock {
|
||||
Dandelion.energy(session.vm, data, salt)
|
||||
}
|
||||
call.respond(APIResult(0, "success", sign.toHexString()))
|
||||
}
|
||||
|
||||
get("/get_byte") {
|
||||
val uin = fetchGet("uin")!!.toLong()
|
||||
val guid = fetchGet("guid", err = "lack of guid") ?: return@get
|
||||
|
||||
val session = initSession(uin) ?: run {
|
||||
val androidId = fetchGet("android_id", def = "")
|
||||
if (androidId.isNullOrEmpty() || guid.isEmpty()) {
|
||||
throw MissingKeyError
|
||||
}
|
||||
SessionManager.register(EnvData(uin, androidId, guid.lowercase(), "", CONFIG.protocol.qua, CONFIG.protocol.version, CONFIG.protocol.code))
|
||||
findSession(uin)
|
||||
}
|
||||
|
||||
val data = fetchGet("data")!!
|
||||
if(!(data.startsWith("810_") || data.startsWith("812_"))) {
|
||||
failure(-2, "data参数不合法")
|
||||
}
|
||||
|
||||
val mode = fetchGet("mode", def = when(data) {
|
||||
"810_d", "810_a", "810_f", "810_9" -> "v2"
|
||||
"810_2", "810_25", "810_7", "810_24" -> "v1"
|
||||
"812_a" -> "v3"
|
||||
"812_5" -> "v4"
|
||||
else -> ""
|
||||
})?.also {
|
||||
if (it.isBlank()) failure(-3, "无法自动决断mode,请主动提供")
|
||||
}
|
||||
|
||||
val salt = when (mode) {
|
||||
"v1" -> {
|
||||
val version = fetchGet("version", err = "lack of version") ?: return@get
|
||||
val sub = data.substring(4).toInt(16)
|
||||
val guidBytes = guid.hex2ByteArray()
|
||||
val salt = ByteBuffer.allocate(8 + 2 + guidBytes.size + 2 + 10 + 4)
|
||||
salt.putLong(uin)
|
||||
salt.putShort(guidBytes.size.toShort())
|
||||
salt.put(guidBytes)
|
||||
salt.putShort(version.length.toShort())
|
||||
salt.put(version.toByteArray())
|
||||
salt.putInt(sub)
|
||||
salt.array()
|
||||
}
|
||||
"v2" -> {
|
||||
val version = fetchGet("version", err = "lack of version") ?: return@get
|
||||
val guidBytes = guid.hex2ByteArray()
|
||||
val sub = data.substring(4).toInt(16)
|
||||
val salt = ByteBuffer.allocate(4 + 2 + guidBytes.size + 2 + 10 + 4 + 4)
|
||||
salt.putInt(0)
|
||||
salt.putShort(guidBytes.size.toShort())
|
||||
salt.put(guidBytes)
|
||||
salt.putShort(version.length.toShort())
|
||||
salt.put(version.toByteArray())
|
||||
salt.putInt(sub)
|
||||
salt.putInt(0)
|
||||
salt.array()
|
||||
}
|
||||
"v3" -> { // 812_a
|
||||
val version = fetchGet("version", err = "lack of version") ?: return@get
|
||||
val phone = (fetchGet("phone", err = "lack of phone") ?: return@get).toByteArray() // 86-xxx
|
||||
val salt = ByteBuffer.allocate(phone.size + 2 + 2 + version.length + 2)
|
||||
salt.put(phone)
|
||||
salt.putShort(0)
|
||||
salt.putShort(version.length.toShort())
|
||||
salt.put(version.toByteArray())
|
||||
salt.putShort(0)
|
||||
salt.array()
|
||||
}
|
||||
"v4" -> { // 812_5
|
||||
val receipt = (fetchGet("receipt", err = "lack of receipt") ?: return@get).toByteArray()
|
||||
val code = fetchGet("code", err = "lack of code") ?: return@get
|
||||
val key = MD5.toMD5Byte(code)
|
||||
val encrypt = Crypt().encrypt(receipt, key)
|
||||
val salt = ByteBuffer.allocate(receipt.size + 2 + encrypt.size)
|
||||
salt.put(receipt)
|
||||
salt.putShort(encrypt.size.toShort())
|
||||
salt.put(encrypt)
|
||||
salt.array()
|
||||
}
|
||||
else -> {
|
||||
EMPTY_BYTE_ARRAY
|
||||
}
|
||||
}
|
||||
|
||||
val sign = session.withLock {
|
||||
ByteData.getByte(session.vm, uin.toString(), data, salt, guid)
|
||||
}
|
||||
|
||||
call.respond(APIResult(0, "success", sign.toHexString()))
|
||||
}
|
||||
|
||||
get("/energy") {
|
||||
val uin = fetchGet("uin")!!.toLong()
|
||||
val session = initSession(uin) ?: run {
|
||||
val androidId = fetchGet("android_id", def = "")
|
||||
val guid = fetchGet("guid", def = "")
|
||||
if (androidId.isNullOrEmpty() || guid.isNullOrEmpty()) {
|
||||
throw MissingKeyError
|
||||
}
|
||||
SessionManager.register(EnvData(uin, androidId, guid.lowercase(), "", CONFIG.protocol.qua, CONFIG.protocol.version, CONFIG.protocol.code))
|
||||
findSession(uin)
|
||||
}
|
||||
|
||||
val data = fetchGet("data")!!
|
||||
if(!(data.startsWith("810_") || data.startsWith("812_"))) {
|
||||
failure(-2, "data参数不合法")
|
||||
}
|
||||
|
||||
val mode = fetchGet("mode", def = when(data) {
|
||||
"810_d", "810_a", "810_f", "810_9" -> "v2"
|
||||
"810_2", "810_25", "810_7", "810_24" -> "v1"
|
||||
"812_a" -> "v3"
|
||||
"812_5" -> "v4"
|
||||
else -> ""
|
||||
})?.also {
|
||||
if (it.isBlank()) failure(-3, "无法自动决断mode,请主动提供")
|
||||
}
|
||||
|
||||
val salt = when (mode) {
|
||||
"v1" -> {
|
||||
val version = fetchGet("version", err = "lack of version") ?: return@get
|
||||
val guid = (fetchGet("guid", err = "lack of guid") ?: return@get).hex2ByteArray()
|
||||
val sub = data.substring(4).toInt(16)
|
||||
val salt = ByteBuffer.allocate(8 + 2 + guid.size + 2 + 10 + 4)
|
||||
salt.putLong(uin)
|
||||
salt.putShort(guid.size.toShort())
|
||||
salt.put(guid)
|
||||
salt.putShort(version.length.toShort())
|
||||
salt.put(version.toByteArray())
|
||||
salt.putInt(sub)
|
||||
salt.array()
|
||||
}
|
||||
"v2" -> {
|
||||
val version = fetchGet("version", err = "lack of version") ?: return@get
|
||||
val guid = (fetchGet("guid", err = "lack of guid") ?: return@get).hex2ByteArray()
|
||||
val sub = data.substring(4).toInt(16)
|
||||
val salt = ByteBuffer.allocate(4 + 2 + guid.size + 2 + 10 + 4 + 4)
|
||||
salt.putInt(0)
|
||||
salt.putShort(guid.size.toShort())
|
||||
salt.put(guid)
|
||||
salt.putShort(version.length.toShort())
|
||||
salt.put(version.toByteArray())
|
||||
salt.putInt(sub)
|
||||
salt.putInt(0)
|
||||
salt.array()
|
||||
}
|
||||
"v3" -> { // 812_a
|
||||
val version = fetchGet("version", err = "lack of version") ?: return@get
|
||||
val phone = (fetchGet("phone", err = "lack of phone") ?: return@get).toByteArray() // 86-xxx
|
||||
val salt = ByteBuffer.allocate(phone.size + 2 + 2 + version.length + 2)
|
||||
// 38 36 2D 31 37 33 36 30 32 32 39 31 37 32
|
||||
// 00 00
|
||||
// 00 06
|
||||
// 38 2E 39 2E 33 38
|
||||
// 00 00
|
||||
// result => 0C051B17347DF3B8EFDE849FC233C88DBEA23F5277099BB313A9CD000000004B744F7A00000000
|
||||
salt.put(phone)
|
||||
//println(String(phone))
|
||||
salt.putShort(0)
|
||||
salt.putShort(version.length.toShort())
|
||||
salt.put(version.toByteArray())
|
||||
salt.putShort(0)
|
||||
salt.array()
|
||||
}
|
||||
"v4" -> { // 812_5
|
||||
val receipt = (fetchGet("receipt", err = "lack of receipt") ?: return@get).toByteArray()
|
||||
val code = fetchGet("code", err = "lack of code") ?: return@get
|
||||
val key = MD5.toMD5Byte(code)
|
||||
val encrypt = Crypt().encrypt(receipt, key)
|
||||
val salt = ByteBuffer.allocate(receipt.size + 2 + encrypt.size)
|
||||
salt.put(receipt)
|
||||
salt.putShort(encrypt.size.toShort())
|
||||
salt.put(encrypt)
|
||||
salt.array()
|
||||
}
|
||||
else -> {
|
||||
EMPTY_BYTE_ARRAY
|
||||
}
|
||||
}
|
||||
|
||||
val sign = session.withLock {
|
||||
Dandelion.energy(session.vm, data, salt)
|
||||
}
|
||||
|
||||
call.respond(APIResult(0, "success", sign.toHexString()))
|
||||
}
|
||||
}
|
11
src/main/kotlin/moe/fuqiuluo/api/exceptions.kt
Normal file
11
src/main/kotlin/moe/fuqiuluo/api/exceptions.kt
Normal file
@ -0,0 +1,11 @@
|
||||
package moe.fuqiuluo.api
|
||||
|
||||
import java.lang.RuntimeException
|
||||
|
||||
object SessionNotFoundError: RuntimeException("Uin is not registered.")
|
||||
|
||||
object WrongKeyError: RuntimeException("Wrong API key.")
|
||||
|
||||
object MissingKeyError: RuntimeException("First use must be submitted with android_id and guid.")
|
||||
|
||||
object BlackListError: RuntimeException("Blacklist uin.")
|
33
src/main/kotlin/moe/fuqiuluo/api/main.kt
Normal file
33
src/main/kotlin/moe/fuqiuluo/api/main.kt
Normal file
@ -0,0 +1,33 @@
|
||||
package moe.fuqiuluo.api
|
||||
|
||||
import CONFIG
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.server.routing.*
|
||||
import kotlinx.serialization.Contextual
|
||||
import kotlinx.serialization.Serializable
|
||||
import moe.fuqiuluo.comm.Protocol
|
||||
import project.BuildConfig
|
||||
|
||||
@Serializable
|
||||
data class APIResult<T>(
|
||||
val code: Int,
|
||||
val msg: String = "",
|
||||
@Contextual
|
||||
val data: T? = null
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class APIInfo(
|
||||
val version: String,
|
||||
val protocol: Protocol
|
||||
)
|
||||
|
||||
fun Routing.index() {
|
||||
get("/") {
|
||||
call.respond(APIResult(0, "IAA 云天明 章北海", APIInfo(
|
||||
version = BuildConfig.version,
|
||||
protocol = CONFIG.protocol
|
||||
)))
|
||||
}
|
||||
}
|
113
src/main/kotlin/moe/fuqiuluo/api/qsign.kt
Normal file
113
src/main/kotlin/moe/fuqiuluo/api/qsign.kt
Normal file
@ -0,0 +1,113 @@
|
||||
@file:Suppress("UNCHECKED_CAST")
|
||||
|
||||
package moe.fuqiuluo.api
|
||||
|
||||
import CONFIG
|
||||
import com.tencent.mobileqq.channel.SsoPacket
|
||||
import com.tencent.mobileqq.qsec.qsecurity.QSec
|
||||
import com.tencent.mobileqq.sign.QQSecuritySign
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.request.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.server.routing.*
|
||||
import io.ktor.util.pipeline.*
|
||||
import kotlinx.serialization.Serializable
|
||||
import moe.fuqiuluo.comm.EnvData
|
||||
import moe.fuqiuluo.ext.*
|
||||
import moe.fuqiuluo.unidbg.session.SessionManager
|
||||
|
||||
fun Routing.sign() {
|
||||
get("/sign") {
|
||||
val uin = fetchGet("uin")!!
|
||||
val qua = fetchGet("qua", CONFIG.protocol.qua)!!
|
||||
val cmd = fetchGet("cmd")!!
|
||||
val seq = fetchGet("seq")!!.toInt()
|
||||
val buffer = fetchGet("buffer")!!.hex2ByteArray()
|
||||
val qimei36 = fetchGet("qimei36", def = "")!!
|
||||
|
||||
val androidId = fetchGet("android_id", def = "")!!
|
||||
val guid = fetchGet("guid", def = "")!!
|
||||
|
||||
requestSign(cmd, uin, qua, seq, buffer, qimei36, androidId, guid)
|
||||
}
|
||||
|
||||
post("/sign") {
|
||||
val param = call.receiveParameters()
|
||||
val uin = fetchPost(param, "uin")!!
|
||||
val qua = fetchPost(param, "qua", CONFIG.protocol.qua)!!
|
||||
val cmd = fetchPost(param, "cmd")!!
|
||||
val seq = fetchPost(param, "seq")!!.toInt()
|
||||
val buffer = fetchPost(param, "buffer")!!.hex2ByteArray()
|
||||
val qimei36 = fetchPost(param, "qimei36", def = "")!!
|
||||
|
||||
val androidId = param["android_id"] ?: ""
|
||||
val guid = param["guid"] ?: ""
|
||||
|
||||
requestSign(cmd, uin, qua, seq, buffer, qimei36, androidId, guid)
|
||||
}
|
||||
}
|
||||
|
||||
@Serializable
|
||||
private data class Sign(
|
||||
val token: String,
|
||||
val extra: String,
|
||||
val sign: String,
|
||||
val o3did: String,
|
||||
val requestCallback: List<SsoPacket>
|
||||
)
|
||||
|
||||
private suspend fun PipelineContext<Unit, ApplicationCall>.requestSign(
|
||||
cmd: String,
|
||||
uin: String,
|
||||
qua: String,
|
||||
seq: Int,
|
||||
buffer: ByteArray,
|
||||
qimei36: String,
|
||||
androidId: String,
|
||||
guid: String
|
||||
) {
|
||||
val session = initSession(uin.toLong()) ?: run {
|
||||
if (androidId.isNullOrEmpty() || guid.isNullOrEmpty()) {
|
||||
throw MissingKeyError
|
||||
}
|
||||
SessionManager.register(
|
||||
EnvData(
|
||||
uin.toLong(),
|
||||
androidId,
|
||||
guid.lowercase(),
|
||||
qimei36,
|
||||
qua,
|
||||
CONFIG.protocol.version,
|
||||
CONFIG.protocol.code
|
||||
)
|
||||
)
|
||||
findSession(uin.toLong())
|
||||
}
|
||||
val vm = session.vm
|
||||
if (qimei36.isNotEmpty()) {
|
||||
vm.global["qimei36"] = qimei36
|
||||
}
|
||||
|
||||
val list = arrayListOf<SsoPacket>()
|
||||
lateinit var o3did: String
|
||||
|
||||
val sign = session.withLock {
|
||||
vm.global["est_data"] = QSec.getEst(vm)
|
||||
QQSecuritySign.getSign(vm, qua, cmd, buffer, seq, uin).value.also {
|
||||
o3did = vm.global["o3did"] as? String ?: ""
|
||||
val requiredPacket = vm.global["PACKET"] as ArrayList<SsoPacket>
|
||||
list.addAll(requiredPacket)
|
||||
requiredPacket.clear()
|
||||
}
|
||||
}
|
||||
|
||||
call.respond(
|
||||
APIResult(
|
||||
0, "success", Sign(
|
||||
sign.token.toHexString(),
|
||||
sign.extra.toHexString(),
|
||||
sign.sign.toHexString(), o3did, list
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
53
src/main/kotlin/moe/fuqiuluo/api/register.kt
Normal file
53
src/main/kotlin/moe/fuqiuluo/api/register.kt
Normal file
@ -0,0 +1,53 @@
|
||||
package moe.fuqiuluo.api
|
||||
|
||||
import CONFIG
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.server.routing.*
|
||||
import moe.fuqiuluo.comm.EnvData
|
||||
import moe.fuqiuluo.ext.failure
|
||||
import moe.fuqiuluo.ext.fetchGet
|
||||
import moe.fuqiuluo.unidbg.session.SessionManager
|
||||
|
||||
fun Routing.register() {
|
||||
get("/register") {
|
||||
val uin = fetchGet("uin")!!.toLong()
|
||||
val androidId = fetchGet("android_id")!!
|
||||
val guid = fetchGet("guid")!!.lowercase()
|
||||
val qimei36 = fetchGet("qimei36")!!.lowercase()
|
||||
|
||||
val key = fetchGet("key")!!
|
||||
|
||||
val qua = fetchGet("qua", CONFIG.protocol.qua)!!
|
||||
val version = fetchGet("version", CONFIG.protocol.version)!!
|
||||
val code = fetchGet("code", CONFIG.protocol.code)!!
|
||||
|
||||
val hasRegister = uin in SessionManager
|
||||
if (key == CONFIG.key) {
|
||||
SessionManager.register(EnvData(uin, androidId, guid, qimei36, qua, version, code))
|
||||
if (hasRegister) {
|
||||
call.respond(APIResult(0, "The QQ has already loaded an instance, so this time it is deleting the existing instance and creating a new one.", ""))
|
||||
} else {
|
||||
call.respond(APIResult(0, "Instance loaded successfully.", ""))
|
||||
}
|
||||
} else {
|
||||
throw WrongKeyError
|
||||
}
|
||||
}
|
||||
|
||||
get("/destroy") {
|
||||
val uin = fetchGet("uin")!!.toLong()
|
||||
val key = fetchGet("key")!!
|
||||
|
||||
if (key == CONFIG.key) {
|
||||
if(uin in SessionManager){
|
||||
SessionManager.close(uin)
|
||||
call.respond(APIResult(0, "Instance destroyed successfully.", ""))
|
||||
} else {
|
||||
failure(1, "Instance does not exist.")
|
||||
}
|
||||
} else {
|
||||
throw WrongKeyError
|
||||
}
|
||||
}
|
||||
}
|
47
src/main/kotlin/moe/fuqiuluo/api/request_token.kt
Normal file
47
src/main/kotlin/moe/fuqiuluo/api/request_token.kt
Normal file
@ -0,0 +1,47 @@
|
||||
@file:Suppress("UNCHECKED_CAST")
|
||||
package moe.fuqiuluo.api
|
||||
|
||||
import com.tencent.mobileqq.channel.SsoPacket
|
||||
import com.tencent.mobileqq.sign.QQSecuritySign
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.server.routing.*
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
import kotlinx.coroutines.withTimeout
|
||||
import kotlinx.coroutines.withTimeoutOrNull
|
||||
import moe.fuqiuluo.ext.fetchGet
|
||||
import kotlin.concurrent.timer
|
||||
|
||||
fun Routing.requestToken() {
|
||||
get("/request_token") {
|
||||
val uin = fetchGet("uin")!!.toLong()
|
||||
val session = findSession(uin)
|
||||
|
||||
val vm = session.vm
|
||||
|
||||
if ("HAS_SUBMIT" !in vm.global) {
|
||||
call.respond(APIResult(-1, "QSign not initialized, unable to request_token, please submit the initialization package first.", ""))
|
||||
} else {
|
||||
var isSuccessful = true
|
||||
val list = arrayListOf<SsoPacket>()
|
||||
session.withLock {
|
||||
val lock = vm.global["mutex"] as Mutex
|
||||
lock.tryLock()
|
||||
QQSecuritySign.requestToken(vm)
|
||||
|
||||
withTimeoutOrNull(5000) {
|
||||
lock.withLock {
|
||||
val requiredPacket = vm.global["PACKET"] as ArrayList<SsoPacket>
|
||||
list.addAll(requiredPacket)
|
||||
requiredPacket.clear()
|
||||
}
|
||||
} ?: {
|
||||
isSuccessful = false
|
||||
}
|
||||
}
|
||||
|
||||
call.respond(APIResult(if (!isSuccessful) -1 else 0, if (!isSuccessful) "request_token timeout" else "submit success", list))
|
||||
}
|
||||
}
|
||||
}
|
50
src/main/kotlin/moe/fuqiuluo/api/session.kt
Normal file
50
src/main/kotlin/moe/fuqiuluo/api/session.kt
Normal file
@ -0,0 +1,50 @@
|
||||
package moe.fuqiuluo.api
|
||||
|
||||
import CONFIG
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
import moe.fuqiuluo.unidbg.session.Session
|
||||
import moe.fuqiuluo.unidbg.session.SessionManager
|
||||
import kotlin.concurrent.timer
|
||||
import kotlin.contracts.ExperimentalContracts
|
||||
import kotlin.contracts.InvocationKind
|
||||
import kotlin.contracts.contract
|
||||
|
||||
fun initSession(uin: Long): Session? {
|
||||
return SessionManager[uin] ?: if (!CONFIG.autoRegister) {
|
||||
throw SessionNotFoundError
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
fun findSession(uin: Long): Session {
|
||||
return SessionManager[uin] ?: throw SessionNotFoundError
|
||||
}
|
||||
|
||||
internal suspend inline fun <T> Session.withLock(action: () -> T): T {
|
||||
return mutex.withLockAndTimeout(5000, action)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
private suspend inline fun <T> Mutex.withLockAndTimeout(timeout: Long, action: () -> T): T {
|
||||
contract {
|
||||
callsInPlace(action, InvocationKind.EXACTLY_ONCE)
|
||||
}
|
||||
|
||||
lock()
|
||||
val job = timer(initialDelay = timeout, period = timeout) {
|
||||
if (isLocked)
|
||||
unlock()
|
||||
}
|
||||
try {
|
||||
return action().also {
|
||||
job.cancel()
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
unlock()
|
||||
} catch (e: java.lang.Exception) {}
|
||||
}
|
||||
}
|
27
src/main/kotlin/moe/fuqiuluo/api/submit.kt
Normal file
27
src/main/kotlin/moe/fuqiuluo/api/submit.kt
Normal file
@ -0,0 +1,27 @@
|
||||
package moe.fuqiuluo.api
|
||||
|
||||
import com.tencent.mobileqq.channel.ChannelManager
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.server.routing.*
|
||||
import moe.fuqiuluo.ext.fetchGet
|
||||
import moe.fuqiuluo.ext.hex2ByteArray
|
||||
|
||||
|
||||
fun Routing.submit() {
|
||||
get("/submit") {
|
||||
val uin = fetchGet("uin")!!.toLong()
|
||||
val cmd = fetchGet("cmd")!!
|
||||
val callbackId = fetchGet("callback_id")!!.toLong()
|
||||
val buffer = fetchGet("buffer")!!.hex2ByteArray()
|
||||
|
||||
val session = findSession(uin)
|
||||
|
||||
session.withLock {
|
||||
ChannelManager.onNativeReceive(session.vm, cmd, buffer, callbackId)
|
||||
session.vm.global["HAS_SUBMIT"] = true
|
||||
}
|
||||
|
||||
call.respond(APIResult(0, "submit success", ""))
|
||||
}
|
||||
}
|
40
src/main/kotlin/moe/fuqiuluo/comm/ArgsParser.kt
Normal file
40
src/main/kotlin/moe/fuqiuluo/comm/ArgsParser.kt
Normal file
@ -0,0 +1,40 @@
|
||||
package moe.fuqiuluo.comm
|
||||
|
||||
import moe.fuqiuluo.ext.*
|
||||
|
||||
class ArgsParser(
|
||||
args: StringArray
|
||||
) {
|
||||
private val map = hashMapOf<String, String>()
|
||||
|
||||
init {
|
||||
args.forEach {
|
||||
it.substring(if (it.startsWith("--")) 2
|
||||
else if (it.startsWith("-")) 1
|
||||
else error("Not support the expr.")).split("=").also {
|
||||
map[it[0]] = it.slice(1 until it.size).joinToString("")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
operator fun get(key: String): String? {
|
||||
return map[key]
|
||||
}
|
||||
|
||||
fun getOrDefault(key: String, def: String?): String? {
|
||||
return get(key) ?: def
|
||||
}
|
||||
|
||||
operator fun get(key: String, err: String): String {
|
||||
require(key in this) { err }
|
||||
return this[key]!!
|
||||
}
|
||||
|
||||
operator fun contains(key: String): Boolean {
|
||||
return key in map
|
||||
}
|
||||
}
|
||||
|
||||
operator fun StringArray.invoke(): ArgsParser {
|
||||
return ArgsParser(this)
|
||||
}
|
63
src/main/kotlin/moe/fuqiuluo/comm/QSignConfig.kt
Normal file
63
src/main/kotlin/moe/fuqiuluo/comm/QSignConfig.kt
Normal file
@ -0,0 +1,63 @@
|
||||
@file:OptIn(ExperimentalSerializationApi::class)
|
||||
package moe.fuqiuluo.comm
|
||||
|
||||
import CONFIG
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.JsonNames
|
||||
|
||||
@Serializable
|
||||
data class Server(
|
||||
var host: String,
|
||||
var port: Int
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class EnvData(
|
||||
var uin: Long,
|
||||
@JsonNames("androidId", "android_id", "imei")
|
||||
var androidId: String,
|
||||
var guid: String,
|
||||
var qimei36: String,
|
||||
|
||||
var qua: String = CONFIG.protocol.qua,
|
||||
var version: String = CONFIG.protocol.version,
|
||||
var code: String = CONFIG.protocol.code,
|
||||
var packageName: String = CONFIG.protocol.packageName ?: "com.tencent.mobileqq",
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class Protocol(
|
||||
var qua: String,
|
||||
var version: String,
|
||||
var code: String,
|
||||
@SerialName("package_name")
|
||||
var packageName: String? = null,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class UnidbgConfig(
|
||||
var dynarmic: Boolean,
|
||||
var unicorn: Boolean,
|
||||
var debug: Boolean,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class QSignConfig(
|
||||
var server: Server,
|
||||
var key: String,
|
||||
@JsonNames("autoRegister", "auto_register")
|
||||
var autoRegister:Boolean,
|
||||
//@JsonNames("reloadInterval", "reload_interval")
|
||||
//var reloadInterval: Int,
|
||||
var protocol: Protocol,
|
||||
var unidbg: UnidbgConfig,
|
||||
@JsonNames("blackList", "black_list")
|
||||
var blackList: List<Long>? = null
|
||||
)
|
||||
|
||||
fun QSignConfig.checkIllegal() {
|
||||
require(server.port in 1 .. 65535) { "Port is out of range." }
|
||||
//require(reloadInterval in 20 .. 50) { "ReloadInterval is out of range." }
|
||||
}
|
40
src/main/kotlin/moe/fuqiuluo/ext/ByteArray.kt
Normal file
40
src/main/kotlin/moe/fuqiuluo/ext/ByteArray.kt
Normal file
@ -0,0 +1,40 @@
|
||||
package moe.fuqiuluo.ext
|
||||
|
||||
import moe.fuqiuluo.utils.BytesUtil
|
||||
import java.util.*
|
||||
import kotlin.experimental.xor
|
||||
|
||||
@JvmOverloads fun String.hex2ByteArray(replace: Boolean = false): ByteArray {
|
||||
val s = if (replace) this.replace(" ", "")
|
||||
.replace("\n", "")
|
||||
.replace("\t", "")
|
||||
.replace("\r", "") else this
|
||||
val bs = ByteArray(s.length / 2)
|
||||
for (i in 0 until s.length / 2) {
|
||||
bs[i] = s.substring(i * 2, i * 2 + 2).toInt(16).toByte()
|
||||
}
|
||||
return bs
|
||||
}
|
||||
|
||||
@JvmOverloads fun ByteArray.toHexString(uppercase: Boolean = true): String = this.joinToString("") {
|
||||
(it.toInt() and 0xFF).toString(16)
|
||||
.padStart(2, '0')
|
||||
.let { s -> if (uppercase) s.lowercase(Locale.getDefault()) else s }
|
||||
}
|
||||
|
||||
fun ByteArray.xor(key: ByteArray): ByteArray {
|
||||
val result = ByteArray(this.size)
|
||||
for (i in 0 until this.size) {
|
||||
result[i] = (this[i] xor key[i % key.size] xor ((i and 0xFF).toByte()))
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
fun ByteArray.sub(offset: Int, length: Int) = BytesUtil.subByte(this, offset, length)
|
||||
|
||||
fun ByteArray.toAsciiHexString() = joinToString("") {
|
||||
if (it in 32..127) it.toInt().toChar().toString() else "{${
|
||||
it.toUByte().toString(16).padStart(2, '0').uppercase(
|
||||
Locale.getDefault())
|
||||
}}"
|
||||
}
|
103
src/main/kotlin/moe/fuqiuluo/ext/BytePacket.kt
Normal file
103
src/main/kotlin/moe/fuqiuluo/ext/BytePacket.kt
Normal file
@ -0,0 +1,103 @@
|
||||
package moe.fuqiuluo.ext
|
||||
|
||||
import com.tencent.crypt.Crypt
|
||||
import io.ktor.utils.io.core.*
|
||||
import moe.fuqiuluo.utils.BytesUtil
|
||||
import kotlin.text.Charsets.UTF_8
|
||||
import kotlin.text.toByteArray
|
||||
|
||||
inline fun newBuilder() = BytePacketBuilder()
|
||||
|
||||
fun BytePacketBuilder.writeBytes(bytes: ByteArray) = this.writeFully(bytes)
|
||||
|
||||
fun BytePacketBuilder.toByteArray(): ByteArray = use { it.build().readBytes() }
|
||||
|
||||
fun ByteReadPacket.toByteArray(): ByteArray = use { it.readBytes() }
|
||||
|
||||
/**
|
||||
* 补充功能代码
|
||||
* @receiver BytePacketBuilder
|
||||
* @param packet BytePacketBuilder
|
||||
*/
|
||||
fun BytePacketBuilder.writePacket(packet: BytePacketBuilder) = this.writePacket(packet.build())
|
||||
|
||||
/**
|
||||
* 写布尔型
|
||||
* @receiver BytePacketBuilder
|
||||
* @param z Boolean
|
||||
*/
|
||||
fun BytePacketBuilder.writeBoolean(z: Boolean) = this.writeByte(if (z) 1 else 0)
|
||||
|
||||
/**
|
||||
* 自动转换类型
|
||||
* @receiver BytePacketBuilder
|
||||
* @param i Int
|
||||
*/
|
||||
fun BytePacketBuilder.writeShort(i: Int) = this.writeShort(i.toShort())
|
||||
|
||||
fun BytePacketBuilder.writeLongToBuf32(v: Long) {
|
||||
this.writeBytes(BytesUtil.int64ToBuf32(v))
|
||||
}
|
||||
|
||||
fun BytePacketBuilder.writeStringWithIntLen(str: String) {
|
||||
writeBytesWithIntLen(str.toByteArray())
|
||||
}
|
||||
|
||||
fun BytePacketBuilder.writeStringWithShortLen(str: String) {
|
||||
writeBytesWithShortLen(str.toByteArray())
|
||||
}
|
||||
|
||||
fun BytePacketBuilder.writeBytesWithIntLen(bytes: ByteArray) {
|
||||
writeInt(bytes.size)
|
||||
writeBytes(bytes)
|
||||
}
|
||||
|
||||
fun BytePacketBuilder.writeBytesWithShortLen(bytes: ByteArray) {
|
||||
check(bytes.size <= Short.MAX_VALUE) { "byteArray length is too long" }
|
||||
writeShort(bytes.size.toShort())
|
||||
writeBytes(bytes)
|
||||
}
|
||||
|
||||
inline fun BytePacketBuilder.writeBlockWithIntLen(len : (Int) -> Int = { it }, block: BytePacketBuilder.() -> Unit) {
|
||||
val builder = newBuilder()
|
||||
builder.block()
|
||||
this.writeInt(len(builder.size))
|
||||
this.writePacket(builder)
|
||||
builder.close()
|
||||
}
|
||||
|
||||
inline fun BytePacketBuilder.writeBlockWithShortLen(len : (Int) -> Int = { it }, block: BytePacketBuilder.() -> Unit) {
|
||||
val builder = newBuilder()
|
||||
builder.block()
|
||||
this.writeShort(len(builder.size))
|
||||
this.writePacket(builder)
|
||||
builder.close()
|
||||
}
|
||||
|
||||
|
||||
inline fun BytePacketBuilder.writeTeaEncrypt(key: ByteArray, block: BytePacketBuilder.() -> Unit) {
|
||||
val body = newBuilder()
|
||||
body.block()
|
||||
this.writeBytes(Crypt().encrypt(body.toByteArray(), key))
|
||||
body.close()
|
||||
}
|
||||
|
||||
fun BytePacketBuilder.writeString(str: String) {
|
||||
this.writeBytes(str.toByteArray(UTF_8))
|
||||
}
|
||||
|
||||
fun BytePacketBuilder.writeHex(uHex: String) {
|
||||
writeBytes(uHex.hex2ByteArray())
|
||||
}
|
||||
|
||||
fun ByteReadPacket.readString(length: Int) = readBytes(length).decodeToString()
|
||||
|
||||
fun ByteArray.toByteReadPacket() = ByteReadPacket(this)
|
||||
|
||||
inline fun ByteArray.reader(block: ByteReadPacket.() -> Unit) {
|
||||
this.toByteReadPacket().use(block)
|
||||
}
|
||||
|
||||
fun ByteReadPacket.readByteReadPacket(length: Int): ByteReadPacket {
|
||||
return readBytes(length).toByteReadPacket()
|
||||
}
|
27
src/main/kotlin/moe/fuqiuluo/ext/Ktor.kt
Normal file
27
src/main/kotlin/moe/fuqiuluo/ext/Ktor.kt
Normal file
@ -0,0 +1,27 @@
|
||||
package moe.fuqiuluo.ext
|
||||
|
||||
import io.ktor.http.*
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.util.pipeline.*
|
||||
import moe.fuqiuluo.api.APIResult
|
||||
|
||||
suspend fun PipelineContext<Unit, ApplicationCall>.fetchGet(key: String, def: String? = null, err: String? = "Parameter '$key' is missing."): String? {
|
||||
val data = call.parameters[key] ?: def
|
||||
if (data == null && err != null) {
|
||||
failure(1, err)
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
suspend fun PipelineContext<Unit, ApplicationCall>.fetchPost(params: Parameters, key: String, def: String? = null, err: String? = "Parameter '$key' is missing."): String? {
|
||||
val data = params[key] ?: def
|
||||
if (data == null && err != null) {
|
||||
failure(1, err)
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
suspend fun PipelineContext<Unit, ApplicationCall>.failure(code: Int, msg: String) {
|
||||
call.respond(APIResult(code, msg, "failed"))
|
||||
}
|
7
src/main/kotlin/moe/fuqiuluo/ext/Numbers.kt
Normal file
7
src/main/kotlin/moe/fuqiuluo/ext/Numbers.kt
Normal file
@ -0,0 +1,7 @@
|
||||
package moe.fuqiuluo.ext
|
||||
|
||||
fun String.toInt(range: IntRange, lazyMessage: () -> Any = { "Failed requirement." }): Int {
|
||||
val i = toInt()
|
||||
require(i in range, lazyMessage)
|
||||
return i
|
||||
}
|
3
src/main/kotlin/moe/fuqiuluo/ext/Types.kt
Normal file
3
src/main/kotlin/moe/fuqiuluo/ext/Types.kt
Normal file
@ -0,0 +1,3 @@
|
||||
package moe.fuqiuluo.ext
|
||||
|
||||
typealias StringArray = Array<String>
|
8
src/main/kotlin/moe/fuqiuluo/ext/Unidbg.kt
Normal file
8
src/main/kotlin/moe/fuqiuluo/ext/Unidbg.kt
Normal file
@ -0,0 +1,8 @@
|
||||
package moe.fuqiuluo.ext
|
||||
|
||||
import com.github.unidbg.linux.android.dvm.BaseVM
|
||||
import com.github.unidbg.linux.android.dvm.DvmObject
|
||||
|
||||
fun BaseVM.newInstance(className: String, arg: Any? = null): DvmObject<*> {
|
||||
return resolveClass(className).newObject(arg)
|
||||
}
|
142
src/main/kotlin/moe/fuqiuluo/unidbg/QSecVm.kt
Normal file
142
src/main/kotlin/moe/fuqiuluo/unidbg/QSecVm.kt
Normal file
@ -0,0 +1,142 @@
|
||||
package moe.fuqiuluo.unidbg
|
||||
|
||||
import com.github.unidbg.Emulator
|
||||
import com.github.unidbg.arm.Arm64Hook
|
||||
import com.github.unidbg.arm.HookStatus
|
||||
import com.github.unidbg.arm.context.RegisterContext
|
||||
import com.github.unidbg.hook.HookListener
|
||||
import com.github.unidbg.linux.android.dvm.DvmObject
|
||||
import com.github.unidbg.memory.SvcMemory
|
||||
import com.tencent.mobileqq.qsec.qsecurity.DeepSleepDetector
|
||||
import moe.fuqiuluo.comm.EnvData
|
||||
import moe.fuqiuluo.unidbg.env.FileResolver
|
||||
import moe.fuqiuluo.unidbg.env.QSecJni
|
||||
import moe.fuqiuluo.unidbg.vm.AndroidVM
|
||||
import moe.fuqiuluo.unidbg.vm.GlobalData
|
||||
import java.io.File
|
||||
import javax.security.auth.Destroyable
|
||||
import kotlin.system.exitProcess
|
||||
|
||||
class QSecVM(
|
||||
val coreLibPath: File,
|
||||
val envData: EnvData,
|
||||
dynarmic: Boolean,
|
||||
unicorn: Boolean
|
||||
): Destroyable, AndroidVM(envData.packageName, dynarmic, unicorn) {
|
||||
private var destroy: Boolean = false
|
||||
private var isInit: Boolean = false
|
||||
internal val global = GlobalData()
|
||||
|
||||
init {
|
||||
runCatching {
|
||||
val resolver = FileResolver(23, this@QSecVM)
|
||||
memory.setLibraryResolver(resolver)
|
||||
memory.addHookListener(object : HookListener {
|
||||
override fun hook(svcMemory: SvcMemory, p1: String?, p2: String?, p3: Long): Long {
|
||||
if(p2 == "memcmp"){
|
||||
return svcMemory.registerSvc(object : Arm64Hook() {
|
||||
override fun hook(emulator: Emulator<*>): HookStatus {
|
||||
val context = emulator.getContext<RegisterContext>()
|
||||
try {
|
||||
val arg1 = context.getLongArg(0)
|
||||
val arg2 = context.getLongArg(1)
|
||||
if(arg1>0x100000000 || arg2>0x100000000){
|
||||
return HookStatus.LR(emulator, -1)
|
||||
}
|
||||
} catch (ignored: Exception) {
|
||||
}
|
||||
return HookStatus.RET(emulator, p3)
|
||||
}
|
||||
}).peer
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
})
|
||||
|
||||
emulator.syscallHandler.addIOResolver(resolver)
|
||||
vm.setJni(QSecJni(envData, this, global))
|
||||
|
||||
if (envData.packageName == "com.tencent.mobileqq") {
|
||||
println("QSign-Unidbg 白名单模式")
|
||||
arrayOf(
|
||||
"android/os/Build\$VERSION",
|
||||
"android/content/pm/ApplicationInfo",
|
||||
"com/tencent/mobileqq/fe/IFEKitLog",
|
||||
"com/tencent/mobileqq/channel/ChannelProxy",
|
||||
"com/tencent/mobileqq/qsec/qsecurity/QSec",
|
||||
"com/tencent/mobileqq/qsec/qsecurity/QSecConfig",
|
||||
"com/tencent/mobileqq/sign/QQSecuritySign\$SignResult",
|
||||
"java/lang/String",
|
||||
"com/tencent/mobileqq/qsec/qsecest/QsecEst",
|
||||
"com/tencent/qqprotect/qsec/QSecFramework",
|
||||
"com/tencent/mobileqq/dt/app/Dtc",
|
||||
"android/provider/Settings\$System",
|
||||
"com/tencent/mobileqq/fe/utils/DeepSleepDetector",
|
||||
"com/tencent/mobileqq/dt/model/FEBound",
|
||||
"java/lang/ClassLoader",
|
||||
"java/lang/Thread",
|
||||
"android/content/Context",
|
||||
"android/content/ContentResolver",
|
||||
"java/io/File",
|
||||
"java/lang/Integer",
|
||||
"java/lang/Object",
|
||||
"java/util/ArrayList",
|
||||
"android/os/Process",
|
||||
"com/tencent/mobileqq/sign/QQSecuritySign",
|
||||
"com/tencent/mobileqq/channel/ChannelManager",
|
||||
"com/tencent/mobileqq/dt/Dtn",
|
||||
"com/tencent/mobileqq/qsec/qsecdandelionsdk/Dandelion",
|
||||
"com/tencent/mobileqq/qsec/qsecprotocol/ByteData",
|
||||
"com/tencent/mobileqq/qsec/qseccodec/SecCipher",
|
||||
"dalvik/system/BaseDexClassLoader",
|
||||
"android/content/pm/IPackageManager\$Stub",
|
||||
"android/os/ServiceManager",
|
||||
"android/os/IBinder"
|
||||
).forEach {
|
||||
vm.addFilterFoundClass(it)
|
||||
}
|
||||
} else {
|
||||
vm.addNotFoundClass("com/tencent/mobileqq/dt/Dc")
|
||||
vm.addNotFoundClass("com/tencent/mobileqq/dt/Dte")
|
||||
}
|
||||
}.onFailure {
|
||||
it.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
fun init() {
|
||||
if (isInit) return
|
||||
runCatching {
|
||||
coreLibPath.resolve("libpoxy.so").let {
|
||||
if (it.exists()) {
|
||||
loadLibrary(it)
|
||||
}
|
||||
}
|
||||
loadLibrary(coreLibPath.resolve("libfekit.so"))
|
||||
global["DeepSleepDetector"] = DeepSleepDetector()
|
||||
this.isInit = true
|
||||
}.onFailure {
|
||||
it.printStackTrace()
|
||||
exitProcess(1)
|
||||
}
|
||||
}
|
||||
|
||||
fun newInstance(name: String, value: Any? = null, unique: Boolean = false): DvmObject<*> {
|
||||
if (unique && name in global) {
|
||||
return global[name] as DvmObject<*>
|
||||
}
|
||||
val obj = findClass(name).newObject(value)
|
||||
if (unique) {
|
||||
global[name] = obj
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
override fun isDestroyed(): Boolean = destroy
|
||||
|
||||
override fun destroy() {
|
||||
if (isDestroyed) return
|
||||
this.destroy = true
|
||||
this.close()
|
||||
}
|
||||
}
|
229
src/main/kotlin/moe/fuqiuluo/unidbg/env/FileResolver.kt
vendored
Normal file
229
src/main/kotlin/moe/fuqiuluo/unidbg/env/FileResolver.kt
vendored
Normal file
@ -0,0 +1,229 @@
|
||||
package moe.fuqiuluo.unidbg.env
|
||||
|
||||
import CONFIG
|
||||
import com.github.unidbg.Emulator
|
||||
import com.github.unidbg.file.FileResult
|
||||
import com.github.unidbg.file.linux.AndroidFileIO
|
||||
import com.github.unidbg.linux.android.AndroidResolver
|
||||
import com.github.unidbg.linux.file.ByteArrayFileIO
|
||||
import com.github.unidbg.linux.file.DirectoryFileIO
|
||||
import com.github.unidbg.linux.file.SimpleFileIO
|
||||
import com.github.unidbg.unix.UnixEmulator
|
||||
import io.ktor.server.config.*
|
||||
import moe.fuqiuluo.ext.hex2ByteArray
|
||||
import moe.fuqiuluo.unidbg.QSecVM
|
||||
import moe.fuqiuluo.unidbg.env.files.fetchCpuInfo
|
||||
import moe.fuqiuluo.unidbg.env.files.fetchMemInfo
|
||||
import moe.fuqiuluo.unidbg.env.files.fetchStat
|
||||
import moe.fuqiuluo.unidbg.env.files.fetchStatus
|
||||
import java.io.File
|
||||
import java.util.UUID
|
||||
import java.util.logging.Logger
|
||||
|
||||
class FileResolver(
|
||||
sdk: Int,
|
||||
val vm: QSecVM
|
||||
): AndroidResolver(sdk) {
|
||||
private val tmpFilePath = vm.coreLibPath
|
||||
private val uuid = UUID.randomUUID()
|
||||
|
||||
init {
|
||||
for (s in arrayOf("stdin", "stdout", "stderr")) {
|
||||
tmpFilePath.resolve(s).also {
|
||||
if (it.exists()) it.delete()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun resolve(emulator: Emulator<AndroidFileIO>, path: String, oflags: Int): FileResult<AndroidFileIO>? {
|
||||
val result = super.resolve(emulator, path, oflags)
|
||||
if (result == null || !result.isSuccess) {
|
||||
return this.resolve(emulator, path, oflags, result)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
private fun resolve(emulator: Emulator<AndroidFileIO>, path: String, oflags: Int, def: FileResult<AndroidFileIO>?): FileResult<AndroidFileIO>? {
|
||||
if (path == "stdin" || path == "stdout" || path == "stderr") {
|
||||
return FileResult.success(SimpleFileIO(oflags, tmpFilePath.resolve(path).also {
|
||||
if (!it.exists()) it.createNewFile()
|
||||
}, path))
|
||||
}
|
||||
|
||||
if (path == "/data/data/com.tencent.tim/lib/libwtecdh.so") {
|
||||
return FileResult.failed(UnixEmulator.ENOENT)
|
||||
}
|
||||
|
||||
|
||||
if (path == "/proc/sys/kernel/random/boot_id") {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, uuid.toString().toByteArray()))
|
||||
}
|
||||
if (path == "/proc/self/status") {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, fetchStatus(emulator.pid).toByteArray()))
|
||||
}
|
||||
if (path == "/proc/stat") {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, fetchStat()))
|
||||
}
|
||||
if (path == "/proc/meminfo") {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, fetchMemInfo()))
|
||||
}
|
||||
if (path == "/proc/cpuinfo") {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, fetchCpuInfo()))
|
||||
}
|
||||
if (path == "/dev/__properties__") {
|
||||
return FileResult.success(DirectoryFileIO(oflags, path,
|
||||
DirectoryFileIO.DirectoryEntry(true, "properties_serial"),
|
||||
))
|
||||
}
|
||||
|
||||
if ("/proc/self/maps" == path) {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, byteArrayOf()))
|
||||
}
|
||||
|
||||
if (path == "/system/lib") {
|
||||
return FileResult.success(DirectoryFileIO(oflags, path,
|
||||
DirectoryFileIO.DirectoryEntry(true, "libhwui.so"),
|
||||
))
|
||||
}
|
||||
|
||||
if (path == "/data/data/${vm.envData.packageName}") {
|
||||
return FileResult.success(DirectoryFileIO(oflags, path,
|
||||
DirectoryFileIO.DirectoryEntry(false, "files"),
|
||||
DirectoryFileIO.DirectoryEntry(false, "shared_prefs"),
|
||||
DirectoryFileIO.DirectoryEntry(false, "cache"),
|
||||
DirectoryFileIO.DirectoryEntry(false, "code_cache"),
|
||||
))
|
||||
}
|
||||
|
||||
if (path == "/dev/urandom" ||
|
||||
path == "/data/local/su" ||
|
||||
path == "/data/local/bin/su" ||
|
||||
path == "/data/local/xbin/su" ||
|
||||
path == "/sbin/su" ||
|
||||
path == "/su/bin/su" ||
|
||||
path == "/system/bin/su" ||
|
||||
path == "/system/bin/.ext/su" ||
|
||||
path == "/system/bin/failsafe/su" ||
|
||||
path == "/system/sd/xbin/su" ||
|
||||
path == "/system/usr/we-need-root/su" ||
|
||||
path == "/system/xbin/su" ||
|
||||
path == "/cache/su" ||
|
||||
path == "/data/su" ||
|
||||
path == "/dev/su" || path.contains("busybox") || path.contains("magisk")
|
||||
) {
|
||||
return FileResult.failed(UnixEmulator.ENOENT)
|
||||
}
|
||||
|
||||
if (path == "/sdcard/Android/") {
|
||||
return FileResult.success(DirectoryFileIO(oflags, path,
|
||||
DirectoryFileIO.DirectoryEntry(false, "data"),
|
||||
DirectoryFileIO.DirectoryEntry(false, "obb"),
|
||||
))
|
||||
}
|
||||
|
||||
if (path == "/system/lib64/libhoudini.so" || path == "/system/lib/libhoudini.so") {
|
||||
return FileResult.failed(UnixEmulator.ENOENT)
|
||||
}
|
||||
|
||||
if (path == "/proc/self/cmdline"
|
||||
|| path == "/proc/${emulator.pid}/cmdline"
|
||||
|| path == "/proc/stat/cmdline" // an error case
|
||||
) {
|
||||
if (vm.envData.packageName == "com.tencent.tim") {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, vm.envData.packageName.toByteArray()))
|
||||
} else {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, "${vm.envData.packageName}:MSF".toByteArray()))
|
||||
}
|
||||
}
|
||||
|
||||
if (path == "/data/data") {
|
||||
return FileResult.failed(UnixEmulator.EACCES)
|
||||
}
|
||||
|
||||
if (path.contains("star_est.xml")) {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, """
|
||||
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
|
||||
<map>
|
||||
<string name="id">NS23gm77vjYiyYK554L4aY0SYG5Xgjje</string>
|
||||
</map>
|
||||
""".trimIndent().toByteArray()))
|
||||
}
|
||||
|
||||
if (path == "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq") {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, "1804800".toByteArray()))
|
||||
}
|
||||
|
||||
if (path == "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq") {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, "300000".toByteArray()))
|
||||
}
|
||||
|
||||
if (path == "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq") {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, "1670400".toByteArray()))
|
||||
}
|
||||
|
||||
if (path == "/sys/devices/soc0/serial_number") {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, "0x0000043be8571339".toByteArray()))
|
||||
}
|
||||
|
||||
if (path == "/proc") {
|
||||
return FileResult.success(DirectoryFileIO(oflags, path,
|
||||
DirectoryFileIO.DirectoryEntry(false, emulator.pid.toString()),
|
||||
))
|
||||
}
|
||||
|
||||
if (path == "/data/app/~~vbcRLwPxS0GyVfqT-nCYrQ==/${vm.envData.packageName}-xJKJPVp9lorkCgR_w5zhyA==/lib/arm64") {
|
||||
if (CONFIG.unidbg.debug)
|
||||
println("尝试获取library| 但是我不给")
|
||||
//return FileResult.success(DirectoryFileIO(oflags, path,
|
||||
// DirectoryFileIO.DirectoryEntry(true, "libfekit.so"),
|
||||
//))
|
||||
}
|
||||
|
||||
if(path == "/data/app/~~vbcRLwPxS0GyVfqT-nCYrQ==/${vm.envData.packageName}-xJKJPVp9lorkCgR_w5zhyA==/base.apk") {
|
||||
val f = tmpFilePath.resolve("QQ.apk")
|
||||
if (f.exists()) {
|
||||
return FileResult.success(SimpleFileIO(oflags, tmpFilePath.resolve("QQ.apk").also {
|
||||
if (!it.exists()) it.createNewFile()
|
||||
}, path))
|
||||
} else {
|
||||
return FileResult.failed(UnixEmulator.ENOENT)
|
||||
}
|
||||
}
|
||||
|
||||
if (path == "/data/app/~~vbcRLwPxS0GyVfqT-nCYrQ==/${vm.envData.packageName}-xJKJPVp9lorkCgR_w5zhyA==/lib/arm64/libfekit.so") {
|
||||
return FileResult.success(SimpleFileIO(oflags, tmpFilePath.resolve("libfekit.so"), path))
|
||||
}
|
||||
|
||||
if (path == "/data/app/~~vbcRLwPxS0GyVfqT-nCYrQ==/${vm.envData.packageName}-xJKJPVp9lorkCgR_w5zhyA==/lib/arm64/libwtecdh.so") {
|
||||
tmpFilePath.resolve("libwtecdh.so").let {
|
||||
if (it.exists()) {
|
||||
return FileResult.success(SimpleFileIO(oflags, it, path))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (path == "/system/bin/sh" || path == "/system/bin/ls" || path == "/system/lib/libc.so") {
|
||||
return FileResult.success(ByteArrayFileIO(oflags, path, byteArrayOf(0x7f, 0x45, 0x4c, 0x46, 0x02, 0x01, 0x01, 0x00)))
|
||||
}
|
||||
|
||||
if (path.startsWith("/data/user/")) {
|
||||
if (path != "/data/user/0" && path != "/data/user/999") {
|
||||
return FileResult.failed(UnixEmulator.ENOENT)
|
||||
} else {
|
||||
return FileResult.failed(UnixEmulator.EACCES)
|
||||
}
|
||||
}
|
||||
|
||||
if (path.contains("system_android_l2") || path.contains("android_lq")) {
|
||||
val newPath = if (path.startsWith("C:")) path.substring(2) else path
|
||||
val file = tmpFilePath.resolve(".system_android_l2")
|
||||
if (!file.exists()) {
|
||||
file.writeBytes("619F9042CA821CF91DFAF172D464FFC7A6CB8E024CC053F7438429FA38E86854471D6B0A9DE4C39BF02DC18C0CC54A715C9210E8A32B284366849CBB7F88C634AA".hex2ByteArray())
|
||||
}
|
||||
return FileResult.success(SimpleFileIO(oflags, file, newPath))
|
||||
}
|
||||
|
||||
Logger.getLogger("FileResolver").warning("Couldn't find file: $path")
|
||||
return def
|
||||
}
|
||||
}
|
561
src/main/kotlin/moe/fuqiuluo/unidbg/env/QSecJni.kt
vendored
Normal file
561
src/main/kotlin/moe/fuqiuluo/unidbg/env/QSecJni.kt
vendored
Normal file
@ -0,0 +1,561 @@
|
||||
@file:Suppress("UNCHECKED_CAST")
|
||||
|
||||
package moe.fuqiuluo.unidbg.env
|
||||
|
||||
import CONFIG
|
||||
import com.github.unidbg.linux.android.dvm.*
|
||||
import com.github.unidbg.linux.android.dvm.array.ArrayObject
|
||||
import com.tencent.mobileqq.channel.SsoPacket
|
||||
import com.tencent.mobileqq.dt.model.FEBound
|
||||
import com.tencent.mobileqq.qsec.qsecest.SelfBase64
|
||||
import com.tencent.mobileqq.qsec.qsecurity.DeepSleepDetector
|
||||
import com.tencent.mobileqq.sign.QQSecuritySign
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import moe.fuqiuluo.comm.EnvData
|
||||
import moe.fuqiuluo.ext.toHexString
|
||||
import moe.fuqiuluo.unidbg.QSecVM
|
||||
import moe.fuqiuluo.unidbg.vm.GlobalData
|
||||
import moe.fuqiuluo.utils.MD5
|
||||
import org.slf4j.LoggerFactory
|
||||
import java.io.File
|
||||
import java.security.SecureRandom
|
||||
import java.util.*
|
||||
import kotlin.random.Random
|
||||
import kotlin.random.nextInt
|
||||
|
||||
private val logger = LoggerFactory.getLogger(QSecJni::class.java)
|
||||
|
||||
typealias BytesObject = com.github.unidbg.linux.android.dvm.array.ByteArray
|
||||
|
||||
class QSecJni(
|
||||
val envData: EnvData,
|
||||
val vm: QSecVM,
|
||||
val global: GlobalData
|
||||
) : AbstractJni() {
|
||||
override fun getStaticIntField(vm: BaseVM, dvmClass: DvmClass, signature: String): Int {
|
||||
if (signature == "android/os/Build\$VERSION->SDK_INT:I") {
|
||||
return 26
|
||||
}
|
||||
return super.getStaticIntField(vm, dvmClass, signature)
|
||||
}
|
||||
|
||||
override fun getIntField(vm: BaseVM, dvmObject: DvmObject<*>, signature: String): Int {
|
||||
if (signature == "android/content/pm/ApplicationInfo->targetSdkVersion:I") {
|
||||
return 29
|
||||
}
|
||||
return super.getIntField(vm, dvmObject, signature)
|
||||
}
|
||||
|
||||
override fun callVoidMethodV(vm: BaseVM, dvmObject: DvmObject<*>, signature: String, vaList: VaList) {
|
||||
if (signature == "com/tencent/mobileqq/fe/IFEKitLog->i(Ljava/lang/String;ILjava/lang/String;)V") {
|
||||
val tag = vaList.getObjectArg<StringObject>(0)
|
||||
val msg = vaList.getObjectArg<StringObject>(2)
|
||||
println(tag.value + "info: " + msg.value)
|
||||
return
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/fe/IFEKitLog->e(Ljava/lang/String;ILjava/lang/String;)V") {
|
||||
val tag = vaList.getObjectArg<StringObject>(0)
|
||||
val msg = vaList.getObjectArg<StringObject>(2)
|
||||
println(tag.value + "error: " + msg.value)
|
||||
return
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/channel/ChannelProxy->sendMessage(Ljava/lang/String;[BJ)V") {
|
||||
val cmd = vaList.getObjectArg<StringObject>(0).value
|
||||
val data = vaList.getObjectArg<BytesObject>(1).value
|
||||
val callbackId = vaList.getLongArg(2)
|
||||
val hex = data.toHexString()
|
||||
|
||||
if (callbackId == -1L) return
|
||||
|
||||
println("uin = ${global["uin"]}, id = $callbackId, sendPacket(cmd = $cmd, data = $hex)")
|
||||
(global["PACKET"] as ArrayList<SsoPacket>).add(SsoPacket(cmd, hex, callbackId))
|
||||
(global["mutex"] as Mutex).also { if (it.isLocked) it.unlock() }
|
||||
return
|
||||
}
|
||||
|
||||
if (signature == "com/tencent/mobileqq/qsec/qsecurity/QSec->updateO3DID(Ljava/lang/String;)V") {
|
||||
val o3did = vaList.getObjectArg<StringObject>(0).value
|
||||
global["o3did"] = o3did
|
||||
return
|
||||
}
|
||||
|
||||
if (signature == "com/tencent/secprotocol/ByteData->putUping(IIILjava/lang/Object;)V") {
|
||||
return
|
||||
}
|
||||
|
||||
super.callVoidMethodV(vm, dvmObject, signature, vaList)
|
||||
}
|
||||
|
||||
override fun getStaticObjectField(vm: BaseVM, dvmClass: DvmClass, signature: String): DvmObject<*> {
|
||||
if (signature == "com/tencent/mobileqq/qsec/qsecurity/QSecConfig->business_uin:Ljava/lang/String;") {
|
||||
return StringObject(vm, global["uin"] as String)
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/qsec/qsecurity/QSecConfig->business_seed:Ljava/lang/String;") {
|
||||
return StringObject(vm, global["seed"] as? String ?: "")
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/qsec/qsecurity/QSecConfig->business_guid:Ljava/lang/String;") {
|
||||
return StringObject(vm, global["guid"] as? String ?: "")
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/qsec/qsecurity/QSecConfig->business_o3did:Ljava/lang/String;") {
|
||||
return StringObject(vm, global["o3did"] as? String ?: "")
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/qsec/qsecurity/QSecConfig->business_q36:Ljava/lang/String;") {
|
||||
return StringObject(vm, global["qimei36"] as? String ?: "")
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/qsec/qsecurity/QSecConfig->business_qua:Ljava/lang/String;") {
|
||||
return StringObject(vm, this.vm.envData.qua)
|
||||
}
|
||||
return super.getStaticObjectField(vm, dvmClass, signature)
|
||||
}
|
||||
|
||||
override fun getObjectField(vm: BaseVM, dvmObject: DvmObject<*>, signature: String): DvmObject<*> {
|
||||
if (signature == "android/content/pm/ApplicationInfo->nativeLibraryDir:Ljava/lang/String;") {
|
||||
return StringObject(
|
||||
vm,
|
||||
"/data/app/~~vbcRLwPxS0GyVfqT-nCYrQ==/${envData.packageName}-xJKJPVp9lorkCgR_w5zhyA==/lib/arm64"
|
||||
)
|
||||
}
|
||||
return super.getObjectField(vm, dvmObject, signature)
|
||||
}
|
||||
|
||||
override fun setObjectField(vm: BaseVM, dvmObject: DvmObject<*>, signature: String, value: DvmObject<*>) {
|
||||
if (signature == "com/tencent/mobileqq/sign/QQSecuritySign\$SignResult->token:[B") {
|
||||
val data = value.value as ByteArray
|
||||
(dvmObject as QQSecuritySign.SignResultObject).setToken(data)
|
||||
return
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/sign/QQSecuritySign\$SignResult->extra:[B") {
|
||||
val data = value.value as ByteArray
|
||||
(dvmObject as QQSecuritySign.SignResultObject).setExtra(data)
|
||||
return
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/sign/QQSecuritySign\$SignResult->sign:[B") {
|
||||
val data = value.value as ByteArray
|
||||
(dvmObject as QQSecuritySign.SignResultObject).setSign(data)
|
||||
return
|
||||
}
|
||||
super.setObjectField(vm, dvmObject, signature, value)
|
||||
}
|
||||
|
||||
override fun callIntMethodV(vm: BaseVM, dvmObject: DvmObject<*>, signature: String, vaList: VaList): Int {
|
||||
if ("java/lang/String->hashCode()I" == signature) {
|
||||
return (dvmObject.value as String).hashCode()
|
||||
}
|
||||
return super.callIntMethodV(vm, dvmObject, signature, vaList)
|
||||
}
|
||||
|
||||
override fun callStaticObjectMethodV(
|
||||
vm: BaseVM,
|
||||
dvmClass: DvmClass,
|
||||
signature: String,
|
||||
vaList: VaList
|
||||
): DvmObject<*> {
|
||||
if (signature == "com/tencent/mobileqq/dt/app/Dtc->mmKVValue(Ljava/lang/String;)Ljava/lang/String;") {
|
||||
return StringObject(
|
||||
vm, when (val key = vaList.getObjectArg<StringObject>(0).value) {
|
||||
"TuringRiskID-TuringCache-20230511" -> ""
|
||||
"o3_switch_Xwid", "o3_xwid_switch" -> global["o3_switch_Xwid"] as? String ?: "1"
|
||||
"DeviceToken-oaid-V001" -> ""
|
||||
"DeviceToken-MODEL-XX-V001" -> ""
|
||||
"DeviceToken-ANDROID-ID-V001" -> ""
|
||||
"DeviceToken-qimei36-V001" -> global["qimei36"] as? String ?: ""
|
||||
"MQQ_SP_DEVICETOKEN_DID_DEVICEIDUUID_202207072241" -> UUID.randomUUID()
|
||||
.toString() + "|" + this.vm.envData.version
|
||||
|
||||
"DeviceToken-APN-V001", "DeviceToken-TuringCache-V001", "DeviceToken-MAC-ADR-V001", "DeviceToken-wifissid-V001" -> "-1"
|
||||
|
||||
"SensorList-20231221" -> MD5.toMD5Byte(System.currentTimeMillis().toString() + "NI MAMA BAOZHA").toHexString(false)
|
||||
"FONT-LIST-20231221" -> MD5.toMD5Byte(System.currentTimeMillis().toString() + "NI MAMA BAOZHA2").toHexString(false)
|
||||
"kO3WhiteCmdListKey" -> ""
|
||||
"USB-ST-20231221" -> "mtp,adb"
|
||||
"SIM-ST-20231221" -> "0"
|
||||
"SDCRAD-INFO-20231221" -> "-1"
|
||||
"LOCKGUARD-INFO-20231221" -> "1"
|
||||
"ASSIST-LIST-20231221","ASSIST-OPENED-20231221" -> "[]"
|
||||
"ASSIST-ST-20231221" -> "1"
|
||||
"SYSTEM_STARTTIME-20240104" -> (System.currentTimeMillis()-123456).toString()
|
||||
else -> error("Not support mmKVValue:$key")
|
||||
}
|
||||
)
|
||||
}
|
||||
if (signature == "android/provider/Settings\$System->getString(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;") {
|
||||
val key = vaList.getObjectArg<StringObject>(1).value
|
||||
if (key == "android_id") {
|
||||
return StringObject(vm, envData.androidId.lowercase())
|
||||
}
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/fe/utils/DeepSleepDetector->getCheckResult()Ljava/lang/String;") {
|
||||
val result = (global["DeepSleepDetector"] as DeepSleepDetector).getCheckResult()
|
||||
return StringObject(vm, result.toString())
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/dt/model/FEBound->transform(I[B)[B") {
|
||||
val mode = vaList.getIntArg(0)
|
||||
val data = vaList.getObjectArg<DvmObject<*>>(1).value as ByteArray
|
||||
val result = FEBound.transform(mode, data)
|
||||
if (mode == 1)
|
||||
println("FEBound.transform(${data.toHexString()}) => ${result?.toHexString()}")
|
||||
return BytesObject(vm, result)
|
||||
}
|
||||
if (signature == "java/lang/ClassLoader->getSystemClassLoader()Ljava/lang/ClassLoader;") {
|
||||
return vm.resolveClass("java/lang/ClassLoader")
|
||||
.newObject(ClassLoader.getSystemClassLoader())
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/dt/app/Dtc->getPropSafe(Ljava/lang/String;)Ljava/lang/String;") {
|
||||
return StringObject(
|
||||
vm, when (val key = vaList.getObjectArg<StringObject>(0).value) {
|
||||
"ro.build.id" -> "TKQ1.220905.001"
|
||||
"ro.build.display.id" -> "TKQ1.220905.001 test-keys"
|
||||
"ro.product.device", "ro.product.name" -> "mondrian"
|
||||
"ro.product.board" -> "taro"
|
||||
"ro.product.manufacturer" -> "Xiaomi"
|
||||
"ro.product.brand" -> "Redmi"
|
||||
"ro.bootloader" -> "unknown"
|
||||
"persist.sys.timezone" -> "Asia/Shanghai"
|
||||
"ro.hardware" -> "qcom"
|
||||
"ro.product.cpu.abilist" -> "arm64-v8a, armeabi-v7a, armeabi"
|
||||
"ro.build.version.incremental" -> "V14.0.18.0.CNMLGB"
|
||||
"ro.build.version.release" -> "8.0"
|
||||
"ro.build.version.base_os", "ro.boot.container", "ro.vendor.build.fingerprint", "ro.build.expect.bootloader", "ro.build.expect.baseband" -> ""
|
||||
"ro.build.version.security_patch" -> "2077-2-29"
|
||||
"ro.build.version.preview_sdk" -> "0"
|
||||
"ro.build.version.codename", "ro.build.version.all_codenames" -> "REL"
|
||||
"ro.build.type" -> "user"
|
||||
"ro.build.tags" -> "release-keys"
|
||||
"ro.treble.enabled" -> "true"
|
||||
"ro.build.date.utc" -> "1673390476"
|
||||
"ro.build.user" -> ""
|
||||
"ro.build.host" -> "build"
|
||||
"net.bt.name" -> "Android"
|
||||
"ro.build.characteristics" -> "default"
|
||||
"ro.build.description" -> "mondrian-user 12 TKQ1.220905.001 release-keys"
|
||||
"ro.product.locale" -> "zh-CN"
|
||||
"ro.build.flavor" -> "full_miui_64-user"
|
||||
"ro.config.ringtone" -> "Ring_Synth_04.ogg"
|
||||
else -> error("Not support prop:$key")
|
||||
}
|
||||
)
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/dt/app/Dtc->getAppVersionName(Ljava/lang/String;)Ljava/lang/String;") {
|
||||
return StringObject(
|
||||
vm, when (val key = vaList.getObjectArg<StringObject>(0).value) {
|
||||
"empty" -> this.vm.envData.version
|
||||
else -> error("Not support getAppVersionName:$key")
|
||||
}
|
||||
)
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/dt/app/Dtc->getAppVersionCode(Ljava/lang/String;)Ljava/lang/String;") {
|
||||
return StringObject(
|
||||
vm, when (val key = vaList.getObjectArg<StringObject>(0).value) {
|
||||
"empty" -> this.vm.envData.code
|
||||
else -> error("Not support getAppVersionCode:$key")
|
||||
}
|
||||
)
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/dt/app/Dtc->getAppInstallTime(Ljava/lang/String;)Ljava/lang/String;") {
|
||||
return StringObject(
|
||||
vm, when (val key = vaList.getObjectArg<StringObject>(0).value) {
|
||||
"empty" -> (System.currentTimeMillis() - 10000).toString()
|
||||
else -> error("Not support getAppVersionCode:$key")
|
||||
}
|
||||
)
|
||||
}
|
||||
if (
|
||||
signature == "com/tencent/mobileqq/dt/app/Dtc->getDensity(Ljava/lang/String;)Ljava/lang/String;" ||
|
||||
signature == "com/tencent/mobileqq/dt/app/Dtc->getFontDpi(Ljava/lang/String;)Ljava/lang/String;"
|
||||
) {
|
||||
return StringObject(
|
||||
vm, when (val key = vaList.getObjectArg<StringObject>(0).value) {
|
||||
"empty" -> "1.3125"
|
||||
else -> error("Not support getAppVersionCode:$key")
|
||||
}
|
||||
)
|
||||
}
|
||||
if ("com/tencent/mobileqq/dt/app/Dtc->getScreenSize(Ljava/lang/String;)Ljava/lang/String;" == signature) {
|
||||
return StringObject(vm, "[800,1217]")
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/dt/app/Dtc->getStorage(Ljava/lang/String;)Ljava/lang/String;") {
|
||||
return StringObject(vm, "137438953471")
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/dt/app/Dtc->systemGetSafe(Ljava/lang/String;)Ljava/lang/String;") {
|
||||
return StringObject(
|
||||
vm, when (val key = vaList.getObjectArg<StringObject>(0).value) {
|
||||
"user.locale" -> "zh-CN"
|
||||
"http.agent" -> "Dalvik/2.1.0 (Linux; U; Android 12.0.0; 114514 Build/O11019)"
|
||||
"java.vm.version" -> "2.1.0"
|
||||
"os.version" -> "3.18.79"
|
||||
"persist.sys.timezone" -> "-1"
|
||||
"java.runtime.version" -> "0.9"
|
||||
"java.boot.class.path" -> "/system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/frameworkhttp.jar:/system/framework/bouncycastle.jar:/system/framework/apache-xml.jar:/system/framework/legacy-test.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/frameworkoip-common.jar:/system/framework/ims-common.jar:/system/framework/org.apache.http.legacy.boot.jar:/system/framework/android.hidl.base-V1.0-java.jar:/system/framework/android.hidl.manager-V1.0-java.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/mediatek-telephony-common.jar:/system/framework/mediatek-telephony-base.jar:/system/framework/mediatek-ims-common.jar:/system/framework/mediatek-telecom-common.jar:/system/framework/mediatek-cta.jar"
|
||||
else -> error("Not support systemGetSafe:$key")
|
||||
}
|
||||
)
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/dt/app/Dtc->getIME(Ljava/lang/String;)Ljava/lang/String;") {
|
||||
return StringObject(vm, "com.netease.nemu_vinput.nemu/com.android.inputmethodcommon.SoftKeyboard")
|
||||
}
|
||||
|
||||
if (signature == "java/lang/Thread->currentThread()Ljava/lang/Thread;") {
|
||||
return vm.resolveClass("java/lang/Thread").newObject(null)
|
||||
}
|
||||
|
||||
if (signature == "com/tencent/mobileqq/qsec/qsecest/QsecEst->p(Landroid/content/Context;I)Ljava/lang/String;") {
|
||||
val id = vaList.getIntArg(1)
|
||||
return StringObject(vm, when (id) {
|
||||
0 -> "26"
|
||||
1 -> "k1"
|
||||
23 -> "8" // CPU数量
|
||||
25 -> "0.0.12"
|
||||
26 -> "90721e0b3a587f77503b6abedd960c2e".uppercase() // 签名md5
|
||||
27 -> "0" // 是否有xposed
|
||||
28 -> envData.packageName
|
||||
31 -> "0" // 是否锁屏
|
||||
41 -> "" // Hardware
|
||||
42 -> "WiFi"
|
||||
43 -> envData.packageName
|
||||
44 -> "1919810" // 剩余内存
|
||||
45 -> "114514" // 磁盘大小
|
||||
46 -> "0" // 是否有qemu环境
|
||||
47 -> "0" // 是否存在qemu文件
|
||||
48 -> "0" // 是否处于代理状态
|
||||
49 -> "0" // SU
|
||||
50 -> "1145141919"
|
||||
51 -> envData.version
|
||||
52 -> envData.code
|
||||
68 -> "0" // VPN
|
||||
70 -> "java.agent"
|
||||
80, 71 -> "Asia/Shanghai"
|
||||
72 -> "800,1217"
|
||||
73 -> "8.0"
|
||||
74 -> "200" // screen_brightness
|
||||
75 -> Random.nextInt(0 .. 500000).toString()
|
||||
76 -> "1,20,50"
|
||||
77 -> (1024 * 1024 * 1024 * 32).toString()
|
||||
78 -> "0" // su Bin
|
||||
79 -> "1.1.2"
|
||||
81 -> "zh"
|
||||
82 -> "90721e0b3aaa7f77503b6abedd960c2e".uppercase()
|
||||
83 -> "0"
|
||||
86 -> fun(): String {
|
||||
val data = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".toCharArray()
|
||||
val secureRandom = SecureRandom()
|
||||
val sb = StringBuilder(32)
|
||||
for (i2 in 0 until 32) {
|
||||
sb.append(data[secureRandom.nextInt(data.size)])
|
||||
}
|
||||
return sb.toString()
|
||||
}()
|
||||
87 -> "0" // busy box
|
||||
88 -> "0" // magisk
|
||||
89 -> System.currentTimeMillis().toString()
|
||||
in 90 .. 105 -> "0"
|
||||
else -> error("不支持的QSecEstInfo ID: $id")
|
||||
})
|
||||
}
|
||||
|
||||
if ("com/tencent/secprotocol/t/s->c(Landroid/content/Context;)Ljava/lang/String;" == signature) {
|
||||
return StringObject(vm, envData.packageName)
|
||||
}
|
||||
|
||||
if ("com/tencent/secprotocol/t/s->d(Landroid/content/Context;)Ljava/lang/String;" == signature) {
|
||||
return StringObject(vm, "90721e0b3a587f77503b6abedd960c2e".uppercase())
|
||||
}
|
||||
|
||||
return super.callStaticObjectMethodV(vm, dvmClass, signature, vaList)
|
||||
}
|
||||
|
||||
override fun callStaticIntMethodV(vm: BaseVM?, dvmClass: DvmClass?, signature: String?, vaList: VaList?): Int {
|
||||
if ("com/tencent/secprotocol/t/s->e(Landroid/content/Context;)I" == signature) {
|
||||
return when (envData.version) {
|
||||
"3.5.1" -> 345546704
|
||||
"3.5.2" -> 345971138
|
||||
else -> error("不支持该TIM版本")
|
||||
}
|
||||
}
|
||||
return super.callStaticIntMethodV(vm, dvmClass, signature, vaList)
|
||||
}
|
||||
|
||||
override fun callStaticVoidMethodV(vm: BaseVM, dvmClass: DvmClass, signature: String, vaList: VaList) {
|
||||
if (signature == "com/tencent/mobileqq/fe/utils/DeepSleepDetector->stopCheck()V") {
|
||||
if ("DeepSleepDetector" in global) {
|
||||
(global["DeepSleepDetector"] as DeepSleepDetector).stopped = true
|
||||
}
|
||||
return
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/dt/app/Dtc->mmKVSaveValue(Ljava/lang/String;Ljava/lang/String;)V") {
|
||||
val key = vaList.getObjectArg<StringObject>(0).value
|
||||
val value = vaList.getObjectArg<StringObject>(1).value
|
||||
global[key] = value
|
||||
return
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/dt/app/Dtc->saveList(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V") {
|
||||
return
|
||||
}
|
||||
super.callStaticVoidMethodV(vm, dvmClass, signature, vaList)
|
||||
}
|
||||
|
||||
override fun callObjectMethodV(
|
||||
vm: BaseVM,
|
||||
dvmObject: DvmObject<*>,
|
||||
signature: String,
|
||||
vaList: VaList
|
||||
): DvmObject<*>? {
|
||||
if ("android/content/pm/PackageManager->getPackageGids(Ljava/lang/String;)[I" == signature) {
|
||||
vm.throwException(
|
||||
vm.resolveClass("android/content/pm/PackageManager/NameNotFoundException").newObject(null)
|
||||
)
|
||||
return null
|
||||
}
|
||||
if ("android/content/pm/IPackageManager->getPackageGids(Ljava/lang/String;II)[I" == signature) {
|
||||
vm.throwException(
|
||||
vm.resolveClass("android/content/pm/PackageManager/NameNotFoundException").newObject(null)
|
||||
)
|
||||
return null
|
||||
}
|
||||
if ("java/lang/VMClassLoader->findLoadedClass(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class;" == signature) {
|
||||
return null
|
||||
}
|
||||
if (signature == "android/content/Context->getApplicationInfo()Landroid/content/pm/ApplicationInfo;") {
|
||||
return vm.resolveClass("android/content/pm/ApplicationInfo").newObject(null)
|
||||
}
|
||||
if (signature == "android/content/Context->getFilesDir()Ljava/io/File;") {
|
||||
return if (envData.version == "3.5.1") {
|
||||
vm.resolveClass("android/content/Context", vm.resolveClass("java/io/File"))
|
||||
.newObject(File("/data/user/0/${envData.packageName}/files"))
|
||||
} else {
|
||||
vm.resolveClass("java/io/File", vm.resolveClass("android/content/Context"))
|
||||
.newObject(File("/data/user/0/${envData.packageName}/files"))
|
||||
}
|
||||
}
|
||||
if (signature == "android/content/Context->getContentResolver()Landroid/content/ContentResolver;") {
|
||||
return vm.resolveClass("android/content/ContentResolver")
|
||||
.newObject(null)
|
||||
}
|
||||
if (signature == "android/content/pm/PackageManager->queryIntentServices(Landroid/content/Intent;I)Ljava/util/List;") {
|
||||
return vm.resolveClass("java/util/List").newObject(ArrayList<Nothing>())
|
||||
}
|
||||
if (signature == "android/content/Intent->addCategory(Ljava/lang/String;)Landroid/content/Intent;") {
|
||||
return dvmObject
|
||||
}
|
||||
if (signature == "android/content/Context->getPackageResourcePath()Ljava/lang/String;") {
|
||||
return StringObject(
|
||||
vm,
|
||||
"/data/app/~~vbcRLwPxS0GyVfqT-nCYrQ==/${envData.packageName}-xJKJPVp9lorkCgR_w5zhyA==/base.apk"
|
||||
)
|
||||
}
|
||||
if (signature == "android/content/Context->getPackageName()Ljava/lang/String;") {
|
||||
return StringObject(vm, envData.packageName)
|
||||
}
|
||||
if (signature == "java/lang/ClassLoader->loadClass(Ljava/lang/String;)Ljava/lang/Class;") {
|
||||
val name = vaList.getObjectArg<StringObject>(0).value
|
||||
val loader = dvmObject.value as ClassLoader
|
||||
try {
|
||||
return vm
|
||||
.resolveClass("java/lang/Class")
|
||||
.newObject(loader.loadClass(name))
|
||||
} catch (e: ClassNotFoundException) {
|
||||
vm.throwException(
|
||||
vm
|
||||
.resolveClass("java.lang.ClassNotFoundException")
|
||||
.newObject(e)
|
||||
)
|
||||
}
|
||||
return vm
|
||||
.resolveClass("java/lang/Class")
|
||||
.newObject(null)
|
||||
}
|
||||
if ("java/lang/Thread->getStackTrace()[Ljava/lang/StackTraceElement;" == signature) {
|
||||
return ArrayObject()
|
||||
}
|
||||
if ("com/tencent/mobileqq/qsec/qsecurity/QSec->getEstInfo()Ljava/lang/String;" == signature) {
|
||||
val est = global["est_data"] as? com.github.unidbg.linux.android.dvm.array.ByteArray
|
||||
return if (est == null || est.value == null) {
|
||||
StringObject(vm, "e_null")
|
||||
} else {
|
||||
val byteArray = est.value
|
||||
val b64 = SelfBase64.Encoder.RFC4648.encodeToString(byteArray)
|
||||
StringObject(vm, b64)
|
||||
}
|
||||
}
|
||||
if ("android/content/Context->getExternalFilesDir(Ljava/lang/String;)Ljava/io/File;" == signature) {
|
||||
return vm.resolveClass("java/io/File")
|
||||
.newObject(File("/mnt/sdcard"))
|
||||
}
|
||||
if ("android/content/Context->toString()Ljava/lang/String;" == signature) {
|
||||
return StringObject(vm, dvmObject.value.toString())
|
||||
}
|
||||
if ("android/content/ContentResolver->acquireContentProviderClient(Ljava/lang/String;)Landroid/content/ContentProviderClient;" == signature) {
|
||||
return null
|
||||
}
|
||||
return super.callObjectMethodV(vm, dvmObject, signature, vaList)
|
||||
}
|
||||
|
||||
override fun acceptMethod(dvmClass: DvmClass, signature: String, isStatic: Boolean): Boolean {
|
||||
if (signature == "com/tencent/mobileqq/qsec/qsecest/QsecEst->p(Landroid/content/Context;I)Ljava/lang/String;"
|
||||
&& envData.packageName == "com.tencent.mobileqq") {
|
||||
return false
|
||||
}
|
||||
if (signature == "com/tencent/qqprotect/qsec/QSecFramework->goingUp(JJJJLjava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;[Ljava/lang/Object;)I"
|
||||
&& envData.packageName == "com.tencent.mobileqq") {
|
||||
return false
|
||||
}
|
||||
if ("com/tencent/mobileqq/dt/app/Dtc->systemGetsafe(Ljava/lang/String;)Ljava/lang/String" == signature) {
|
||||
return false
|
||||
}
|
||||
if (CONFIG.unidbg.debug) {
|
||||
println("Accept ${ if (isStatic) "static" else "" } $signature")
|
||||
}
|
||||
return super.acceptMethod(dvmClass, signature, isStatic)
|
||||
}
|
||||
|
||||
override fun toReflectedMethod(vm: BaseVM?, dvmClass: DvmClass?, signature: String?): DvmObject<*> {
|
||||
//println("toReflectedMethod")
|
||||
return super.toReflectedMethod(vm, dvmClass, signature)
|
||||
}
|
||||
|
||||
override fun newObjectV(vm: BaseVM, dvmClass: DvmClass, signature: String, vaList: VaList): DvmObject<*> {
|
||||
if (signature == "java/io/File-><init>(Ljava/lang/String;)V") {
|
||||
val path = vaList.getObjectArg<StringObject>(0).value
|
||||
return vm
|
||||
.resolveClass("java/io/File")
|
||||
.newObject(File(path))
|
||||
}
|
||||
if (signature == "com/tencent/mobileqq/sign/QQSecuritySign\$SignResult-><init>()V") {
|
||||
return QQSecuritySign.SignResultObject(vm)
|
||||
}
|
||||
if (signature == "android/content/Intent-><init>(Ljava/lang/String;)V") {
|
||||
return vm
|
||||
.resolveClass("android/content/Intent")
|
||||
.newObject(hashMapOf("action" to (vaList.getObjectArg(0) as StringObject).value))
|
||||
}
|
||||
return super.newObjectV(vm, dvmClass, signature, vaList)
|
||||
}
|
||||
|
||||
override fun callBooleanMethodV(
|
||||
vm: BaseVM,
|
||||
dvmObject: DvmObject<*>,
|
||||
signature: String,
|
||||
vaList: VaList
|
||||
): Boolean {
|
||||
if (signature == "java/io/File->canRead()Z") {
|
||||
val file = dvmObject.value as File
|
||||
if (
|
||||
file.toString() == "\\data\\data\\${envData.packageName}\\.." ||
|
||||
file.toString() == "/data/data/${envData.packageName}/.." ||
|
||||
file.toString() == "/data/data/" ||
|
||||
file.toString() == "/data/data"
|
||||
) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return super.callBooleanMethodV(vm, dvmObject, signature, vaList)
|
||||
}
|
||||
|
||||
override fun callObjectMethod(
|
||||
vm: BaseVM,
|
||||
dvmObject: DvmObject<*>,
|
||||
signature: String,
|
||||
varArg: VarArg
|
||||
): DvmObject<*> {
|
||||
return super.callObjectMethod(vm, dvmObject, signature, varArg)
|
||||
}
|
||||
}
|
78
src/main/kotlin/moe/fuqiuluo/unidbg/env/files/cpuinfo.kt
vendored
Normal file
78
src/main/kotlin/moe/fuqiuluo/unidbg/env/files/cpuinfo.kt
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
package moe.fuqiuluo.unidbg.env.files
|
||||
|
||||
fun fetchCpuInfo(): ByteArray {
|
||||
return """
|
||||
processor : 0
|
||||
BogoMIPS : 38.40
|
||||
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti
|
||||
CPU implementer : 0x41
|
||||
CPU architecture: 8
|
||||
CPU variant : 0x0
|
||||
CPU part : 0xd46
|
||||
CPU revision : 3
|
||||
|
||||
processor : 1
|
||||
BogoMIPS : 38.40
|
||||
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti
|
||||
CPU implementer : 0x41
|
||||
CPU architecture: 8
|
||||
CPU variant : 0x0
|
||||
CPU part : 0xd46
|
||||
CPU revision : 3
|
||||
|
||||
processor : 2
|
||||
BogoMIPS : 38.40
|
||||
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti
|
||||
CPU implementer : 0x41
|
||||
CPU architecture: 8
|
||||
CPU variant : 0x0
|
||||
CPU part : 0xd46
|
||||
CPU revision : 3
|
||||
|
||||
processor : 3
|
||||
BogoMIPS : 38.40
|
||||
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti
|
||||
CPU implementer : 0x41
|
||||
CPU architecture: 8
|
||||
CPU variant : 0x0
|
||||
CPU part : 0xd46
|
||||
CPU revision : 3
|
||||
|
||||
processor : 4
|
||||
BogoMIPS : 38.40
|
||||
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti
|
||||
CPU implementer : 0x41
|
||||
CPU architecture: 8
|
||||
CPU variant : 0x2
|
||||
CPU part : 0xd47
|
||||
CPU revision : 0
|
||||
|
||||
processor : 5
|
||||
BogoMIPS : 38.40
|
||||
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti
|
||||
CPU implementer : 0x41
|
||||
CPU architecture: 8
|
||||
CPU variant : 0x2
|
||||
CPU part : 0xd47
|
||||
CPU revision : 0
|
||||
|
||||
processor : 6
|
||||
BogoMIPS : 38.40
|
||||
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti
|
||||
CPU implementer : 0x41
|
||||
CPU architecture: 8
|
||||
CPU variant : 0x2
|
||||
CPU part : 0xd47
|
||||
CPU revision : 0
|
||||
|
||||
processor : 7
|
||||
BogoMIPS : 38.40
|
||||
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bti
|
||||
CPU implementer : 0x41
|
||||
CPU architecture: 8
|
||||
CPU variant : 0x2
|
||||
CPU part : 0xd48
|
||||
CPU revision : 0
|
||||
|
||||
""".trimIndent().toByteArray()
|
||||
}
|
50
src/main/kotlin/moe/fuqiuluo/unidbg/env/files/meminfo.kt
vendored
Normal file
50
src/main/kotlin/moe/fuqiuluo/unidbg/env/files/meminfo.kt
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
package moe.fuqiuluo.unidbg.env.files
|
||||
|
||||
fun fetchMemInfo(): ByteArray {
|
||||
return """
|
||||
MemTotal: 11444400 kB
|
||||
MemFree: 444328 kB
|
||||
MemAvailable: 3060808 kB
|
||||
Buffers: 2292 kB
|
||||
Cached: 2735080 kB
|
||||
SwapCached: 0 kB
|
||||
Active: 1430388 kB
|
||||
Inactive: 6251000 kB
|
||||
Active(anon): 28972 kB
|
||||
Inactive(anon): 5323536 kB
|
||||
Active(file): 1401416 kB
|
||||
Inactive(file): 927464 kB
|
||||
Unevictable: 192884 kB
|
||||
Mlocked: 191652 kB
|
||||
SwapTotal: 0 kB
|
||||
SwapFree: 0 kB
|
||||
Dirty: 2540 kB
|
||||
Writeback: 0 kB
|
||||
AnonPages: 5136980 kB
|
||||
Mapped: 1164384 kB
|
||||
Shmem: 221712 kB
|
||||
KReclaimable: 871112 kB
|
||||
Slab: 673940 kB
|
||||
SReclaimable: 180828 kB
|
||||
SUnreclaim: 493112 kB
|
||||
KernelStack: 108816 kB
|
||||
ShadowCallStack: 27232 kB
|
||||
PageTables: 186052 kB
|
||||
NFS_Unstable: 0 kB
|
||||
Bounce: 0 kB
|
||||
WritebackTmp: 0 kB
|
||||
CommitLimit: 5722200 kB
|
||||
Committed_AS: 192359556 kB
|
||||
VmallocTotal: 262930368 kB
|
||||
VmallocUsed: 303412 kB
|
||||
VmallocChunk: 0 kB
|
||||
Percpu: 13888 kB
|
||||
AnonHugePages: 0 kB
|
||||
ShmemHugePages: 0 kB
|
||||
ShmemPmdMapped: 0 kB
|
||||
FileHugePages: 4096 kB
|
||||
FilePmdMapped: 4096 kB
|
||||
CmaTotal: 499712 kB
|
||||
CmaFree: 0 kB
|
||||
""".trimIndent().toByteArray()
|
||||
}
|
24
src/main/kotlin/moe/fuqiuluo/unidbg/env/files/stat.kt
vendored
Normal file
24
src/main/kotlin/moe/fuqiuluo/unidbg/env/files/stat.kt
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
package moe.fuqiuluo.unidbg.env.files
|
||||
|
||||
fun fetchStat(): ByteArray {
|
||||
return buildString {
|
||||
append("cpu 70908543 2318391 57682285 205626547 265784 11502233 1505790 0 0 0\n")
|
||||
append("cpu0 7302248 343336 11528431 26247442 27384 2556821 401344 0 0 0\n")
|
||||
append("cpu1 9124285 580758 11024217 24904821 29376 2635234 311959 0 0 0\n")
|
||||
append("cpu2 8461182 354844 10910391 3640938 4786 2546246 249470 0 0 0\n")
|
||||
append("cpu3 7376835 227391 10245171 4156813 4695 2394473 281332 0 0 0\n")
|
||||
append("cpu4 10388918 244107 4595589 34689258 56474 439396 62430 0 0 0\n")
|
||||
append("cpu5 9161975 185637 3753596 36858345 42296 357412 122333 0 0 0\n")
|
||||
append("cpu6 9141509 191244 3678030 37028283 42926 347915 55033 0 0 0\n")
|
||||
append("cpu7 9951587 191070 1946857 38100643 57843 224732 21887 0 0 0\n")
|
||||
append(
|
||||
"intr 6499860109 0 3774845260 213595275 0 0 0 439330144 0 0 0 0 1432590806 0 0 0 0 0 0 8 7784 4505 0 0 0 43914228 87884 6656429 6883140 0 13 115199397 0 0 0 2 36941907 0 79802 19529541 0 50496389 0 0 0 0 0 0 0 0 0 0 0 0 0 99467 0 0 0 0 0 0 0 0 0 0 0 0 215 0 0 0 0 0 0 0 0 0 0 0 0 0 868825 523151 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 63205753 0 0 0 0 0 0 76117 0 0 0 0 30879 95857882 0 0 212 0 1276 0 24696 45 0 0 0 0 25295 0 0 0 0 0 0 171894 0 0 0 0 0 0 0 0 110527 0 0 6774417 0 0 1 0 5053790 0 3597 0 0 0 0 0 0 0 13 0 0 0 0 27028 0 0 0 0 0 0 0 8024 94 9 4138 1 17 3 47020 0 22 4 3 0 18361 50 2354 4143 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 48909549 37401 0 0 0 64 139379 55198 30 501 5983325 470270 831 0 0 0 0 0 9570 3840590 1661765 1367111 2518122 1384219 0 733594 0 0 0 0 0 0 0 0 0 0 0 14 0 0 0 101135 0 238315 972017 20683186 96649293 6 1420 0 0 0 0 0 0 0 0 0 0 0 0 1001357\n"
|
||||
)
|
||||
append("ctxt 9964111933\n")
|
||||
append("btime 1686854207\n")
|
||||
append("processes 27829795\n")
|
||||
append("procs_running 3\n")
|
||||
append("procs_blocked 0\n")
|
||||
append("softirq 646165898 227595 128247124 464901 50364798 35293690 0 9753380 65978203 58578 355777629\n")
|
||||
}.toByteArray()
|
||||
}
|
57
src/main/kotlin/moe/fuqiuluo/unidbg/env/files/status.kt
vendored
Normal file
57
src/main/kotlin/moe/fuqiuluo/unidbg/env/files/status.kt
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
package moe.fuqiuluo.unidbg.env.files
|
||||
|
||||
fun fetchStatus(pid: Int): String {
|
||||
return buildString {
|
||||
append("Name:\tencent.mobileqq\n")
|
||||
append("Umask:\t0077\n")
|
||||
append("State:\tS (sleeping)\n")
|
||||
append("Tgid:\t$pid\n")
|
||||
append("Ngid:\t0\n")
|
||||
append("Pid:\t$pid\n")
|
||||
append("PPid:\t1180\n")
|
||||
append("TracerPid:\t0\n")
|
||||
append("Uid:\t10281\t10281\t10281\t10281\n")
|
||||
append("Gid:\t10281\t10281\t10281\t10281\n")
|
||||
append("FDSize:\t1024\n")
|
||||
append("Groups:\t1079 3001 3002 3003 9997 20281 50281 99909997 \n")
|
||||
append("VmPeak:\t76966256 kB\n")
|
||||
append("VmSize:\t74489196 kB\n")
|
||||
append("VmLck:\t 0 kB\n")
|
||||
append("VmPin:\t 0 kB\n")
|
||||
append("VmHWM:\t 1332896 kB\n")
|
||||
append("VmRSS:\t 653604 kB\n")
|
||||
append("RssAnon:\t 481564 kB\n")
|
||||
append("RssFile:\t 156120 kB\n")
|
||||
append("RssShmem:\t 15920 kB\n")
|
||||
append("VmData:\t 7587328 kB\n")
|
||||
append("VmStk:\t 8192 kB\n")
|
||||
append("VmExe:\t 8 kB\n")
|
||||
append("VmLib:\t 432720 kB\n")
|
||||
append("VmPTE:\t 7252 kB\n")
|
||||
append("VmSwap:\t 0 kB\n")
|
||||
append("CoreDumping:\t0\n")
|
||||
append("THP_enabled:\t1\n")
|
||||
append("Threads:\t373\n")
|
||||
append("SigQ:\t0/42559\n")
|
||||
append("SigPnd:\t0000000000000000\n")
|
||||
append("ShdPnd:\t0000000000000000\n")
|
||||
append("SigBlk:\t0000000080001200\n")
|
||||
append("SigIgn:\t0000000000001001\n")
|
||||
append("SigCgt:\t0000006e400086fc\n")
|
||||
append("CapInh:\t0000000000000000\n")
|
||||
append("CapPrm:\t0000000000000000\n")
|
||||
append("CapEff:\t0000000000000000\n")
|
||||
append("CapBnd:\t0000000000000000\n")
|
||||
append("CapAmb:\t0000000000000000\n")
|
||||
append("NoNewPrivs:\t0\n")
|
||||
append("Seccomp:\t2\n")
|
||||
append("Seccomp_filters:\t1\n")
|
||||
append("Speculation_Store_Bypass:\tthread vulnerable\n")
|
||||
append("Cpus_allowed:\t07\n")
|
||||
append("Cpus_allowed_list:\t0-2\n")
|
||||
append("Mems_allowed:\t1\n")
|
||||
append("Mems_allowed_list:\t0\n")
|
||||
append("voluntary_ctxt_switches:\t819637\n")
|
||||
append("nonvoluntary_ctxt_switches:\t82707\n")
|
||||
}
|
||||
}
|
24
src/main/kotlin/moe/fuqiuluo/unidbg/session/Session.kt
Normal file
24
src/main/kotlin/moe/fuqiuluo/unidbg/session/Session.kt
Normal file
@ -0,0 +1,24 @@
|
||||
package moe.fuqiuluo.unidbg.session
|
||||
|
||||
import CONFIG
|
||||
import BASE_PATH
|
||||
import com.tencent.mobileqq.channel.SsoPacket
|
||||
import com.tencent.mobileqq.fe.FEKit
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import moe.fuqiuluo.comm.EnvData
|
||||
import moe.fuqiuluo.unidbg.QSecVM
|
||||
|
||||
class Session(envData: EnvData) {
|
||||
internal val vm: QSecVM =
|
||||
QSecVM(BASE_PATH, envData, CONFIG.unidbg.dynarmic, CONFIG.unidbg.unicorn)
|
||||
internal val mutex = Mutex()
|
||||
|
||||
init {
|
||||
vm.global["PACKET"] = arrayListOf<SsoPacket>()
|
||||
vm.global["mutex"] = Mutex(true)
|
||||
vm.global["qimei36"] = envData.qimei36.lowercase()
|
||||
vm.global["guid"] = envData.guid.lowercase()
|
||||
vm.init()
|
||||
FEKit.init(vm, envData.uin.toString())
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package moe.fuqiuluo.unidbg.session
|
||||
|
||||
import CONFIG
|
||||
import moe.fuqiuluo.api.BlackListError
|
||||
import moe.fuqiuluo.comm.EnvData
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
object SessionManager {
|
||||
private val sessionMap = ConcurrentHashMap<Long, Session>()
|
||||
|
||||
operator fun get(uin: Long): Session? {
|
||||
return sessionMap[uin]
|
||||
}
|
||||
|
||||
operator fun contains(uin: Long) = sessionMap.containsKey(uin)
|
||||
|
||||
fun register(envData: EnvData) {
|
||||
if (CONFIG.blackList?.contains(envData.uin) == true) {
|
||||
throw BlackListError
|
||||
}
|
||||
if (envData.uin in this) {
|
||||
close(envData.uin)
|
||||
}
|
||||
sessionMap[envData.uin] = Session(envData)
|
||||
}
|
||||
|
||||
fun close(uin: Long) {
|
||||
sessionMap[uin]?.vm?.destroy()
|
||||
sessionMap.remove(uin)
|
||||
}
|
||||
}
|
56
src/main/kotlin/moe/fuqiuluo/unidbg/vm/AndroidVM.kt
Normal file
56
src/main/kotlin/moe/fuqiuluo/unidbg/vm/AndroidVM.kt
Normal file
@ -0,0 +1,56 @@
|
||||
package moe.fuqiuluo.unidbg.vm
|
||||
|
||||
import CONFIG
|
||||
import com.github.unidbg.arm.backend.DynarmicFactory
|
||||
import com.github.unidbg.arm.backend.Unicorn2Factory
|
||||
import com.github.unidbg.linux.android.AndroidEmulatorBuilder
|
||||
import com.github.unidbg.linux.android.LogCatLevel
|
||||
import com.github.unidbg.linux.android.dvm.DalvikModule
|
||||
import com.github.unidbg.linux.android.dvm.DalvikVM64
|
||||
import com.github.unidbg.linux.android.dvm.DvmClass
|
||||
import com.github.unidbg.virtualmodule.android.AndroidModule
|
||||
import org.apache.commons.logging.LogFactory
|
||||
import java.io.Closeable
|
||||
import java.io.File
|
||||
|
||||
open class AndroidVM(packageName: String, dynarmic: Boolean, unicorn: Boolean): Closeable {
|
||||
internal val emulator = AndroidEmulatorBuilder
|
||||
.for64Bit()
|
||||
.setProcessName(packageName)
|
||||
.apply {
|
||||
if (dynarmic) addBackendFactory(DynarmicFactory(true))
|
||||
if (unicorn) addBackendFactory(Unicorn2Factory(true))
|
||||
//if (unicorn) addBackendFactory(KvmFactory(true))
|
||||
}
|
||||
.build()!!
|
||||
protected val memory = emulator.memory!!
|
||||
internal val vm = emulator.createDalvikVM()!!
|
||||
|
||||
init {
|
||||
if (CONFIG.unidbg.debug) {
|
||||
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog")
|
||||
System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "debug")
|
||||
LogFactory.getFactory()
|
||||
.attributeNames.forEach { println(it) }
|
||||
}
|
||||
vm.setVerbose(CONFIG.unidbg.debug)
|
||||
val syscall = emulator.syscallHandler
|
||||
syscall.isVerbose = CONFIG.unidbg.debug
|
||||
syscall.setEnableThreadDispatcher(true)
|
||||
AndroidModule(emulator, vm).register(memory)
|
||||
}
|
||||
|
||||
fun loadLibrary(soFile: File): DalvikModule {
|
||||
val dm = vm.loadLibrary(soFile, false)
|
||||
dm.callJNI_OnLoad(emulator)
|
||||
return dm
|
||||
}
|
||||
|
||||
fun findClass(name: String, vararg interfaces: DvmClass): DvmClass {
|
||||
return vm.resolveClass(name, *interfaces)
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
this.emulator.close()
|
||||
}
|
||||
}
|
17
src/main/kotlin/moe/fuqiuluo/unidbg/vm/GlobalData.kt
Normal file
17
src/main/kotlin/moe/fuqiuluo/unidbg/vm/GlobalData.kt
Normal file
@ -0,0 +1,17 @@
|
||||
package moe.fuqiuluo.unidbg.vm
|
||||
|
||||
class GlobalData {
|
||||
private val cacheMap = hashMapOf<String, Any?>()
|
||||
|
||||
operator fun get(key: String): Any? {
|
||||
return cacheMap[key]
|
||||
}
|
||||
|
||||
operator fun set(key: String, any: Any?) {
|
||||
cacheMap[key] = any
|
||||
}
|
||||
|
||||
fun remove(key: String) = cacheMap.remove(key)
|
||||
|
||||
operator fun contains(key: String) = key in cacheMap
|
||||
}
|
161
src/main/kotlin/moe/fuqiuluo/utils/BytesUtil.kt
Normal file
161
src/main/kotlin/moe/fuqiuluo/utils/BytesUtil.kt
Normal file
@ -0,0 +1,161 @@
|
||||
package moe.fuqiuluo.utils
|
||||
|
||||
import kotlin.random.Random
|
||||
|
||||
val EMPTY_BYTE_ARRAY = byteArrayOf()
|
||||
|
||||
object BytesUtil {
|
||||
@JvmStatic
|
||||
fun byteMerger(first: ByteArray, second: ByteArray): ByteArray {
|
||||
val result = first.copyOf(first.size + second.size)
|
||||
System.arraycopy(second, 0, result, first.size, second.size)
|
||||
return result
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun int16ToBuf(i: Int): ByteArray {
|
||||
val out = ByteArray(2)
|
||||
out[1] = i.toByte()
|
||||
out[0] = (i shr 8).toByte()
|
||||
return out
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun int32ToBuf(i: Int): ByteArray {
|
||||
val out = ByteArray(4)
|
||||
out[3] = i.toByte()
|
||||
out[2] = (i shr 8).toByte()
|
||||
out[1] = (i shr 16).toByte()
|
||||
out[0] = (i shr 24).toByte()
|
||||
return out
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun int64ToBuf(j: Long): ByteArray {
|
||||
val out = ByteArray(8)
|
||||
out[7] = j.toInt().toByte()
|
||||
out[6] = ((j shr 8).toInt()).toByte()
|
||||
out[5] = ((j shr 16).toInt()).toByte()
|
||||
out[4] = ((j shr 24).toInt()).toByte()
|
||||
out[3] = ((j shr 32).toInt()).toByte()
|
||||
out[2] = ((j shr 40).toInt()).toByte()
|
||||
out[1] = ((j shr 48).toInt()).toByte()
|
||||
out[0] = ((j shr 56).toInt()).toByte()
|
||||
return out
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun int64ToBuf32(j: Long): ByteArray {
|
||||
val out = ByteArray(4)
|
||||
out[3] = j.toInt().toByte()
|
||||
out[2] = ((j shr 8).toInt()).toByte()
|
||||
out[1] = ((j shr 16).toInt()).toByte()
|
||||
out[0] = ((j shr 24).toInt()).toByte()
|
||||
return out
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun float2byte(f: Float): ByteArray {
|
||||
val fbit = java.lang.Float.floatToIntBits(f)
|
||||
val b = ByteArray(4)
|
||||
for (i in 0..3) {
|
||||
b[i] = (fbit shr 24 - i * 8).toByte()
|
||||
}
|
||||
val len = b.size
|
||||
val dest = ByteArray(len)
|
||||
System.arraycopy(b, 0, dest, 0, len)
|
||||
var temp: Byte
|
||||
for (i in 0 until len / 2) {
|
||||
temp = dest[i]
|
||||
dest[i] = dest[len - i - 1]
|
||||
dest[len - i - 1] = temp
|
||||
}
|
||||
return dest
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun doubleToByte(num: Double): ByteArray {
|
||||
val b = ByteArray(8)
|
||||
var l = java.lang.Double.doubleToLongBits(num)
|
||||
for (i in 0..7) {
|
||||
b[i] = l.toByte()
|
||||
l = l shr 8
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getDouble(b: ByteArray): Double {
|
||||
var m: Long = b[0].toLong()
|
||||
m = m and 0xff
|
||||
m = m or (b[1].toLong() shl 8)
|
||||
m = m and 0xffff
|
||||
m = m or (b[2].toLong() shl 16)
|
||||
m = m and 0xffffff
|
||||
m = m or (b[3].toLong() shl 24)
|
||||
m = m and 0xffffffffL
|
||||
m = m or (b[4].toLong() shl 32)
|
||||
m = m and 0xffffffffffL
|
||||
m = m or (b[5].toLong() shl 40)
|
||||
m = m and 0xffffffffffffL
|
||||
m = m or (b[6].toLong() shl 48)
|
||||
m = m and 0xffffffffffffffL
|
||||
m = m or (b[7].toLong() shl 56)
|
||||
return java.lang.Double.longBitsToDouble(m)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun byte2float(b: ByteArray, index: Int): Float {
|
||||
var l = b[index + 0].toInt()
|
||||
l = l and 0xff
|
||||
l = l or (b[index + 1].toLong() shl 8).toInt()
|
||||
l = l and 0xffff
|
||||
l = l or (b[index + 2].toLong() shl 16).toInt()
|
||||
l = l and 0xffffff
|
||||
l = l or (b[index + 3].toLong() shl 24).toInt()
|
||||
return java.lang.Float.intBitsToFloat(l)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun bufToInt8(bArr: ByteArray, i: Int): Int {
|
||||
return bArr[i].toInt() and 255
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun bufToInt16(bArr: ByteArray, i: Int): Int {
|
||||
return (bArr[i].toInt() shl 8 and 65280) + (bArr[i + 1].toInt() and 255)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun bufToInt32(bArr: ByteArray, i: Int = 0): Int {
|
||||
return (bArr[i].toInt() shl 24 and -16777216) +
|
||||
(bArr[i + 1] .toInt() shl 16 and 16711680) +
|
||||
(bArr[i + 2].toInt() shl 8 and 65280) +
|
||||
(bArr[i + 3].toInt() and 255)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun bufToInt64(bArr: ByteArray, i: Int): Long {
|
||||
return (bArr[i].toLong() shl 56 and -72057594037927936L) +
|
||||
(bArr[i + 1].toLong() shl 48 and 71776119061217280L) +
|
||||
(bArr[i + 2].toLong() shl 40 and 280375465082880L) +
|
||||
(bArr[i + 3].toLong() shl 32 and 1095216660480L) +
|
||||
(bArr[i + 4].toLong() shl 24 and 4278190080L) +
|
||||
(bArr[i + 5].toLong() shl 16 and 16711680) +
|
||||
(bArr[i + 6].toLong() shl 8 and 65280) +
|
||||
(bArr[i + 7].toLong() and 255)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun subByte(b: ByteArray, off: Int, length: Int): ByteArray? {
|
||||
if (b.isNotEmpty()) {
|
||||
val b1 = ByteArray(length)
|
||||
System.arraycopy(b, off, b1, 0, length)
|
||||
return b1
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun randomKey(size: Int) = Random.nextBytes(size)
|
||||
}
|
393
src/main/kotlin/moe/fuqiuluo/utils/MD5.kt
Normal file
393
src/main/kotlin/moe/fuqiuluo/utils/MD5.kt
Normal file
@ -0,0 +1,393 @@
|
||||
package moe.fuqiuluo.utils
|
||||
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.InputStream
|
||||
import java.io.UnsupportedEncodingException
|
||||
|
||||
class MD5 {
|
||||
private val buffer = ByteArray(64)
|
||||
private val count = LongArray(2)
|
||||
val digest = ByteArray(16)
|
||||
private val state = LongArray(4)
|
||||
fun getMD5(bArr: ByteArray): ByteArray {
|
||||
md5Init()
|
||||
md5Update(ByteArrayInputStream(bArr), bArr.size.toLong())
|
||||
md5Final()
|
||||
return digest
|
||||
}
|
||||
|
||||
fun getMD5(inputStream: InputStream, len: Long): ByteArray {
|
||||
md5Init()
|
||||
if (!md5Update(inputStream, len)) {
|
||||
return ByteArray(16)
|
||||
}
|
||||
md5Final()
|
||||
return digest
|
||||
}
|
||||
|
||||
init {
|
||||
md5Init()
|
||||
}
|
||||
|
||||
fun md5Init() {
|
||||
count[0] = 0
|
||||
count[1] = 0
|
||||
state[0] = 0x67452301
|
||||
state[1] = 4023233417L
|
||||
state[2] = 2562383102L
|
||||
state[3] = 0x10325476
|
||||
}
|
||||
|
||||
private fun F(j: Long, j2: Long, j3: Long): Long {
|
||||
return j and j2 or (j.inv() and j3)
|
||||
}
|
||||
|
||||
private fun G(j: Long, j2: Long, j3: Long): Long {
|
||||
return j and j3 or (j3.inv() and j2)
|
||||
}
|
||||
|
||||
private fun H(j: Long, j2: Long, j3: Long): Long {
|
||||
return j xor j2 xor j3
|
||||
}
|
||||
|
||||
private fun I(j: Long, j2: Long, j3: Long): Long {
|
||||
return j3.inv() or j xor j2
|
||||
}
|
||||
|
||||
private fun FF(j: Long, j2: Long, j3: Long, j4: Long, j5: Long, j6: Long, j7: Long): Long {
|
||||
val F = F(j2, j3, j4) + j5 + j7 + j
|
||||
return ((F.toInt() ushr (32 - j6).toInt()).toLong() or (F.toInt().toLong() shl j6.toInt())) + j2
|
||||
}
|
||||
|
||||
private fun GG(j: Long, j2: Long, j3: Long, j4: Long, j5: Long, j6: Long, j7: Long): Long {
|
||||
val G = G(j2, j3, j4) + j5 + j7 + j
|
||||
return ((G.toInt() ushr (32 - j6).toInt()).toLong() or (G.toInt().toLong() shl j6.toInt())) + j2
|
||||
}
|
||||
|
||||
private fun HH(j: Long, j2: Long, j3: Long, j4: Long, j5: Long, j6: Long, j7: Long): Long {
|
||||
val H = H(j2, j3, j4) + j5 + j7 + j
|
||||
return ((H.toInt() ushr (32 - j6).toInt()).toLong() or (H.toInt().toLong() shl j6.toInt())) + j2
|
||||
}
|
||||
|
||||
private fun II(j: Long, j2: Long, j3: Long, j4: Long, j5: Long, j6: Long, j7: Long): Long {
|
||||
val I = I(j2, j3, j4) + j5 + j7 + j
|
||||
return ((I.toInt() ushr (32 - j6).toInt()).toLong() or (I.toInt().toLong() shl j6.toInt())) + j2
|
||||
}
|
||||
|
||||
fun md5Update(inputStream: InputStream, j: Long): Boolean {
|
||||
var i: Int
|
||||
val bArr = ByteArray(64)
|
||||
var i2 = (count[0] ushr 3).toInt() and 63
|
||||
val jArr = count
|
||||
val j2 = jArr[0] + (j shl 3)
|
||||
jArr[0] = j2
|
||||
if (j2 < j shl 3) {
|
||||
val jArr2 = count
|
||||
jArr2[1] = jArr2[1] + 1
|
||||
}
|
||||
val jArr3 = count
|
||||
jArr3[1] = jArr3[1] + (j ushr 29)
|
||||
val i3 = 64 - i2
|
||||
if (j >= i3.toLong()) {
|
||||
val bArr2 = ByteArray(i3)
|
||||
try {
|
||||
inputStream.read(bArr2, 0, i3)
|
||||
md5Memcpy(buffer, bArr2, i2, 0, i3)
|
||||
md5Transform(buffer)
|
||||
i = i3
|
||||
while ((i + 63).toLong() < j) {
|
||||
i += try {
|
||||
inputStream.read(bArr)
|
||||
md5Transform(bArr)
|
||||
64
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
return false
|
||||
}
|
||||
}
|
||||
i2 = 0
|
||||
} catch (e2: Exception) {
|
||||
e2.printStackTrace()
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
i = 0
|
||||
}
|
||||
val bArr3 = ByteArray((j - i.toLong()).toInt())
|
||||
return try {
|
||||
inputStream.read(bArr3)
|
||||
md5Memcpy(buffer, bArr3, i2, 0, bArr3.size)
|
||||
true
|
||||
} catch (e3: Exception) {
|
||||
e3.printStackTrace()
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
private fun md5Update(bArr: ByteArray, i: Int) {
|
||||
var i2 = 0
|
||||
val bArr2 = ByteArray(64)
|
||||
var i3 = (count[0] ushr 3).toInt() and 63
|
||||
val jArr = count
|
||||
val j = jArr[0] + (i.toLong() shl 3)
|
||||
jArr[0] = j
|
||||
if (j < i.toLong() shl 3) {
|
||||
val jArr2 = count
|
||||
jArr2[1] = jArr2[1] + 1
|
||||
}
|
||||
val jArr3 = count
|
||||
jArr3[1] = jArr3[1] + (i ushr 29).toLong()
|
||||
var i4 = 64 - i3
|
||||
if (i >= i4) {
|
||||
md5Memcpy(buffer, bArr, i3, 0, i4)
|
||||
md5Transform(buffer)
|
||||
while (i4 + 63 < i) {
|
||||
md5Memcpy(bArr2, bArr, 0, i4, 64)
|
||||
md5Transform(bArr2)
|
||||
i4 += 64
|
||||
}
|
||||
i3 = 0
|
||||
i2 = i4
|
||||
}
|
||||
md5Memcpy(buffer, bArr, i3, i2, i - i2)
|
||||
}
|
||||
|
||||
fun md5Final() {
|
||||
val bArr = ByteArray(8)
|
||||
Encode(bArr, count, 8)
|
||||
val i = (count[0] ushr 3).toInt() and 63
|
||||
md5Update(PADDING, if (i < 56) 56 - i else 120 - i)
|
||||
md5Update(bArr, 8)
|
||||
Encode(digest, state, 16)
|
||||
}
|
||||
|
||||
private fun md5Memcpy(bArr: ByteArray, bArr2: ByteArray, i: Int, i2: Int, i3: Int) {
|
||||
if (i3 >= 0) System.arraycopy(bArr2, i2, bArr, i, i3)
|
||||
}
|
||||
|
||||
private fun md5Transform(bArr: ByteArray) {
|
||||
val j = state[0]
|
||||
val j2 = state[1]
|
||||
val j3 = state[2]
|
||||
val j4 = state[3]
|
||||
val jArr = LongArray(16)
|
||||
Decode(jArr, bArr, 64)
|
||||
val FF = FF(j, j2, j3, j4, jArr[0], 7, 3614090360L)
|
||||
val FF2 = FF(j4, FF, j2, j3, jArr[1], 12, 3905402710L)
|
||||
val FF3 = FF(j3, FF2, FF, j2, jArr[2], 17, 0x242070db)
|
||||
val FF4 = FF(j2, FF3, FF2, FF, jArr[3], 22, 3250441966L)
|
||||
val FF5 = FF(FF, FF4, FF3, FF2, jArr[4], 7, 4118548399L)
|
||||
val FF6 = FF(FF2, FF5, FF4, FF3, jArr[5], 12, 0x4787c62a)
|
||||
val FF7 = FF(FF3, FF6, FF5, FF4, jArr[6], 17, 2821735955L)
|
||||
val FF8 = FF(FF4, FF7, FF6, FF5, jArr[7], 22, 4249261313L)
|
||||
val FF9 = FF(FF5, FF8, FF7, FF6, jArr[8], 7, 0x698098d8)
|
||||
val FF10 = FF(FF6, FF9, FF8, FF7, jArr[9], 12, 2336552879L)
|
||||
val FF11 = FF(FF7, FF10, FF9, FF8, jArr[10], 17, 4294925233L)
|
||||
val FF12 = FF(FF8, FF11, FF10, FF9, jArr[11], 22, 2304563134L)
|
||||
val FF13 = FF(FF9, FF12, FF11, FF10, jArr[12], 7, 0x6b901122)
|
||||
val FF14 = FF(FF10, FF13, FF12, FF11, jArr[13], 12, 4254626195L)
|
||||
val FF15 = FF(FF11, FF14, FF13, FF12, jArr[14], 17, 2792965006L)
|
||||
val FF16 = FF(FF12, FF15, FF14, FF13, jArr[15], 22, 0x49b40821)
|
||||
val GG = GG(FF13, FF16, FF15, FF14, jArr[1], 5, 4129170786L)
|
||||
val GG2 = GG(FF14, GG, FF16, FF15, jArr[6], 9, 3225465664L)
|
||||
val GG3 = GG(FF15, GG2, GG, FF16, jArr[11], 14, 0x265e5a51)
|
||||
val GG4 = GG(FF16, GG3, GG2, GG, jArr[0], 20, 3921069994L)
|
||||
val GG5 = GG(GG, GG4, GG3, GG2, jArr[5], 5, 3593408605L)
|
||||
val GG6 = GG(GG2, GG5, GG4, GG3, jArr[10], 9, 0x02441453)
|
||||
val GG7 = GG(GG3, GG6, GG5, GG4, jArr[15], 14, 3634488961L)
|
||||
val GG8 = GG(GG4, GG7, GG6, GG5, jArr[4], 20, 3889429448L)
|
||||
val GG9 = GG(GG5, GG8, GG7, GG6, jArr[9], 5, 0x21e1cde6)
|
||||
val GG10 = GG(GG6, GG9, GG8, GG7, jArr[14], 9, 3275163606L)
|
||||
val GG11 = GG(GG7, GG10, GG9, GG8, jArr[3], 14, 4107603335L)
|
||||
val GG12 = GG(GG8, GG11, GG10, GG9, jArr[8], 20, 0x455a14ed)
|
||||
val GG13 = GG(GG9, GG12, GG11, GG10, jArr[13], 5, 2850285829L)
|
||||
val GG14 = GG(GG10, GG13, GG12, GG11, jArr[2], 9, 4243563512L)
|
||||
val GG15 = GG(GG11, GG14, GG13, GG12, jArr[7], 14, 0x676f02d9)
|
||||
val GG16 = GG(GG12, GG15, GG14, GG13, jArr[12], 20, 2368359562L)
|
||||
val HH = HH(GG13, GG16, GG15, GG14, jArr[5], 4, 4294588738L)
|
||||
val HH2 = HH(GG14, HH, GG16, GG15, jArr[8], 11, 2272392833L)
|
||||
val HH3 = HH(GG15, HH2, HH, GG16, jArr[11], 16, 0x6d9d6122)
|
||||
val HH4 = HH(GG16, HH3, HH2, HH, jArr[14], 23, 4259657740L)
|
||||
val HH5 = HH(HH, HH4, HH3, HH2, jArr[1], 4, 2763975236L)
|
||||
val HH6 = HH(HH2, HH5, HH4, HH3, jArr[4], 11, 0x4bdecfa9)
|
||||
val HH7 = HH(HH3, HH6, HH5, HH4, jArr[7], 16, 4139469664L)
|
||||
val HH8 = HH(HH4, HH7, HH6, HH5, jArr[10], 23, 3200236656L)
|
||||
val HH9 = HH(HH5, HH8, HH7, HH6, jArr[13], 4, 0x289b7ec6)
|
||||
val HH10 = HH(HH6, HH9, HH8, HH7, jArr[0], 11, 3936430074L)
|
||||
val HH11 = HH(HH7, HH10, HH9, HH8, jArr[3], 16, 3572445317L)
|
||||
val HH12 = HH(HH8, HH11, HH10, HH9, jArr[6], 23, 0x04881d05)
|
||||
val HH13 = HH(HH9, HH12, HH11, HH10, jArr[9], 4, 3654602809L)
|
||||
val HH14 = HH(HH10, HH13, HH12, HH11, jArr[12], 11, 3873151461L)
|
||||
val HH15 = HH(HH11, HH14, HH13, HH12, jArr[15], 16, 0x1fa27cf8)
|
||||
val HH16 = HH(HH12, HH15, HH14, HH13, jArr[2], 23, 3299628645L)
|
||||
val II = II(HH13, HH16, HH15, HH14, jArr[0], 6, 4096336452L)
|
||||
val II2 = II(HH14, II, HH16, HH15, jArr[7], 10, 0x432aff97)
|
||||
val II3 = II(HH15, II2, II, HH16, jArr[14], 15, 2878612391L)
|
||||
val II4 = II(HH16, II3, II2, II, jArr[5], 21, 4237533241L)
|
||||
val II5 = II(II, II4, II3, II2, jArr[12], 6, 0x655b59c3)
|
||||
val II6 = II(II2, II5, II4, II3, jArr[3], 10, 2399980690L)
|
||||
val II7 = II(II3, II6, II5, II4, jArr[10], 15, 4293915773L)
|
||||
val II8 = II(II4, II7, II6, II5, jArr[1], 21, 2240044497L)
|
||||
val II9 = II(II5, II8, II7, II6, jArr[8], 6, 0x6fa87e4f)
|
||||
val II10 = II(II6, II9, II8, II7, jArr[15], 10, 4264355552L)
|
||||
val II11 = II(II7, II10, II9, II8, jArr[6], 15, 2734768916L)
|
||||
val II12 = II(II8, II11, II10, II9, jArr[13], 21, 0x4e0811a1)
|
||||
val II13 = II(II9, II12, II11, II10, jArr[4], 6, 4149444226L)
|
||||
val II14 = II(II10, II13, II12, II11, jArr[11], 10, 3174756917L)
|
||||
val II15 = II(II11, II14, II13, II12, jArr[2], 15, 0x2ad7d2bb)
|
||||
val II16 = II(II12, II15, II14, II13, jArr[9], 21, 3951481745L)
|
||||
val jArr2 = state
|
||||
jArr2[0] = jArr2[0] + II13
|
||||
val jArr3 = state
|
||||
jArr3[1] = II16 + jArr3[1]
|
||||
val jArr4 = state
|
||||
jArr4[2] = jArr4[2] + II15
|
||||
val jArr5 = state
|
||||
jArr5[3] = jArr5[3] + II14
|
||||
}
|
||||
|
||||
private fun Encode(bArr: ByteArray, jArr: LongArray, i: Int) {
|
||||
var i2 = 0
|
||||
var i3 = 0
|
||||
while (i3 < i) {
|
||||
bArr[i3] = (jArr[i2] and 255L).toInt().toByte()
|
||||
bArr[i3 + 1] = (jArr[i2] ushr 8 and 255L).toInt().toByte()
|
||||
bArr[i3 + 2] = (jArr[i2] ushr 16 and 255L).toInt().toByte()
|
||||
bArr[i3 + 3] = (jArr[i2] ushr 24 and 255L).toInt().toByte()
|
||||
i2++
|
||||
i3 += 4
|
||||
}
|
||||
}
|
||||
|
||||
private fun Decode(jArr: LongArray, bArr: ByteArray, i: Int) {
|
||||
var i2 = 0
|
||||
var i3 = 0
|
||||
while (i3 < i) {
|
||||
jArr[i2] = b2iu(bArr[i3]) or (b2iu(bArr[i3 + 1]) shl 8) or (b2iu(
|
||||
bArr[i3 + 2]
|
||||
) shl 16) or (b2iu(bArr[i3 + 3]) shl 24)
|
||||
i2++
|
||||
i3 += 4
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
val PADDING = byteArrayOf(
|
||||
Byte.MIN_VALUE,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
)
|
||||
|
||||
fun b2iu(b: Byte): Long {
|
||||
return if (b < 0) (b.toInt() and 255).toLong() else b.toLong()
|
||||
}
|
||||
|
||||
fun byteHEX(b: Byte): String {
|
||||
val cArr = charArrayOf('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F')
|
||||
return String(charArrayOf(cArr[b.toInt() ushr 4 and 15], cArr[b.toInt() and 15]))
|
||||
}
|
||||
|
||||
fun toMD5Byte(bArr: ByteArray): ByteArray {
|
||||
return MD5().getMD5(bArr)
|
||||
}
|
||||
|
||||
fun toMD5Byte(str: String): ByteArray {
|
||||
val bytes: ByteArray
|
||||
bytes = try {
|
||||
str.toByteArray(charset("ISO8859_1"))
|
||||
} catch (e: UnsupportedEncodingException) {
|
||||
str.toByteArray()
|
||||
}
|
||||
return MD5().getMD5(bytes)
|
||||
}
|
||||
|
||||
fun toMD5Byte(inputStream: InputStream, size: Long): ByteArray {
|
||||
return MD5().getMD5(inputStream, size)
|
||||
}
|
||||
|
||||
fun toMD5(bArr: ByteArray): String {
|
||||
val md5 = MD5().getMD5(bArr)
|
||||
val str = StringBuilder()
|
||||
for (i in 0..15) {
|
||||
str.append(byteHEX(md5[i]))
|
||||
}
|
||||
return str.toString()
|
||||
}
|
||||
|
||||
fun toMD5(str: String): String {
|
||||
val bytes: ByteArray
|
||||
bytes = try {
|
||||
str.toByteArray(charset("ISO8859_1"))
|
||||
} catch (e: UnsupportedEncodingException) {
|
||||
str.toByteArray()
|
||||
}
|
||||
val md5 = MD5().getMD5(bytes)
|
||||
val str2 = StringBuilder()
|
||||
for (i in 0..15) {
|
||||
str2.append(byteHEX(md5[i]))
|
||||
}
|
||||
return str2.toString()
|
||||
}
|
||||
}
|
||||
}
|
96
src/main/kotlin/moe/fuqiuluo/utils/ZlibUtil.kt
Normal file
96
src/main/kotlin/moe/fuqiuluo/utils/ZlibUtil.kt
Normal file
@ -0,0 +1,96 @@
|
||||
package moe.fuqiuluo.utils
|
||||
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.IOException
|
||||
import java.util.zip.Deflater
|
||||
import java.util.zip.GZIPInputStream
|
||||
import java.util.zip.GZIPOutputStream
|
||||
import java.util.zip.Inflater
|
||||
|
||||
object ZlibUtil {
|
||||
@JvmStatic
|
||||
fun unCompress(inputByte: ByteArray?): ByteArray {
|
||||
var len: Int
|
||||
val infill = Inflater()
|
||||
infill.setInput(inputByte)
|
||||
val bos = ByteArrayOutputStream()
|
||||
val outByte = ByteArray(1024)
|
||||
try {
|
||||
while (!infill.finished()) {
|
||||
len = infill.inflate(outByte)
|
||||
if (len == 0) {
|
||||
break
|
||||
}
|
||||
bos.write(outByte, 0, len)
|
||||
}
|
||||
infill.end()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
} finally {
|
||||
try {
|
||||
bos.close()
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
return bos.toByteArray()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun compress(inputByte: ByteArray?): ByteArray {
|
||||
var len: Int
|
||||
val defile = Deflater()
|
||||
defile.setInput(inputByte)
|
||||
defile.finish()
|
||||
val bos = ByteArrayOutputStream()
|
||||
val outputByte = ByteArray(1024)
|
||||
try {
|
||||
while (!defile.finished()) {
|
||||
len = defile.deflate(outputByte)
|
||||
bos.write(outputByte, 0, len)
|
||||
}
|
||||
defile.end()
|
||||
} finally {
|
||||
try {
|
||||
bos.close()
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
return bos.toByteArray()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun gzip(bytes: ByteArray): ByteArray {
|
||||
var out = EMPTY_BYTE_ARRAY
|
||||
if (bytes.isNotEmpty()) {
|
||||
ByteArrayOutputStream().use {
|
||||
GZIPOutputStream(it).use {
|
||||
it.write(bytes)
|
||||
}
|
||||
out = it.toByteArray()
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun ungzip(bArr: ByteArray): ByteArray {
|
||||
val byteArrayOutputStream = ByteArrayOutputStream()
|
||||
try {
|
||||
val gZIPInputStream = GZIPInputStream(ByteArrayInputStream(bArr))
|
||||
val bArr2 = ByteArray(256)
|
||||
while (true) {
|
||||
val read = gZIPInputStream.read(bArr2)
|
||||
if (read < 0) {
|
||||
break
|
||||
}
|
||||
byteArrayOutputStream.write(bArr2, 0, read)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return byteArrayOutputStream.toByteArray()
|
||||
}
|
||||
}
|
5
src/test/java/test.java
Normal file
5
src/test/java/test.java
Normal file
@ -0,0 +1,5 @@
|
||||
public class test {
|
||||
public static void main(String[] args) {
|
||||
MainKt.main(new String[]{"--basePath=E:\\Projects\\Astral-QSignigngnn\\out\\artifacts\\unidbg_fetch_qsign_jar\\txlib\\8.9.73"});
|
||||
}
|
||||
}
|
BIN
txlib/.DS_Store
vendored
Normal file
BIN
txlib/.DS_Store
vendored
Normal file
Binary file not shown.
19
txlib/3.5.1/config.json
Normal file
19
txlib/3.5.1/config.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"server": {
|
||||
"host": "0.0.0.0",
|
||||
"port": 8080
|
||||
},
|
||||
"key": "114514",
|
||||
"auto_register": true,
|
||||
"protocol": {
|
||||
"package_name": "com.tencent.tim",
|
||||
"qua": "V1_AND_SQ_8.3.9_351_TIM_D",
|
||||
"version": "3.5.1",
|
||||
"code": "1298"
|
||||
},
|
||||
"unidbg": {
|
||||
"dynarmic": false,
|
||||
"unicorn": true,
|
||||
"debug": true
|
||||
}
|
||||
}
|
69
txlib/3.5.1/dtconfig.json
Normal file
69
txlib/3.5.1/dtconfig.json
Normal file
@ -0,0 +1,69 @@
|
||||
{"en":[
|
||||
[2,5,0,14,15,3,10,1,13,12,7,11,6,8,4,9],
|
||||
[14,13,12,5,7,15,10,11,4,6,2,3,0,8,9,1],
|
||||
[10,5,6,13,15,3,11,8,2,9,0,14,12,4,7,1],
|
||||
[6,14,3,0,9,10,8,13,4,11,15,5,2,1,12,7],
|
||||
[2,6,11,12,15,7,5,8,1,13,4,0,3,14,9,10],
|
||||
[14,0,6,3,2,12,4,15,8,1,5,9,10,7,11,13],
|
||||
[10,7,0,13,2,4,1,15,5,12,14,6,8,9,11,3],
|
||||
[5,1,15,7,2,10,11,12,13,0,14,6,3,4,8,9],
|
||||
[2,7,5,10,14,3,1,12,4,11,9,6,15,0,13,8],
|
||||
[13,2,6,7,9,1,5,4,8,10,12,15,0,14,11,3],
|
||||
[9,10,6,15,2,12,5,13,0,3,1,8,7,11,14,4],
|
||||
[5,3,11,15,8,14,1,9,6,0,4,7,13,2,12,10],
|
||||
[1,11,5,6,15,8,7,13,2,4,9,14,3,12,0,10],
|
||||
[13,3,15,14,7,0,2,5,12,8,4,10,9,6,1,11],
|
||||
[9,12,10,5,15,2,7,13,4,11,3,14,6,1,0,8],
|
||||
[5,4,1,13,7,2,12,8,14,0,3,11,9,15,10,6],
|
||||
[1,12,15,5,2,0,10,7,14,8,3,4,13,9,6,11],
|
||||
[13,5,9,12,7,4,14,10,3,0,2,8,11,6,1,15],
|
||||
[9,13,3,4,15,1,14,0,5,11,10,8,7,12,6,2],
|
||||
[5,0,14,11,7,10,2,9,4,6,3,1,15,8,12,13],
|
||||
[1,14,8,3,0,6,10,7,9,15,2,5,11,13,4,12],
|
||||
[13,6,3,10,1,15,9,0,7,12,2,8,5,14,4,11],
|
||||
[9,14,13,2,15,5,4,11,0,6,1,12,8,10,3,7],
|
||||
[4,9,14,7,8,12,2,5,10,13,3,6,0,1,11,15],
|
||||
[0,1,9,15,12,11,4,14,5,10,6,8,3,7,13,2],
|
||||
[12,9,3,7,8,1,10,6,11,0,5,2,13,4,14,15],
|
||||
[8,2,13,14,5,15,3,7,10,4,6,11,12,1,0,9],
|
||||
[4,10,8,6,2,5,15,9,14,0,13,7,3,12,1,11],
|
||||
[0,2,1,13,15,11,10,4,7,9,14,8,3,6,5,12],
|
||||
[12,11,13,5,7,0,15,6,4,3,2,10,8,1,9,14],
|
||||
[8,3,7,12,15,9,0,1,14,5,4,2,13,11,10,6],
|
||||
[3,14,8,2,0,1,11,6,15,12,13,10,9,4,7,5]
|
||||
],
|
||||
"de": [
|
||||
[11,0,9,6,14,8,4,1,2,7,10,3,15,12,13,5],
|
||||
[11,9,3,2,6,15,5,13,12,4,10,14,8,0,7,1],
|
||||
[12,10,14,7,2,13,11,5,0,3,1,15,4,6,8,9],
|
||||
[8,13,1,15,0,7,11,6,14,5,3,10,4,12,2,9],
|
||||
[0,13,3,12,9,11,7,6,2,5,1,15,4,14,10,8],
|
||||
[12,2,10,1,5,7,14,9,8,6,4,11,0,15,13,3],
|
||||
[13,11,14,10,8,5,4,3,0,15,9,1,12,2,7,6],
|
||||
[15,6,12,1,0,10,13,14,2,11,4,7,5,8,3,9],
|
||||
[0,6,2,8,9,10,3,7,12,5,11,15,1,13,14,4],
|
||||
[2,7,10,5,1,9,12,15,13,6,4,8,0,3,14,11],
|
||||
[15,14,7,12,13,3,6,2,0,4,8,10,1,9,5,11],
|
||||
[14,9,7,11,0,1,4,13,15,3,5,12,2,10,8,6],
|
||||
[0,8,12,11,3,14,15,13,7,4,10,9,2,1,6,5],
|
||||
[3,5,11,9,12,1,2,8,14,4,13,15,0,6,7,10],
|
||||
[9,10,2,14,6,4,8,13,0,12,5,3,11,7,1,15],
|
||||
[13,8,3,11,0,14,1,12,7,4,5,2,10,6,15,9],
|
||||
[0,14,6,4,3,2,9,10,8,5,13,11,15,7,1,12],
|
||||
[10,4,6,9,12,7,15,1,3,2,13,5,0,14,11,8],
|
||||
[6,9,12,10,5,8,15,11,0,7,2,14,13,4,3,1],
|
||||
[2,6,8,4,0,12,15,1,9,3,10,14,7,5,11,13],
|
||||
[0,2,10,6,12,8,11,7,3,4,13,9,5,15,1,14],
|
||||
[5,14,7,11,6,2,9,10,4,3,1,0,8,15,12,13],
|
||||
[7,11,1,12,9,4,6,0,5,10,2,8,14,15,3,13],
|
||||
[9,10,3,0,14,2,7,6,8,11,4,1,12,15,5,13],
|
||||
[2,9,4,1,6,11,13,8,10,14,12,15,5,3,7,0],
|
||||
[1,6,4,8,3,14,13,9,15,12,2,0,5,11,7,10],
|
||||
[5,2,9,8,1,12,10,0,4,7,6,11,3,15,14,13],
|
||||
[8,11,0,9,5,2,10,6,4,15,3,7,12,14,1,13],
|
||||
[5,14,8,11,9,4,15,1,7,3,10,12,6,13,0,2],
|
||||
[2,5,3,4,9,15,8,11,6,10,0,14,12,7,13,1],
|
||||
[14,15,8,6,2,10,0,1,3,13,5,11,7,9,4,12],
|
||||
[15,6,0,8,7,13,12,9,10,14,3,4,5,11,1,2]
|
||||
]
|
||||
}
|
BIN
txlib/3.5.1/libfekit.so
Normal file
BIN
txlib/3.5.1/libfekit.so
Normal file
Binary file not shown.
BIN
txlib/3.5.1/libpoxy.so
Normal file
BIN
txlib/3.5.1/libpoxy.so
Normal file
Binary file not shown.
BIN
txlib/3.5.1/libwtecdh.so
Normal file
BIN
txlib/3.5.1/libwtecdh.so
Normal file
Binary file not shown.
19
txlib/3.5.2/config.json
Normal file
19
txlib/3.5.2/config.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"server": {
|
||||
"host": "0.0.0.0",
|
||||
"port": 8080
|
||||
},
|
||||
"key": "114514",
|
||||
"auto_register": true,
|
||||
"protocol": {
|
||||
"package_name": "com.tencent.tim",
|
||||
"qua": "V1_AND_SQ_8.3.9_352_TIM_D",
|
||||
"version": "3.5.2",
|
||||
"code": "1308"
|
||||
},
|
||||
"unidbg": {
|
||||
"dynarmic": false,
|
||||
"unicorn": true,
|
||||
"debug": true
|
||||
}
|
||||
}
|
69
txlib/3.5.2/dtconfig.json
Normal file
69
txlib/3.5.2/dtconfig.json
Normal file
@ -0,0 +1,69 @@
|
||||
{"en":[
|
||||
[2,5,0,14,15,3,10,1,13,12,7,11,6,8,4,9],
|
||||
[14,13,12,5,7,15,10,11,4,6,2,3,0,8,9,1],
|
||||
[10,5,6,13,15,3,11,8,2,9,0,14,12,4,7,1],
|
||||
[6,14,3,0,9,10,8,13,4,11,15,5,2,1,12,7],
|
||||
[2,6,11,12,15,7,5,8,1,13,4,0,3,14,9,10],
|
||||
[14,0,6,3,2,12,4,15,8,1,5,9,10,7,11,13],
|
||||
[10,7,0,13,2,4,1,15,5,12,14,6,8,9,11,3],
|
||||
[5,1,15,7,2,10,11,12,13,0,14,6,3,4,8,9],
|
||||
[2,7,5,10,14,3,1,12,4,11,9,6,15,0,13,8],
|
||||
[13,2,6,7,9,1,5,4,8,10,12,15,0,14,11,3],
|
||||
[9,10,6,15,2,12,5,13,0,3,1,8,7,11,14,4],
|
||||
[5,3,11,15,8,14,1,9,6,0,4,7,13,2,12,10],
|
||||
[1,11,5,6,15,8,7,13,2,4,9,14,3,12,0,10],
|
||||
[13,3,15,14,7,0,2,5,12,8,4,10,9,6,1,11],
|
||||
[9,12,10,5,15,2,7,13,4,11,3,14,6,1,0,8],
|
||||
[5,4,1,13,7,2,12,8,14,0,3,11,9,15,10,6],
|
||||
[1,12,15,5,2,0,10,7,14,8,3,4,13,9,6,11],
|
||||
[13,5,9,12,7,4,14,10,3,0,2,8,11,6,1,15],
|
||||
[9,13,3,4,15,1,14,0,5,11,10,8,7,12,6,2],
|
||||
[5,0,14,11,7,10,2,9,4,6,3,1,15,8,12,13],
|
||||
[1,14,8,3,0,6,10,7,9,15,2,5,11,13,4,12],
|
||||
[13,6,3,10,1,15,9,0,7,12,2,8,5,14,4,11],
|
||||
[9,14,13,2,15,5,4,11,0,6,1,12,8,10,3,7],
|
||||
[4,9,14,7,8,12,2,5,10,13,3,6,0,1,11,15],
|
||||
[0,1,9,15,12,11,4,14,5,10,6,8,3,7,13,2],
|
||||
[12,9,3,7,8,1,10,6,11,0,5,2,13,4,14,15],
|
||||
[8,2,13,14,5,15,3,7,10,4,6,11,12,1,0,9],
|
||||
[4,10,8,6,2,5,15,9,14,0,13,7,3,12,1,11],
|
||||
[0,2,1,13,15,11,10,4,7,9,14,8,3,6,5,12],
|
||||
[12,11,13,5,7,0,15,6,4,3,2,10,8,1,9,14],
|
||||
[8,3,7,12,15,9,0,1,14,5,4,2,13,11,10,6],
|
||||
[3,14,8,2,0,1,11,6,15,12,13,10,9,4,7,5]
|
||||
],
|
||||
"de": [
|
||||
[11,0,9,6,14,8,4,1,2,7,10,3,15,12,13,5],
|
||||
[11,9,3,2,6,15,5,13,12,4,10,14,8,0,7,1],
|
||||
[12,10,14,7,2,13,11,5,0,3,1,15,4,6,8,9],
|
||||
[8,13,1,15,0,7,11,6,14,5,3,10,4,12,2,9],
|
||||
[0,13,3,12,9,11,7,6,2,5,1,15,4,14,10,8],
|
||||
[12,2,10,1,5,7,14,9,8,6,4,11,0,15,13,3],
|
||||
[13,11,14,10,8,5,4,3,0,15,9,1,12,2,7,6],
|
||||
[15,6,12,1,0,10,13,14,2,11,4,7,5,8,3,9],
|
||||
[0,6,2,8,9,10,3,7,12,5,11,15,1,13,14,4],
|
||||
[2,7,10,5,1,9,12,15,13,6,4,8,0,3,14,11],
|
||||
[15,14,7,12,13,3,6,2,0,4,8,10,1,9,5,11],
|
||||
[14,9,7,11,0,1,4,13,15,3,5,12,2,10,8,6],
|
||||
[0,8,12,11,3,14,15,13,7,4,10,9,2,1,6,5],
|
||||
[3,5,11,9,12,1,2,8,14,4,13,15,0,6,7,10],
|
||||
[9,10,2,14,6,4,8,13,0,12,5,3,11,7,1,15],
|
||||
[13,8,3,11,0,14,1,12,7,4,5,2,10,6,15,9],
|
||||
[0,14,6,4,3,2,9,10,8,5,13,11,15,7,1,12],
|
||||
[10,4,6,9,12,7,15,1,3,2,13,5,0,14,11,8],
|
||||
[6,9,12,10,5,8,15,11,0,7,2,14,13,4,3,1],
|
||||
[2,6,8,4,0,12,15,1,9,3,10,14,7,5,11,13],
|
||||
[0,2,10,6,12,8,11,7,3,4,13,9,5,15,1,14],
|
||||
[5,14,7,11,6,2,9,10,4,3,1,0,8,15,12,13],
|
||||
[7,11,1,12,9,4,6,0,5,10,2,8,14,15,3,13],
|
||||
[9,10,3,0,14,2,7,6,8,11,4,1,12,15,5,13],
|
||||
[2,9,4,1,6,11,13,8,10,14,12,15,5,3,7,0],
|
||||
[1,6,4,8,3,14,13,9,15,12,2,0,5,11,7,10],
|
||||
[5,2,9,8,1,12,10,0,4,7,6,11,3,15,14,13],
|
||||
[8,11,0,9,5,2,10,6,4,15,3,7,12,14,1,13],
|
||||
[5,14,8,11,9,4,15,1,7,3,10,12,6,13,0,2],
|
||||
[2,5,3,4,9,15,8,11,6,10,0,14,12,7,13,1],
|
||||
[14,15,8,6,2,10,0,1,3,13,5,11,7,9,4,12],
|
||||
[15,6,0,8,7,13,12,9,10,14,3,4,5,11,1,2]
|
||||
]
|
||||
}
|
BIN
txlib/3.5.2/libfekit.so
Normal file
BIN
txlib/3.5.2/libfekit.so
Normal file
Binary file not shown.
BIN
txlib/3.5.2/libpoxy.so
Normal file
BIN
txlib/3.5.2/libpoxy.so
Normal file
Binary file not shown.
BIN
txlib/3.5.2/libwtecdh.so
Normal file
BIN
txlib/3.5.2/libwtecdh.so
Normal file
Binary file not shown.
19
txlib/8.9.63/config.json
Normal file
19
txlib/8.9.63/config.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"server": {
|
||||
"host": "0.0.0.0",
|
||||
"port": 8080
|
||||
},
|
||||
"key": "114514",
|
||||
"auto_register": false,
|
||||
"protocol": {
|
||||
"package_name": "com.tencent.mobileqq",
|
||||
"qua": "V1_AND_SQ_8.9.63_4194_YYB_D",
|
||||
"version": "8.9.63",
|
||||
"code": "4194"
|
||||
},
|
||||
"unidbg": {
|
||||
"dynarmic": false,
|
||||
"unicorn": true,
|
||||
"debug": false
|
||||
}
|
||||
}
|
70
txlib/8.9.63/dtconfig.json
Normal file
70
txlib/8.9.63/dtconfig.json
Normal file
@ -0,0 +1,70 @@
|
||||
{
|
||||
"en": [
|
||||
[2, 5, 0, 14, 15, 3, 10, 1, 13, 12, 7, 11, 6, 8, 4, 9],
|
||||
[14, 13, 12, 5, 7, 15, 10, 11, 4, 6, 2, 3, 0, 8, 9, 1],
|
||||
[10, 5, 6, 13, 15, 3, 11, 8, 2, 9, 0, 14, 12, 4, 7, 1],
|
||||
[6, 14, 3, 0, 9, 10, 8, 13, 4, 11, 15, 5, 2, 1, 12, 7],
|
||||
[2, 6, 11, 12, 15, 7, 5, 8, 1, 13, 4, 0, 3, 14, 9, 10],
|
||||
[14, 0, 6, 3, 2, 12, 4, 15, 8, 1, 5, 9, 10, 7, 11, 13],
|
||||
[10, 7, 0, 13, 2, 4, 1, 15, 5, 12, 14, 6, 8, 9, 11, 3],
|
||||
[5, 1, 15, 7, 2, 10, 11, 12, 13, 0, 14, 6, 3, 4, 8, 9],
|
||||
[2, 7, 5, 10, 14, 3, 1, 12, 4, 11, 9, 6, 15, 0, 13, 8],
|
||||
[13, 2, 6, 7, 9, 1, 5, 4, 8, 10, 12, 15, 0, 14, 11, 3],
|
||||
[9, 10, 6, 15, 2, 12, 5, 13, 0, 3, 1, 8, 7, 11, 14, 4],
|
||||
[5, 3, 11, 15, 8, 14, 1, 9, 6, 0, 4, 7, 13, 2, 12, 10],
|
||||
[1, 11, 5, 6, 15, 8, 7, 13, 2, 4, 9, 14, 3, 12, 0, 10],
|
||||
[13, 3, 15, 14, 7, 0, 2, 5, 12, 8, 4, 10, 9, 6, 1, 11],
|
||||
[9, 12, 10, 5, 15, 2, 7, 13, 4, 11, 3, 14, 6, 1, 0, 8],
|
||||
[5, 4, 1, 13, 7, 2, 12, 8, 14, 0, 3, 11, 9, 15, 10, 6],
|
||||
[1, 12, 15, 5, 2, 0, 10, 7, 14, 8, 3, 4, 13, 9, 6, 11],
|
||||
[13, 5, 9, 12, 7, 4, 14, 10, 3, 0, 2, 8, 11, 6, 1, 15],
|
||||
[9, 13, 3, 4, 15, 1, 14, 0, 5, 11, 10, 8, 7, 12, 6, 2],
|
||||
[5, 0, 14, 11, 7, 10, 2, 9, 4, 6, 3, 1, 15, 8, 12, 13],
|
||||
[1, 14, 8, 3, 0, 6, 10, 7, 9, 15, 2, 5, 11, 13, 4, 12],
|
||||
[13, 6, 3, 10, 1, 15, 9, 0, 7, 12, 2, 8, 5, 14, 4, 11],
|
||||
[9, 14, 13, 2, 15, 5, 4, 11, 0, 6, 1, 12, 8, 10, 3, 7],
|
||||
[4, 9, 14, 7, 8, 12, 2, 5, 10, 13, 3, 6, 0, 1, 11, 15],
|
||||
[0, 1, 9, 15, 12, 11, 4, 14, 5, 10, 6, 8, 3, 7, 13, 2],
|
||||
[12, 9, 3, 7, 8, 1, 10, 6, 11, 0, 5, 2, 13, 4, 14, 15],
|
||||
[8, 2, 13, 14, 5, 15, 3, 7, 10, 4, 6, 11, 12, 1, 0, 9],
|
||||
[4, 10, 8, 6, 2, 5, 15, 9, 14, 0, 13, 7, 3, 12, 1, 11],
|
||||
[0, 2, 1, 13, 15, 11, 10, 4, 7, 9, 14, 8, 3, 6, 5, 12],
|
||||
[12, 11, 13, 5, 7, 0, 15, 6, 4, 3, 2, 10, 8, 1, 9, 14],
|
||||
[8, 3, 7, 12, 15, 9, 0, 1, 14, 5, 4, 2, 13, 11, 10, 6],
|
||||
[3, 14, 8, 2, 0, 1, 11, 6, 15, 12, 13, 10, 9, 4, 7, 5]
|
||||
],
|
||||
"de": [
|
||||
[11, 0, 9, 6, 14, 8, 4, 1, 2, 7, 10, 3, 15, 12, 13, 5],
|
||||
[11, 9, 3, 2, 6, 15, 5, 13, 12, 4, 10, 14, 8, 0, 7, 1],
|
||||
[12, 10, 14, 7, 2, 13, 11, 5, 0, 3, 1, 15, 4, 6, 8, 9],
|
||||
[8, 13, 1, 15, 0, 7, 11, 6, 14, 5, 3, 10, 4, 12, 2, 9],
|
||||
[0, 13, 3, 12, 9, 11, 7, 6, 2, 5, 1, 15, 4, 14, 10, 8],
|
||||
[12, 2, 10, 1, 5, 7, 14, 9, 8, 6, 4, 11, 0, 15, 13, 3],
|
||||
[13, 11, 14, 10, 8, 5, 4, 3, 0, 15, 9, 1, 12, 2, 7, 6],
|
||||
[15, 6, 12, 1, 0, 10, 13, 14, 2, 11, 4, 7, 5, 8, 3, 9],
|
||||
[0, 6, 2, 8, 9, 10, 3, 7, 12, 5, 11, 15, 1, 13, 14, 4],
|
||||
[2, 7, 10, 5, 1, 9, 12, 15, 13, 6, 4, 8, 0, 3, 14, 11],
|
||||
[15, 14, 7, 12, 13, 3, 6, 2, 0, 4, 8, 10, 1, 9, 5, 11],
|
||||
[14, 9, 7, 11, 0, 1, 4, 13, 15, 3, 5, 12, 2, 10, 8, 6],
|
||||
[0, 8, 12, 11, 3, 14, 15, 13, 7, 4, 10, 9, 2, 1, 6, 5],
|
||||
[3, 5, 11, 9, 12, 1, 2, 8, 14, 4, 13, 15, 0, 6, 7, 10],
|
||||
[9, 10, 2, 14, 6, 4, 8, 13, 0, 12, 5, 3, 11, 7, 1, 15],
|
||||
[13, 8, 3, 11, 0, 14, 1, 12, 7, 4, 5, 2, 10, 6, 15, 9],
|
||||
[0, 14, 6, 4, 3, 2, 9, 10, 8, 5, 13, 11, 15, 7, 1, 12],
|
||||
[10, 4, 6, 9, 12, 7, 15, 1, 3, 2, 13, 5, 0, 14, 11, 8],
|
||||
[6, 9, 12, 10, 5, 8, 15, 11, 0, 7, 2, 14, 13, 4, 3, 1],
|
||||
[2, 6, 8, 4, 0, 12, 15, 1, 9, 3, 10, 14, 7, 5, 11, 13],
|
||||
[0, 2, 10, 6, 12, 8, 11, 7, 3, 4, 13, 9, 5, 15, 1, 14],
|
||||
[5, 14, 7, 11, 6, 2, 9, 10, 4, 3, 1, 0, 8, 15, 12, 13],
|
||||
[7, 11, 1, 12, 9, 4, 6, 0, 5, 10, 2, 8, 14, 15, 3, 13],
|
||||
[9, 10, 3, 0, 14, 2, 7, 6, 8, 11, 4, 1, 12, 15, 5, 13],
|
||||
[2, 9, 4, 1, 6, 11, 13, 8, 10, 14, 12, 15, 5, 3, 7, 0],
|
||||
[1, 6, 4, 8, 3, 14, 13, 9, 15, 12, 2, 0, 5, 11, 7, 10],
|
||||
[5, 2, 9, 8, 1, 12, 10, 0, 4, 7, 6, 11, 3, 15, 14, 13],
|
||||
[8, 11, 0, 9, 5, 2, 10, 6, 4, 15, 3, 7, 12, 14, 1, 13],
|
||||
[5, 14, 8, 11, 9, 4, 15, 1, 7, 3, 10, 12, 6, 13, 0, 2],
|
||||
[2, 5, 3, 4, 9, 15, 8, 11, 6, 10, 0, 14, 12, 7, 13, 1],
|
||||
[14, 15, 8, 6, 2, 10, 0, 1, 3, 13, 5, 11, 7, 9, 4, 12],
|
||||
[15, 6, 0, 8, 7, 13, 12, 9, 10, 14, 3, 4, 5, 11, 1, 2]
|
||||
]
|
||||
}
|
BIN
txlib/8.9.63/libfekit.so
Normal file
BIN
txlib/8.9.63/libfekit.so
Normal file
Binary file not shown.
22
txlib/8.9.68/config.json
Normal file
22
txlib/8.9.68/config.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"server": {
|
||||
"host": "0.0.0.0",
|
||||
"port": 8080
|
||||
},
|
||||
"key": "114514",
|
||||
"auto_register": false,
|
||||
"protocol": {
|
||||
"package_name": "com.tencent.mobileqq",
|
||||
"qua": "V1_AND_SQ_8.9.68_4264_YYB_D",
|
||||
"version": "8.9.68",
|
||||
"code": "4264"
|
||||
},
|
||||
"unidbg": {
|
||||
"dynarmic": false,
|
||||
"unicorn": true,
|
||||
"debug": true
|
||||
},
|
||||
"black_list": [
|
||||
1008611
|
||||
]
|
||||
}
|
70
txlib/8.9.68/dtconfig.json
Normal file
70
txlib/8.9.68/dtconfig.json
Normal file
@ -0,0 +1,70 @@
|
||||
{
|
||||
"en": [
|
||||
[15, 10, 13, 4, 0, 5, 3, 1, 11, 12, 7, 2, 14, 6, 9, 8],
|
||||
[12, 1, 13, 4, 14, 9, 8, 6, 5, 3, 10, 7, 11, 2, 0, 15],
|
||||
[10, 5, 14, 0, 9, 1, 7, 4, 11, 8, 3, 15, 12, 6, 13, 2],
|
||||
[7, 11, 2, 14, 3, 10, 1, 8, 0, 15, 9, 6, 13, 4, 5, 12],
|
||||
[5, 15, 1, 2, 4, 13, 7, 8, 3, 6, 11, 0, 9, 10, 12, 14],
|
||||
[2, 5, 0, 9, 3, 15, 11, 7, 8, 13, 10, 4, 1, 14, 6, 12],
|
||||
[15, 12, 6, 14, 7, 2, 0, 10, 11, 13, 3, 5, 1, 4, 9, 8],
|
||||
[13, 2, 0, 1, 8, 10, 4, 14, 11, 12, 7, 3, 15, 9, 5, 6],
|
||||
[10, 6, 7, 8, 9, 3, 15, 1, 2, 5, 11, 12, 13, 14, 0, 4],
|
||||
[8, 10, 4, 2, 13, 15, 12, 7, 6, 3, 14, 0, 1, 5, 9, 11],
|
||||
[5, 7, 12, 6, 0, 2, 14, 3, 1, 13, 9, 10, 15, 11, 8, 4],
|
||||
[2, 7, 12, 1, 9, 10, 4, 8, 13, 11, 6, 3, 0, 5, 15, 14],
|
||||
[0, 11, 9, 3, 12, 8, 14, 13, 5, 4, 10, 15, 7, 2, 1, 6],
|
||||
[13, 1, 0, 12, 6, 14, 7, 11, 3, 10, 2, 5, 15, 8, 4, 9],
|
||||
[10, 7, 5, 1, 0, 6, 9, 13, 14, 8, 3, 15, 11, 12, 4, 2],
|
||||
[7, 14, 5, 13, 4, 11, 15, 10, 8, 0, 12, 2, 3, 1, 9, 6],
|
||||
[5, 2, 1, 12, 10, 14, 4, 15, 9, 8, 6, 0, 13, 11, 7, 3],
|
||||
[2, 8, 6, 5, 1, 3, 14, 10, 0, 12, 4, 13, 7, 15, 9, 11],
|
||||
[0, 12, 3, 11, 10, 5, 4, 14, 9, 7, 1, 2, 13, 8, 6, 15],
|
||||
[13, 3, 7, 11, 4, 10, 15, 0, 5, 2, 6, 12, 14, 9, 8, 1],
|
||||
[11, 7, 4, 6, 3, 0, 14, 5, 2, 9, 13, 15, 10, 8, 12, 1],
|
||||
[8, 13, 0, 11, 4, 1, 3, 9, 10, 15, 12, 5, 14, 7, 6, 2],
|
||||
[5, 3, 11, 10, 13, 6, 1, 15, 12, 8, 2, 4, 9, 14, 0, 7],
|
||||
[3, 7, 9, 6, 0, 5, 10, 14, 1, 13, 11, 4, 2, 15, 8, 12],
|
||||
[0, 14, 12, 15, 11, 1, 3, 10, 8, 2, 9, 6, 13, 5, 7, 4],
|
||||
[13, 4, 8, 6, 3, 7, 10, 0, 14, 5, 9, 1, 15, 12, 2, 11],
|
||||
[11, 8, 13, 5, 3, 14, 6, 9, 1, 0, 12, 15, 2, 7, 10, 4],
|
||||
[8, 14, 13, 10, 7, 3, 0, 6, 11, 12, 5, 1, 15, 4, 9, 2],
|
||||
[6, 2, 14, 10, 15, 1, 5, 8, 9, 7, 11, 13, 4, 3, 12, 0],
|
||||
[3, 9, 2, 4, 5, 8, 1, 7, 11, 10, 12, 0, 15, 13, 6, 14],
|
||||
[0, 15, 6, 14, 11, 2, 1, 3, 13, 4, 10, 12, 7, 5, 8, 9],
|
||||
[13, 5, 10, 7, 2, 4, 11, 0, 14, 8, 1, 9, 3, 12, 6, 15]
|
||||
],
|
||||
"de": [
|
||||
[13, 7, 12, 2, 14, 11, 3, 8, 5, 9, 10, 6, 1, 15, 0, 4],
|
||||
[13, 8, 4, 1, 9, 15, 12, 2, 11, 7, 10, 0, 3, 5, 6, 14],
|
||||
[7, 3, 9, 13, 2, 6, 14, 1, 5, 0, 8, 4, 11, 12, 10, 15],
|
||||
[9, 5, 14, 13, 7, 10, 0, 6, 2, 15, 3, 4, 11, 1, 8, 12],
|
||||
[11, 1, 4, 9, 0, 2, 6, 10, 5, 8, 14, 15, 7, 3, 12, 13],
|
||||
[3, 0, 12, 10, 5, 13, 15, 1, 11, 2, 7, 4, 8, 9, 6, 14],
|
||||
[1, 13, 15, 12, 10, 6, 11, 4, 5, 3, 7, 9, 14, 2, 0, 8],
|
||||
[3, 8, 1, 11, 6, 4, 13, 10, 15, 7, 2, 5, 0, 14, 12, 9],
|
||||
[7, 6, 13, 9, 5, 14, 3, 15, 1, 0, 10, 4, 11, 8, 2, 12],
|
||||
[7, 14, 15, 5, 6, 11, 9, 0, 4, 10, 8, 2, 1, 12, 3, 13],
|
||||
[8, 5, 14, 1, 0, 4, 7, 13, 6, 10, 15, 3, 12, 9, 11, 2],
|
||||
[15, 0, 5, 2, 7, 3, 8, 12, 11, 1, 13, 4, 14, 6, 9, 10],
|
||||
[12, 8, 10, 6, 15, 5, 14, 9, 7, 3, 13, 11, 2, 1, 4, 0],
|
||||
[15, 6, 4, 1, 2, 5, 13, 11, 9, 14, 3, 12, 0, 10, 7, 8],
|
||||
[6, 4, 8, 9, 3, 12, 14, 2, 10, 0, 1, 15, 11, 13, 5, 7],
|
||||
[9, 13, 11, 12, 4, 2, 15, 0, 8, 14, 7, 5, 10, 3, 1, 6],
|
||||
[1, 4, 8, 10, 0, 7, 15, 9, 2, 3, 14, 13, 11, 6, 5, 12],
|
||||
[4, 0, 10, 3, 13, 7, 11, 9, 5, 6, 1, 14, 2, 12, 15, 8],
|
||||
[3, 4, 14, 8, 5, 13, 10, 9, 6, 2, 11, 15, 12, 7, 1, 0],
|
||||
[6, 10, 12, 7, 4, 1, 13, 8, 5, 3, 11, 14, 0, 2, 15, 9],
|
||||
[2, 11, 14, 13, 3, 9, 8, 12, 4, 1, 0, 15, 7, 10, 5, 6],
|
||||
[6, 15, 3, 4, 9, 7, 11, 0, 5, 14, 13, 10, 12, 8, 2, 1],
|
||||
[4, 14, 2, 5, 0, 1, 10, 7, 3, 13, 6, 15, 12, 8, 11, 9],
|
||||
[11, 13, 0, 3, 5, 14, 9, 7, 4, 1, 8, 15, 6, 12, 10, 2],
|
||||
[11, 3, 1, 8, 7, 12, 6, 10, 5, 9, 15, 14, 2, 13, 4, 0],
|
||||
[10, 13, 3, 14, 15, 12, 1, 2, 11, 7, 4, 6, 0, 5, 9, 8],
|
||||
[1, 15, 5, 3, 2, 6, 7, 4, 8, 11, 0, 14, 12, 13, 10, 9],
|
||||
[1, 10, 5, 7, 15, 14, 12, 0, 11, 8, 4, 2, 3, 6, 13, 9],
|
||||
[1, 2, 12, 14, 8, 0, 6, 10, 3, 9, 7, 15, 11, 4, 13, 5],
|
||||
[10, 5, 0, 14, 15, 13, 3, 11, 8, 2, 4, 1, 6, 7, 12, 9],
|
||||
[8, 1, 4, 12, 11, 7, 9, 5, 14, 6, 10, 3, 13, 2, 15, 0],
|
||||
[7, 10, 4, 12, 5, 1, 14, 3, 9, 11, 2, 6, 13, 0, 8, 15]
|
||||
]
|
||||
}
|
BIN
txlib/8.9.68/libfekit.so
Normal file
BIN
txlib/8.9.68/libfekit.so
Normal file
Binary file not shown.
22
txlib/8.9.71/config.json
Normal file
22
txlib/8.9.71/config.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"server": {
|
||||
"host": "0.0.0.0",
|
||||
"port": 8080
|
||||
},
|
||||
"key": "114514",
|
||||
"auto_register": true,
|
||||
"protocol": {
|
||||
"package_name": "com.tencent.mobileqq",
|
||||
"qua": "V1_AND_SQ_8.9.71_4332_YYB_D",
|
||||
"version": "8.9.71",
|
||||
"code": "4332"
|
||||
},
|
||||
"unidbg": {
|
||||
"dynarmic": false,
|
||||
"unicorn": true,
|
||||
"debug": true
|
||||
},
|
||||
"black_list": [
|
||||
1008611
|
||||
]
|
||||
}
|
70
txlib/8.9.71/dtconfig.json
Normal file
70
txlib/8.9.71/dtconfig.json
Normal file
@ -0,0 +1,70 @@
|
||||
{
|
||||
"en": [
|
||||
[15, 10, 13, 4, 0, 5, 3, 1, 11, 12, 7, 2, 14, 6, 9, 8],
|
||||
[12, 1, 13, 4, 14, 9, 8, 6, 5, 3, 10, 7, 11, 2, 0, 15],
|
||||
[10, 5, 14, 0, 9, 1, 7, 4, 11, 8, 3, 15, 12, 6, 13, 2],
|
||||
[7, 11, 2, 14, 3, 10, 1, 8, 0, 15, 9, 6, 13, 4, 5, 12],
|
||||
[5, 15, 1, 2, 4, 13, 7, 8, 3, 6, 11, 0, 9, 10, 12, 14],
|
||||
[2, 5, 0, 9, 3, 15, 11, 7, 8, 13, 10, 4, 1, 14, 6, 12],
|
||||
[15, 12, 6, 14, 7, 2, 0, 10, 11, 13, 3, 5, 1, 4, 9, 8],
|
||||
[13, 2, 0, 1, 8, 10, 4, 14, 11, 12, 7, 3, 15, 9, 5, 6],
|
||||
[10, 6, 7, 8, 9, 3, 15, 1, 2, 5, 11, 12, 13, 14, 0, 4],
|
||||
[8, 10, 4, 2, 13, 15, 12, 7, 6, 3, 14, 0, 1, 5, 9, 11],
|
||||
[5, 7, 12, 6, 0, 2, 14, 3, 1, 13, 9, 10, 15, 11, 8, 4],
|
||||
[2, 7, 12, 1, 9, 10, 4, 8, 13, 11, 6, 3, 0, 5, 15, 14],
|
||||
[0, 11, 9, 3, 12, 8, 14, 13, 5, 4, 10, 15, 7, 2, 1, 6],
|
||||
[13, 1, 0, 12, 6, 14, 7, 11, 3, 10, 2, 5, 15, 8, 4, 9],
|
||||
[10, 7, 5, 1, 0, 6, 9, 13, 14, 8, 3, 15, 11, 12, 4, 2],
|
||||
[7, 14, 5, 13, 4, 11, 15, 10, 8, 0, 12, 2, 3, 1, 9, 6],
|
||||
[5, 2, 1, 12, 10, 14, 4, 15, 9, 8, 6, 0, 13, 11, 7, 3],
|
||||
[2, 8, 6, 5, 1, 3, 14, 10, 0, 12, 4, 13, 7, 15, 9, 11],
|
||||
[0, 12, 3, 11, 10, 5, 4, 14, 9, 7, 1, 2, 13, 8, 6, 15],
|
||||
[13, 3, 7, 11, 4, 10, 15, 0, 5, 2, 6, 12, 14, 9, 8, 1],
|
||||
[11, 7, 4, 6, 3, 0, 14, 5, 2, 9, 13, 15, 10, 8, 12, 1],
|
||||
[8, 13, 0, 11, 4, 1, 3, 9, 10, 15, 12, 5, 14, 7, 6, 2],
|
||||
[5, 3, 11, 10, 13, 6, 1, 15, 12, 8, 2, 4, 9, 14, 0, 7],
|
||||
[3, 7, 9, 6, 0, 5, 10, 14, 1, 13, 11, 4, 2, 15, 8, 12],
|
||||
[0, 14, 12, 15, 11, 1, 3, 10, 8, 2, 9, 6, 13, 5, 7, 4],
|
||||
[13, 4, 8, 6, 3, 7, 10, 0, 14, 5, 9, 1, 15, 12, 2, 11],
|
||||
[11, 8, 13, 5, 3, 14, 6, 9, 1, 0, 12, 15, 2, 7, 10, 4],
|
||||
[8, 14, 13, 10, 7, 3, 0, 6, 11, 12, 5, 1, 15, 4, 9, 2],
|
||||
[6, 2, 14, 10, 15, 1, 5, 8, 9, 7, 11, 13, 4, 3, 12, 0],
|
||||
[3, 9, 2, 4, 5, 8, 1, 7, 11, 10, 12, 0, 15, 13, 6, 14],
|
||||
[0, 15, 6, 14, 11, 2, 1, 3, 13, 4, 10, 12, 7, 5, 8, 9],
|
||||
[13, 5, 10, 7, 2, 4, 11, 0, 14, 8, 1, 9, 3, 12, 6, 15]
|
||||
],
|
||||
"de": [
|
||||
[13, 7, 12, 2, 14, 11, 3, 8, 5, 9, 10, 6, 1, 15, 0, 4],
|
||||
[13, 8, 4, 1, 9, 15, 12, 2, 11, 7, 10, 0, 3, 5, 6, 14],
|
||||
[7, 3, 9, 13, 2, 6, 14, 1, 5, 0, 8, 4, 11, 12, 10, 15],
|
||||
[9, 5, 14, 13, 7, 10, 0, 6, 2, 15, 3, 4, 11, 1, 8, 12],
|
||||
[11, 1, 4, 9, 0, 2, 6, 10, 5, 8, 14, 15, 7, 3, 12, 13],
|
||||
[3, 0, 12, 10, 5, 13, 15, 1, 11, 2, 7, 4, 8, 9, 6, 14],
|
||||
[1, 13, 15, 12, 10, 6, 11, 4, 5, 3, 7, 9, 14, 2, 0, 8],
|
||||
[3, 8, 1, 11, 6, 4, 13, 10, 15, 7, 2, 5, 0, 14, 12, 9],
|
||||
[7, 6, 13, 9, 5, 14, 3, 15, 1, 0, 10, 4, 11, 8, 2, 12],
|
||||
[7, 14, 15, 5, 6, 11, 9, 0, 4, 10, 8, 2, 1, 12, 3, 13],
|
||||
[8, 5, 14, 1, 0, 4, 7, 13, 6, 10, 15, 3, 12, 9, 11, 2],
|
||||
[15, 0, 5, 2, 7, 3, 8, 12, 11, 1, 13, 4, 14, 6, 9, 10],
|
||||
[12, 8, 10, 6, 15, 5, 14, 9, 7, 3, 13, 11, 2, 1, 4, 0],
|
||||
[15, 6, 4, 1, 2, 5, 13, 11, 9, 14, 3, 12, 0, 10, 7, 8],
|
||||
[6, 4, 8, 9, 3, 12, 14, 2, 10, 0, 1, 15, 11, 13, 5, 7],
|
||||
[9, 13, 11, 12, 4, 2, 15, 0, 8, 14, 7, 5, 10, 3, 1, 6],
|
||||
[1, 4, 8, 10, 0, 7, 15, 9, 2, 3, 14, 13, 11, 6, 5, 12],
|
||||
[4, 0, 10, 3, 13, 7, 11, 9, 5, 6, 1, 14, 2, 12, 15, 8],
|
||||
[3, 4, 14, 8, 5, 13, 10, 9, 6, 2, 11, 15, 12, 7, 1, 0],
|
||||
[6, 10, 12, 7, 4, 1, 13, 8, 5, 3, 11, 14, 0, 2, 15, 9],
|
||||
[2, 11, 14, 13, 3, 9, 8, 12, 4, 1, 0, 15, 7, 10, 5, 6],
|
||||
[6, 15, 3, 4, 9, 7, 11, 0, 5, 14, 13, 10, 12, 8, 2, 1],
|
||||
[4, 14, 2, 5, 0, 1, 10, 7, 3, 13, 6, 15, 12, 8, 11, 9],
|
||||
[11, 13, 0, 3, 5, 14, 9, 7, 4, 1, 8, 15, 6, 12, 10, 2],
|
||||
[11, 3, 1, 8, 7, 12, 6, 10, 5, 9, 15, 14, 2, 13, 4, 0],
|
||||
[10, 13, 3, 14, 15, 12, 1, 2, 11, 7, 4, 6, 0, 5, 9, 8],
|
||||
[1, 15, 5, 3, 2, 6, 7, 4, 8, 11, 0, 14, 12, 13, 10, 9],
|
||||
[1, 10, 5, 7, 15, 14, 12, 0, 11, 8, 4, 2, 3, 6, 13, 9],
|
||||
[1, 2, 12, 14, 8, 0, 6, 10, 3, 9, 7, 15, 11, 4, 13, 5],
|
||||
[10, 5, 0, 14, 15, 13, 3, 11, 8, 2, 4, 1, 6, 7, 12, 9],
|
||||
[8, 1, 4, 12, 11, 7, 9, 5, 14, 6, 10, 3, 13, 2, 15, 0],
|
||||
[7, 10, 4, 12, 5, 1, 14, 3, 9, 11, 2, 6, 13, 0, 8, 15]
|
||||
]
|
||||
}
|
BIN
txlib/8.9.71/libfekit.so
Normal file
BIN
txlib/8.9.71/libfekit.so
Normal file
Binary file not shown.
22
txlib/8.9.73/config.json
Normal file
22
txlib/8.9.73/config.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"server": {
|
||||
"host": "0.0.0.0",
|
||||
"port": 8080
|
||||
},
|
||||
"key": "114514",
|
||||
"auto_register": true,
|
||||
"protocol": {
|
||||
"package_name": "com.tencent.mobileqq",
|
||||
"qua": "V1_AND_SQ_8.9.73_4416_YYB_D",
|
||||
"version": "8.9.73",
|
||||
"code": "4416"
|
||||
},
|
||||
"unidbg": {
|
||||
"dynarmic": false,
|
||||
"unicorn": true,
|
||||
"debug": true
|
||||
},
|
||||
"black_list": [
|
||||
1008611
|
||||
]
|
||||
}
|
70
txlib/8.9.73/dtconfig.json
Normal file
70
txlib/8.9.73/dtconfig.json
Normal file
@ -0,0 +1,70 @@
|
||||
{
|
||||
"en": [
|
||||
[15, 10, 13, 4, 0, 5, 3, 1, 11, 12, 7, 2, 14, 6, 9, 8],
|
||||
[12, 1, 13, 4, 14, 9, 8, 6, 5, 3, 10, 7, 11, 2, 0, 15],
|
||||
[10, 5, 14, 0, 9, 1, 7, 4, 11, 8, 3, 15, 12, 6, 13, 2],
|
||||
[7, 11, 2, 14, 3, 10, 1, 8, 0, 15, 9, 6, 13, 4, 5, 12],
|
||||
[5, 15, 1, 2, 4, 13, 7, 8, 3, 6, 11, 0, 9, 10, 12, 14],
|
||||
[2, 5, 0, 9, 3, 15, 11, 7, 8, 13, 10, 4, 1, 14, 6, 12],
|
||||
[15, 12, 6, 14, 7, 2, 0, 10, 11, 13, 3, 5, 1, 4, 9, 8],
|
||||
[13, 2, 0, 1, 8, 10, 4, 14, 11, 12, 7, 3, 15, 9, 5, 6],
|
||||
[10, 6, 7, 8, 9, 3, 15, 1, 2, 5, 11, 12, 13, 14, 0, 4],
|
||||
[8, 10, 4, 2, 13, 15, 12, 7, 6, 3, 14, 0, 1, 5, 9, 11],
|
||||
[5, 7, 12, 6, 0, 2, 14, 3, 1, 13, 9, 10, 15, 11, 8, 4],
|
||||
[2, 7, 12, 1, 9, 10, 4, 8, 13, 11, 6, 3, 0, 5, 15, 14],
|
||||
[0, 11, 9, 3, 12, 8, 14, 13, 5, 4, 10, 15, 7, 2, 1, 6],
|
||||
[13, 1, 0, 12, 6, 14, 7, 11, 3, 10, 2, 5, 15, 8, 4, 9],
|
||||
[10, 7, 5, 1, 0, 6, 9, 13, 14, 8, 3, 15, 11, 12, 4, 2],
|
||||
[7, 14, 5, 13, 4, 11, 15, 10, 8, 0, 12, 2, 3, 1, 9, 6],
|
||||
[5, 2, 1, 12, 10, 14, 4, 15, 9, 8, 6, 0, 13, 11, 7, 3],
|
||||
[2, 8, 6, 5, 1, 3, 14, 10, 0, 12, 4, 13, 7, 15, 9, 11],
|
||||
[0, 12, 3, 11, 10, 5, 4, 14, 9, 7, 1, 2, 13, 8, 6, 15],
|
||||
[13, 3, 7, 11, 4, 10, 15, 0, 5, 2, 6, 12, 14, 9, 8, 1],
|
||||
[11, 7, 4, 6, 3, 0, 14, 5, 2, 9, 13, 15, 10, 8, 12, 1],
|
||||
[8, 13, 0, 11, 4, 1, 3, 9, 10, 15, 12, 5, 14, 7, 6, 2],
|
||||
[5, 3, 11, 10, 13, 6, 1, 15, 12, 8, 2, 4, 9, 14, 0, 7],
|
||||
[3, 7, 9, 6, 0, 5, 10, 14, 1, 13, 11, 4, 2, 15, 8, 12],
|
||||
[0, 14, 12, 15, 11, 1, 3, 10, 8, 2, 9, 6, 13, 5, 7, 4],
|
||||
[13, 4, 8, 6, 3, 7, 10, 0, 14, 5, 9, 1, 15, 12, 2, 11],
|
||||
[11, 8, 13, 5, 3, 14, 6, 9, 1, 0, 12, 15, 2, 7, 10, 4],
|
||||
[8, 14, 13, 10, 7, 3, 0, 6, 11, 12, 5, 1, 15, 4, 9, 2],
|
||||
[6, 2, 14, 10, 15, 1, 5, 8, 9, 7, 11, 13, 4, 3, 12, 0],
|
||||
[3, 9, 2, 4, 5, 8, 1, 7, 11, 10, 12, 0, 15, 13, 6, 14],
|
||||
[0, 15, 6, 14, 11, 2, 1, 3, 13, 4, 10, 12, 7, 5, 8, 9],
|
||||
[13, 5, 10, 7, 2, 4, 11, 0, 14, 8, 1, 9, 3, 12, 6, 15]
|
||||
],
|
||||
"de": [
|
||||
[13, 7, 12, 2, 14, 11, 3, 8, 5, 9, 10, 6, 1, 15, 0, 4],
|
||||
[13, 8, 4, 1, 9, 15, 12, 2, 11, 7, 10, 0, 3, 5, 6, 14],
|
||||
[7, 3, 9, 13, 2, 6, 14, 1, 5, 0, 8, 4, 11, 12, 10, 15],
|
||||
[9, 5, 14, 13, 7, 10, 0, 6, 2, 15, 3, 4, 11, 1, 8, 12],
|
||||
[11, 1, 4, 9, 0, 2, 6, 10, 5, 8, 14, 15, 7, 3, 12, 13],
|
||||
[3, 0, 12, 10, 5, 13, 15, 1, 11, 2, 7, 4, 8, 9, 6, 14],
|
||||
[1, 13, 15, 12, 10, 6, 11, 4, 5, 3, 7, 9, 14, 2, 0, 8],
|
||||
[3, 8, 1, 11, 6, 4, 13, 10, 15, 7, 2, 5, 0, 14, 12, 9],
|
||||
[7, 6, 13, 9, 5, 14, 3, 15, 1, 0, 10, 4, 11, 8, 2, 12],
|
||||
[7, 14, 15, 5, 6, 11, 9, 0, 4, 10, 8, 2, 1, 12, 3, 13],
|
||||
[8, 5, 14, 1, 0, 4, 7, 13, 6, 10, 15, 3, 12, 9, 11, 2],
|
||||
[15, 0, 5, 2, 7, 3, 8, 12, 11, 1, 13, 4, 14, 6, 9, 10],
|
||||
[12, 8, 10, 6, 15, 5, 14, 9, 7, 3, 13, 11, 2, 1, 4, 0],
|
||||
[15, 6, 4, 1, 2, 5, 13, 11, 9, 14, 3, 12, 0, 10, 7, 8],
|
||||
[6, 4, 8, 9, 3, 12, 14, 2, 10, 0, 1, 15, 11, 13, 5, 7],
|
||||
[9, 13, 11, 12, 4, 2, 15, 0, 8, 14, 7, 5, 10, 3, 1, 6],
|
||||
[1, 4, 8, 10, 0, 7, 15, 9, 2, 3, 14, 13, 11, 6, 5, 12],
|
||||
[4, 0, 10, 3, 13, 7, 11, 9, 5, 6, 1, 14, 2, 12, 15, 8],
|
||||
[3, 4, 14, 8, 5, 13, 10, 9, 6, 2, 11, 15, 12, 7, 1, 0],
|
||||
[6, 10, 12, 7, 4, 1, 13, 8, 5, 3, 11, 14, 0, 2, 15, 9],
|
||||
[2, 11, 14, 13, 3, 9, 8, 12, 4, 1, 0, 15, 7, 10, 5, 6],
|
||||
[6, 15, 3, 4, 9, 7, 11, 0, 5, 14, 13, 10, 12, 8, 2, 1],
|
||||
[4, 14, 2, 5, 0, 1, 10, 7, 3, 13, 6, 15, 12, 8, 11, 9],
|
||||
[11, 13, 0, 3, 5, 14, 9, 7, 4, 1, 8, 15, 6, 12, 10, 2],
|
||||
[11, 3, 1, 8, 7, 12, 6, 10, 5, 9, 15, 14, 2, 13, 4, 0],
|
||||
[10, 13, 3, 14, 15, 12, 1, 2, 11, 7, 4, 6, 0, 5, 9, 8],
|
||||
[1, 15, 5, 3, 2, 6, 7, 4, 8, 11, 0, 14, 12, 13, 10, 9],
|
||||
[1, 10, 5, 7, 15, 14, 12, 0, 11, 8, 4, 2, 3, 6, 13, 9],
|
||||
[1, 2, 12, 14, 8, 0, 6, 10, 3, 9, 7, 15, 11, 4, 13, 5],
|
||||
[10, 5, 0, 14, 15, 13, 3, 11, 8, 2, 4, 1, 6, 7, 12, 9],
|
||||
[8, 1, 4, 12, 11, 7, 9, 5, 14, 6, 10, 3, 13, 2, 15, 0],
|
||||
[7, 10, 4, 12, 5, 1, 14, 3, 9, 11, 2, 6, 13, 0, 8, 15]
|
||||
]
|
||||
}
|
BIN
txlib/8.9.73/libfekit.so
Normal file
BIN
txlib/8.9.73/libfekit.so
Normal file
Binary file not shown.
22
txlib/9.0.56/config.json
Normal file
22
txlib/9.0.56/config.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"server": {
|
||||
"host": "0.0.0.0",
|
||||
"port": 4848
|
||||
},
|
||||
"key": "114514",
|
||||
"auto_register": true,
|
||||
"protocol": {
|
||||
"package_name": "com.tencent.mobileqq",
|
||||
"qua": "V1_AND_SQ_9.0.56_6372_YYB_D",
|
||||
"version": "9.0.56",
|
||||
"code": "6372"
|
||||
},
|
||||
"unidbg": {
|
||||
"dynarmic": false,
|
||||
"unicorn": true,
|
||||
"debug": false
|
||||
},
|
||||
"black_list": [
|
||||
1008611
|
||||
]
|
||||
}
|
70
txlib/9.0.56/dtconfig.json
Normal file
70
txlib/9.0.56/dtconfig.json
Normal file
@ -0,0 +1,70 @@
|
||||
{
|
||||
"en": [
|
||||
[14, 1, 13, 10, 2, 7, 6, 5, 0, 12, 4, 8, 11, 9, 15, 3],
|
||||
[10, 0, 12, 6, 9, 4, 8, 15, 3, 7, 13, 5, 14, 11, 1, 2],
|
||||
[6, 2, 0, 13, 4, 10, 14, 11, 15, 1, 12, 3, 9, 5, 8, 7],
|
||||
[2, 10, 4, 8, 15, 14, 0, 3, 13, 12, 11, 6, 7, 5, 1, 9],
|
||||
[14, 3, 11, 12, 0, 6, 9, 13, 8, 4, 7, 1, 2, 15, 10, 5],
|
||||
[10, 11, 5, 4, 8, 12, 13, 0, 15, 7, 1, 9, 2, 6, 3, 14],
|
||||
[7, 1, 9, 14, 3, 5, 11, 13, 6, 2, 12, 10, 0, 15, 4, 8],
|
||||
[3, 10, 0, 5, 6, 7, 11, 2, 4, 14, 15, 1, 12, 8, 13, 9],
|
||||
[15, 2, 14, 13, 1, 0, 4, 7, 5, 3, 9, 10, 8, 6, 11, 12],
|
||||
[11, 10, 8, 4, 6, 0, 12, 5, 7, 9, 13, 2, 1, 3, 14, 15],
|
||||
[7, 3, 1, 12, 14, 8, 10, 5, 6, 13, 11, 15, 4, 9, 2, 0],
|
||||
[3, 11, 13, 0, 6, 5, 7, 8, 9, 1, 15, 14, 12, 10, 2, 4],
|
||||
[15, 3, 7, 11, 14, 5, 12, 2, 13, 4, 10, 0, 1, 8, 9, 6],
|
||||
[11, 12, 2, 3, 5, 14, 1, 15, 7, 10, 4, 8, 9, 6, 13, 0],
|
||||
[7, 4, 12, 10, 13, 11, 8, 2, 14, 15, 0, 6, 3, 1, 5, 9],
|
||||
[3, 12, 7, 4, 2, 8, 13, 9, 6, 11, 10, 14, 0, 15, 1, 5],
|
||||
[0, 3, 10, 11, 1, 12, 9, 4, 7, 6, 15, 5, 13, 2, 14, 8],
|
||||
[12, 11, 5, 3, 13, 14, 15, 6, 4, 8, 9, 10, 2, 7, 1, 0],
|
||||
[8, 3, 15, 10, 11, 4, 9, 13, 1, 7, 6, 14, 5, 0, 12, 2],
|
||||
[4, 12, 10, 6, 13, 9, 5, 7, 2, 8, 11, 0, 3, 14, 15, 1],
|
||||
[0, 4, 1, 10, 11, 5, 6, 15, 13, 9, 3, 2, 8, 14, 12, 7],
|
||||
[12, 0, 14, 15, 9, 1, 3, 13, 2, 4, 7, 6, 10, 8, 11, 5],
|
||||
[8, 5, 9, 2, 10, 14, 11, 13, 7, 0, 1, 12, 6, 3, 15, 4],
|
||||
[4, 13, 3, 9, 5, 1, 11, 2, 6, 8, 10, 0, 15, 14, 7, 12],
|
||||
[0, 5, 14, 8, 10, 3, 2, 7, 13, 1, 11, 12, 9, 15, 6, 4],
|
||||
[13, 12, 14, 15, 7, 1, 9, 2, 11, 5, 8, 10, 3, 0, 4, 6],
|
||||
[9, 4, 12, 0, 8, 14, 1, 3, 11, 6, 5, 13, 10, 2, 15, 7],
|
||||
[5, 12, 6, 15, 10, 13, 14, 3, 9, 8, 2, 11, 0, 1, 7, 4],
|
||||
[1, 5, 7, 2, 6, 11, 4, 13, 3, 10, 0, 9, 15, 14, 12, 8],
|
||||
[13, 0, 11, 15, 8, 4, 9, 3, 1, 5, 14, 10, 7, 2, 6, 12],
|
||||
[9, 5, 6, 7, 3, 15, 14, 4, 2, 8, 13, 0, 1, 11, 10, 12],
|
||||
[5, 14, 1, 2, 13, 0, 7, 12, 9, 11, 8, 4, 3, 10, 6, 15]
|
||||
],
|
||||
"de": [
|
||||
[11, 15, 6, 12, 5, 4, 1, 8, 13, 7, 3, 14, 0, 9, 2, 10],
|
||||
[14, 4, 10, 7, 15, 13, 8, 5, 0, 2, 12, 6, 3, 11, 1, 9],
|
||||
[9, 10, 15, 2, 0, 4, 1, 8, 13, 3, 7, 11, 5, 12, 6, 14],
|
||||
[6, 0, 12, 3, 7, 5, 15, 2, 13, 10, 11, 4, 8, 1, 14, 9],
|
||||
[4, 8, 13, 6, 5, 1, 3, 12, 11, 2, 7, 15, 14, 0, 10, 9],
|
||||
[3, 7, 15, 11, 5, 9, 13, 12, 6, 0, 14, 10, 2, 1, 4, 8],
|
||||
[7, 2, 8, 6, 11, 0, 1, 14, 15, 3, 9, 4, 13, 5, 12, 10],
|
||||
[10, 0, 12, 5, 9, 13, 3, 14, 2, 4, 15, 6, 7, 8, 1, 11],
|
||||
[4, 2, 5, 14, 1, 13, 7, 11, 10, 12, 6, 3, 9, 8, 0, 15],
|
||||
[7, 6, 11, 15, 12, 5, 14, 3, 9, 10, 0, 8, 13, 1, 4, 2],
|
||||
[7, 6, 15, 4, 8, 1, 0, 11, 9, 2, 3, 5, 13, 14, 10, 12],
|
||||
[6, 10, 0, 4, 2, 9, 11, 3, 7, 13, 12, 15, 8, 1, 14, 5],
|
||||
[2, 6, 9, 10, 4, 7, 1, 5, 8, 3, 13, 12, 15, 11, 0, 14],
|
||||
[5, 12, 9, 11, 13, 7, 3, 14, 2, 6, 0, 10, 4, 8, 1, 15],
|
||||
[1, 14, 8, 2, 6, 11, 0, 12, 3, 7, 9, 15, 10, 13, 5, 4],
|
||||
[7, 14, 0, 8, 10, 13, 3, 6, 15, 5, 4, 11, 12, 2, 9, 1],
|
||||
[11, 3, 5, 9, 10, 13, 8, 1, 2, 12, 7, 15, 6, 14, 0, 4],
|
||||
[11, 3, 2, 9, 7, 5, 6, 4, 12, 14, 0, 8, 13, 15, 10, 1],
|
||||
[15, 12, 9, 13, 10, 1, 2, 0, 3, 11, 8, 6, 14, 4, 5, 7],
|
||||
[7, 9, 6, 0, 3, 14, 11, 10, 13, 8, 4, 12, 5, 15, 1, 2],
|
||||
[13, 10, 12, 5, 15, 14, 1, 6, 3, 9, 7, 2, 8, 4, 11, 0],
|
||||
[10, 3, 5, 8, 4, 2, 9, 15, 7, 11, 13, 0, 14, 6, 12, 1],
|
||||
[1, 3, 14, 11, 15, 7, 9, 0, 8, 12, 13, 5, 4, 10, 6, 2],
|
||||
[5, 10, 14, 0, 4, 9, 12, 8, 13, 6, 2, 7, 15, 11, 3, 1],
|
||||
[6, 15, 8, 7, 2, 12, 3, 11, 1, 10, 9, 5, 4, 13, 14, 0],
|
||||
[9, 8, 12, 3, 15, 14, 7, 4, 10, 6, 5, 0, 2, 13, 1, 11],
|
||||
[14, 15, 7, 8, 11, 3, 9, 0, 1, 2, 5, 6, 4, 13, 12, 10],
|
||||
[9, 10, 4, 5, 0, 14, 13, 6, 7, 12, 11, 8, 15, 2, 1, 3],
|
||||
[0, 2, 12, 6, 10, 15, 3, 1, 9, 8, 4, 5, 14, 11, 7, 13],
|
||||
[6, 7, 2, 14, 12, 9, 4, 15, 8, 11, 10, 5, 0, 13, 3, 1],
|
||||
[10, 5, 12, 13, 6, 3, 15, 1, 0, 4, 9, 11, 2, 14, 8, 7],
|
||||
[6, 4, 5, 12, 0, 7, 1, 15, 13, 11, 10, 14, 2, 8, 9, 3]
|
||||
]
|
||||
}
|
BIN
txlib/9.0.56/libfekit.so
Normal file
BIN
txlib/9.0.56/libfekit.so
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user