mirror of
https://github.com/Sunnyyoung/WeChatTweak-macOS.git
synced 2025-12-13 23:35:42 +08:00
Compare commits
No commits in common. "master" and "1.2.2" have entirely different histories.
2
.bundle/config
Normal file
2
.bundle/config
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
BUNDLE_PATH: "Gems"
|
||||
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
open_collective: WeChatTweak-macOS
|
||||
119
.gitignore
vendored
119
.gitignore
vendored
|
|
@ -1,3 +1,29 @@
|
|||
### Windows ###
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
Thumbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
### macOS ###
|
||||
# General
|
||||
.DS_Store
|
||||
|
|
@ -27,35 +53,94 @@ Network Trash Folder
|
|||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
### macOS Patch ###
|
||||
# iCloud generated files
|
||||
*.icloud
|
||||
|
||||
### Xcode ###
|
||||
# User settings
|
||||
# Xcode
|
||||
#
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
## User settings
|
||||
xcuserdata/
|
||||
|
||||
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
|
||||
*.xcscmblueprint
|
||||
*.xccheckout
|
||||
|
||||
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
|
||||
build/
|
||||
DerivedData/
|
||||
*.moved-aside
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
|
||||
## Gcc Patch
|
||||
/*.gcno
|
||||
|
||||
## App packaging
|
||||
*.ipa
|
||||
*.dSYM.zip
|
||||
*.dSYM
|
||||
|
||||
### Xcode Patch ###
|
||||
*.xcodeproj/*
|
||||
!*.xcodeproj/project.pbxproj
|
||||
!*.xcodeproj/xcshareddata/
|
||||
!*.xcodeproj/project.xcworkspace/
|
||||
!*.xcworkspace/contents.xcworkspacedata
|
||||
/*.gcno
|
||||
**/xcshareddata/WorkspaceSettings.xcsettings
|
||||
|
||||
# Obj-C/Swift specific
|
||||
### Objective-C/Swift ###
|
||||
*.hmap
|
||||
|
||||
# App packaging
|
||||
*.ipa
|
||||
*.dSYM.zip
|
||||
*.dSYM
|
||||
## Playgrounds
|
||||
timeline.xctimeline
|
||||
playground.xcworkspace
|
||||
|
||||
# Swift Package Manager
|
||||
.swiftpm/
|
||||
.build/
|
||||
### CocoaPods ###
|
||||
## CocoaPods GitIgnore Template
|
||||
|
||||
### Workspace ###
|
||||
# CocoaPods - Only use to conserve bandwidth / Save time on Pushing
|
||||
# - Also handy if you have a large number of dependant pods
|
||||
# - AS PER https://guides.cocoapods.org/using/using-cocoapods.html NEVER IGNORE THE LOCK FILE
|
||||
Pods/
|
||||
|
||||
/wechattweak
|
||||
### Carthage ###
|
||||
# Carthage
|
||||
#
|
||||
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||
# Carthage/Checkouts
|
||||
|
||||
Carthage/Build
|
||||
|
||||
### fastlane ###
|
||||
# fastlane - A streamlined workflow tool for Cocoa deployment
|
||||
#
|
||||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
||||
# screenshots whenever they are needed.
|
||||
# For more information about the recommended setup visit:
|
||||
# https://docs.fastlane.tools/best-practices/source-control/#source-control
|
||||
|
||||
# fastlane specific
|
||||
fastlane/report.xml
|
||||
|
||||
# deliver temporary files
|
||||
fastlane/Preview.html
|
||||
|
||||
# snapshot generated screenshots
|
||||
fastlane/screenshots/**/*.png
|
||||
fastlane/screenshots/screenshots.html
|
||||
|
||||
# scan temporary files
|
||||
fastlane/test_output
|
||||
|
||||
# Fastlane.swift runner binary
|
||||
fastlane/FastlaneRunner
|
||||
|
||||
### Project ###
|
||||
|
||||
Gems
|
||||
WeChatTweak.framework
|
||||
|
|
|
|||
1
.ruby-version
Normal file
1
.ruby-version
Normal file
|
|
@ -0,0 +1 @@
|
|||
2.7.4
|
||||
5
CONTRIBUTING.md
Normal file
5
CONTRIBUTING.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# Contributing
|
||||
|
||||
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
|
||||
|
||||
[](https://github.com/Sunnyyoung/WeChatTweak-macOS/graphs/contributors)
|
||||
5
Gemfile
Normal file
5
Gemfile
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'cocoapods'
|
||||
96
Gemfile.lock
Normal file
96
Gemfile.lock
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (3.0.3)
|
||||
activesupport (6.1.4.1)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 1.6, < 2)
|
||||
minitest (>= 5.1)
|
||||
tzinfo (~> 2.0)
|
||||
zeitwerk (~> 2.3)
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
algoliasearch (1.27.5)
|
||||
httpclient (~> 2.8, >= 2.8.3)
|
||||
json (>= 1.5.1)
|
||||
atomos (0.1.3)
|
||||
claide (1.0.3)
|
||||
cocoapods (1.11.0)
|
||||
addressable (~> 2.8)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
cocoapods-core (= 1.11.0)
|
||||
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
||||
cocoapods-downloader (>= 1.4.0, < 2.0)
|
||||
cocoapods-plugins (>= 1.0.0, < 2.0)
|
||||
cocoapods-search (>= 1.0.0, < 2.0)
|
||||
cocoapods-trunk (>= 1.4.0, < 2.0)
|
||||
cocoapods-try (>= 1.1.0, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
escape (~> 0.0.4)
|
||||
fourflusher (>= 2.3.0, < 3.0)
|
||||
gh_inspector (~> 1.0)
|
||||
molinillo (~> 0.8.0)
|
||||
nap (~> 1.0)
|
||||
ruby-macho (>= 1.0, < 3.0)
|
||||
xcodeproj (>= 1.21.0, < 2.0)
|
||||
cocoapods-core (1.11.0)
|
||||
activesupport (>= 5.0, < 7)
|
||||
addressable (~> 2.8)
|
||||
algoliasearch (~> 1.0)
|
||||
concurrent-ruby (~> 1.1)
|
||||
fuzzy_match (~> 2.0.4)
|
||||
nap (~> 1.0)
|
||||
netrc (~> 0.11)
|
||||
public_suffix (~> 4.0)
|
||||
typhoeus (~> 1.0)
|
||||
cocoapods-deintegrate (1.0.5)
|
||||
cocoapods-downloader (1.5.1)
|
||||
cocoapods-plugins (1.0.0)
|
||||
nap
|
||||
cocoapods-search (1.0.1)
|
||||
cocoapods-trunk (1.6.0)
|
||||
nap (>= 0.8, < 2.0)
|
||||
netrc (~> 0.11)
|
||||
cocoapods-try (1.2.0)
|
||||
colored2 (3.1.2)
|
||||
concurrent-ruby (1.1.9)
|
||||
escape (0.0.4)
|
||||
ethon (0.14.0)
|
||||
ffi (>= 1.15.0)
|
||||
ffi (1.15.4)
|
||||
fourflusher (2.3.1)
|
||||
fuzzy_match (2.0.4)
|
||||
gh_inspector (1.1.3)
|
||||
httpclient (2.8.3)
|
||||
i18n (1.8.10)
|
||||
concurrent-ruby (~> 1.0)
|
||||
json (2.5.1)
|
||||
minitest (5.14.4)
|
||||
molinillo (0.8.0)
|
||||
nanaimo (0.3.0)
|
||||
nap (1.1.0)
|
||||
netrc (0.11.0)
|
||||
public_suffix (4.0.6)
|
||||
rexml (3.2.5)
|
||||
ruby-macho (2.5.1)
|
||||
typhoeus (1.4.0)
|
||||
ethon (>= 0.9.0)
|
||||
tzinfo (2.0.4)
|
||||
concurrent-ruby (~> 1.0)
|
||||
xcodeproj (1.21.0)
|
||||
CFPropertyList (>= 2.3.3, < 4.0)
|
||||
atomos (~> 0.1.3)
|
||||
claide (>= 1.0.2, < 2.0)
|
||||
colored2 (~> 3.1)
|
||||
nanaimo (~> 0.3.0)
|
||||
rexml (~> 3.2.4)
|
||||
zeitwerk (2.4.2)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
cocoapods
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.18
|
||||
863
LICENSE
863
LICENSE
|
|
@ -1,662 +1,201 @@
|
|||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are 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.
|
||||
|
||||
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.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
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 Affero 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. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
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 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 work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero 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 Affero 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 Affero 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 Affero 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 }} {{ organization }}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
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 AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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
|
||||
|
||||
http://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.
|
||||
70
Makefile
70
Makefile
|
|
@ -1,9 +1,67 @@
|
|||
.PHONY: build clean
|
||||
APP_PATH=/Applications/WeChat.app/Contents/MacOS
|
||||
TMP_PATH=/tmp
|
||||
APP_NAME=WeChat
|
||||
BACKUP_NAME=WeChat.bak
|
||||
FRAMEWORK_PATH=WeChatTweak.framework
|
||||
FRAMEWORK_NAME=WeChatTweak
|
||||
DYLIB_NAME=WeChatTweak.dylib
|
||||
|
||||
build::
|
||||
swift build -c release --arch arm64 --arch x86_64
|
||||
cp -f .build/apple/Products/Release/wechattweak ./wechattweak
|
||||
debug::
|
||||
DYLD_INSERT_LIBRARIES=${FRAMEWORK_PATH}/${FRAMEWORK_NAME} ${APP_PATH}/${APP_NAME} &
|
||||
|
||||
install::
|
||||
@xattr -rd com.apple.quarantine . ;
|
||||
@if ! [[ $EUID -eq 0 ]]; then\
|
||||
echo "This script should be run using sudo or as the root user.";\
|
||||
exit 1;\
|
||||
fi
|
||||
@if ! [ -f "${APP_PATH}/${APP_NAME}" ]; then\
|
||||
echo "Can not find the WeChat.";\
|
||||
exit 1;\
|
||||
fi
|
||||
@if ! [ -d "${FRAMEWORK_PATH}" ]; then\
|
||||
echo "Can not find the framework, please build first.";\
|
||||
echo "Or download the latest release zip: \033[33;32mhttps://github.com/Sunnyyoung/WeChatTweak-macOS/releases/latest\033[0m.";\
|
||||
exit 1;\
|
||||
fi
|
||||
@if [ -f "${APP_PATH}/${DYLIB_NAME}" ]; then\
|
||||
echo "You're using old version tweak, please uninstall first.";\
|
||||
exit 1;\
|
||||
fi
|
||||
@if [ -d "${APP_PATH}/${FRAMEWORK_PATH}" ]; then\
|
||||
rm -rf ${APP_PATH}/${FRAMEWORK_PATH};\
|
||||
cp -R ${FRAMEWORK_PATH} ${APP_PATH};\
|
||||
chmod -R 755 ${APP_PATH}/${FRAMEWORK_PATH};\
|
||||
echo "Framework found! Replace with new framework successfully!";\
|
||||
else \
|
||||
cp -R ${FRAMEWORK_PATH} ${APP_PATH};\
|
||||
chmod -R 755 ${APP_PATH}/${FRAMEWORK_PATH};\
|
||||
cp ${APP_PATH}/${APP_NAME} ${APP_PATH}/${BACKUP_NAME};\
|
||||
./insert_dylib @executable_path/${FRAMEWORK_PATH}/${FRAMEWORK_NAME} ${APP_PATH}/${APP_NAME} ${TMP_PATH}/${APP_NAME} --all-yes;\
|
||||
codesign --force --deep --sign - ${TMP_PATH}/${APP_NAME};\
|
||||
cp ${TMP_PATH}/${APP_NAME} ${APP_PATH}/${APP_NAME};\
|
||||
echo "Install successfully!";\
|
||||
fi
|
||||
|
||||
uninstall::
|
||||
@xattr -rd com.apple.quarantine . ;
|
||||
@if ! [[ $EUID -eq 0 ]]; then\
|
||||
echo "This script should be run using sudo or as the root user.";\
|
||||
exit 1;\
|
||||
fi
|
||||
@if ! [ -f "${APP_PATH}/${APP_NAME}" ]; then\
|
||||
echo "Can not find the WeChat.";\
|
||||
exit 1;\
|
||||
fi
|
||||
@if ! [ -f "${APP_PATH}/${BACKUP_NAME}" ]; then\
|
||||
echo "Can not find the WeChat backup file.";\
|
||||
exit 1;\
|
||||
fi
|
||||
|
||||
@rm -rf ${APP_PATH}/${DYLIB_NAME};
|
||||
@rm -rf ${APP_PATH}/${FRAMEWORK_PATH};
|
||||
@mv ${APP_PATH}/${BACKUP_NAME} ${APP_PATH}/${APP_NAME};
|
||||
@echo "Uninstall successfully!";
|
||||
|
||||
clean::
|
||||
rm -rf .build
|
||||
rm -f wechattweak
|
||||
rm -rf ${FRAMEWORK_PATH}
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
"originHash" : "fc7f739a75c4c771c736e9ff1f765bbd53fb1f3c5beaa621fbc867f0d71964c4",
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "swift-argument-parser",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-argument-parser",
|
||||
"state" : {
|
||||
"revision" : "cdd0ef3755280949551dc26dee5de9ddeda89f54",
|
||||
"version" : "1.6.2"
|
||||
}
|
||||
}
|
||||
],
|
||||
"version" : 3
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
// swift-tools-version:6.0
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "WeChatTweak",
|
||||
platforms: [
|
||||
.macOS(.v12)
|
||||
],
|
||||
products: [
|
||||
.executable(
|
||||
name: "wechattweak",
|
||||
targets: [
|
||||
"WeChatTweak"
|
||||
]
|
||||
)
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.6.0")
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
name: "WeChatTweak",
|
||||
dependencies: [
|
||||
.product(name: "ArgumentParser", package: "swift-argument-parser")
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
16
Podfile
Normal file
16
Podfile
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
platform :osx, '10.10'
|
||||
inhibit_all_warnings!
|
||||
|
||||
target 'WeChatTweak' do
|
||||
pod 'JRSwizzle'
|
||||
pod 'GCDWebServer'
|
||||
pod 'YYModel'
|
||||
end
|
||||
|
||||
post_install do |installer|
|
||||
installer.pods_project.targets.each do |target|
|
||||
target.build_configurations.each do |config|
|
||||
config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = 10.11
|
||||
end
|
||||
end
|
||||
end
|
||||
26
Podfile.lock
Normal file
26
Podfile.lock
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
PODS:
|
||||
- GCDWebServer (3.5.4):
|
||||
- GCDWebServer/Core (= 3.5.4)
|
||||
- GCDWebServer/Core (3.5.4)
|
||||
- JRSwizzle (1.0)
|
||||
- YYModel (1.0.4)
|
||||
|
||||
DEPENDENCIES:
|
||||
- GCDWebServer
|
||||
- JRSwizzle
|
||||
- YYModel
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- GCDWebServer
|
||||
- JRSwizzle
|
||||
- YYModel
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
GCDWebServer: 2c156a56c8226e2d5c0c3f208a3621ccffbe3ce4
|
||||
JRSwizzle: dd5ead5d913a0f29e7f558200165849f006bb1e3
|
||||
YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
|
||||
|
||||
PODFILE CHECKSUM: 2d627cca174f5b93185d7b4603c19b06c0bd86a0
|
||||
|
||||
COCOAPODS: 1.11.0
|
||||
89
README-English.md
Normal file
89
README-English.md
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
# WeChatTweak-macOS
|
||||
|
||||
[](LICENSE)
|
||||
[](README-English.md)
|
||||
[](README.md)
|
||||
[](https://t.me/joinchat/B0vW8kPU5OrwdC1qRbaqRA)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
[](https://github.com/Sunnyyoung/WeChatTweak-macOS/releases/latest/download/WeChatTweak-macOS.zip)
|
||||
|
||||
A dynamic library tweak for WeChat macOS.
|
||||
|
||||
## Screenshot
|
||||
|
||||
### Overview
|
||||
|
||||

|
||||
|
||||
### Alfred workflow
|
||||
|
||||

|
||||
|
||||
### LaunchBar action
|
||||
|
||||

|
||||
|
||||
## Feature
|
||||
|
||||
- Anti message revoked
|
||||
- Message list notification
|
||||
- System notification
|
||||
- Revoke message you sent
|
||||
- Multiple WeChat Instance
|
||||
- Launch from Dock menu
|
||||
- Run command: `open -n /Applications/WeChat.app`
|
||||
- Messages enhancement
|
||||
- Support stickers exporting
|
||||
- Support QRCode identifying
|
||||
- Support right-click copy link directly
|
||||
- Support opened by the system default browser directly
|
||||
- Auto login without authentication
|
||||
- UI Interface settings panel
|
||||
- Alfred workflow support
|
||||
- Launchbar action support
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
$ cd WeChatTweak-macOS
|
||||
$ sudo make install # Install or Upgrade the framework
|
||||
$ sudo make uninstall # Uninstall the framework
|
||||
```
|
||||
|
||||
## Reference
|
||||
|
||||
- [微信 macOS 客户端无限多开功能实践](https://blog.sunnyyoung.net/wei-xin-macos-ke-hu-duan-wu-xian-duo-kai-gong-neng-shi-jian/)
|
||||
- [微信 macOS 客户端拦截撤回功能实践](https://blog.sunnyyoung.net/wei-xin-macos-ke-hu-duan-lan-jie-che-hui-gong-neng-shi-jian/)
|
||||
- [让微信 macOS 客户端支持 Alfred](https://blog.sunnyyoung.net/rang-wei-xin-macos-ke-hu-duan-zhi-chi-alfred/)
|
||||
|
||||
## Contributors
|
||||
|
||||
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
|
||||
|
||||
[](https://github.com/Sunnyyoung/WeChatTweak-macOS/graphs/contributors)
|
||||
|
||||
## Backers
|
||||
|
||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/WeChatTweak-macOS#backer)]
|
||||
|
||||
[](https://opencollective.com/WeChatTweak-macOS#backers)
|
||||
|
||||
## Sponsors
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/WeChatTweak-macOS#sponsor)]
|
||||
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/0/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/1/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/2/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/3/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/4/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/5/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/6/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/7/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/8/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/9/website)
|
||||
|
||||
## License
|
||||
|
||||
The [Apache License 2.0](LICENSE).
|
||||
101
README.md
101
README.md
|
|
@ -1,33 +1,69 @@
|
|||
# WeChatTweak
|
||||
# WeChatTweak-macOS
|
||||
|
||||
[](https://github.com/sunnyyoung/WeChatTweak)
|
||||
[](https://t.me/wechattweak)
|
||||
[](https://github.com/sunnyyoung/WeChatTweak/wiki/FAQ)
|
||||
[](LICENSE)
|
||||
[](README-English.md)
|
||||
[](README.md)
|
||||
[](https://t.me/joinchat/B0vW8kPU5OrwdC1qRbaqRA)
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
[](https://github.com/Sunnyyoung/WeChatTweak-macOS/releases/latest/download/WeChatTweak-macOS.zip)
|
||||
|
||||
A command-line tool for tweaking WeChat.
|
||||
微信 macOS 客户端增强 Tweak 动态库。
|
||||
|
||||
## 截图
|
||||
|
||||
### 整体预览
|
||||
|
||||

|
||||
|
||||
### Alfred workflow
|
||||
|
||||

|
||||
|
||||
### LaunchBar action
|
||||
|
||||

|
||||
|
||||
## 功能
|
||||
|
||||
- 阻止消息撤回
|
||||
- 阻止自动更新
|
||||
- 客户端多开
|
||||
- 消息列表通知
|
||||
- 系统通知
|
||||
- 正常撤回自己发出的消息
|
||||
- 客户端无限多开
|
||||
- 右键 Dock icon 登录新的微信账号
|
||||
- 命令行执行:`open -n /Applications/WeChat.app`
|
||||
- 消息处理增强
|
||||
- 支持任意表情导出
|
||||
- 支持二维码识别
|
||||
- 支持右键直接复制链接
|
||||
- 支持由系统默认浏览器直接打开
|
||||
- 重新打开应用无需手机认证
|
||||
- UI界面设置面板
|
||||
- 支持 Alfred workflow
|
||||
- 支持 Launchbar action
|
||||
|
||||
## 安装&使用
|
||||
## 使用
|
||||
|
||||
```bash
|
||||
# 安装
|
||||
brew install sunnyyoung/tap/wechattweak
|
||||
|
||||
# 更新
|
||||
brew upgrade wechattweak
|
||||
|
||||
# 执行 Patch
|
||||
wechattweak patch
|
||||
|
||||
# 查看所有支持的 WeChat 版本
|
||||
wechattweak versions
|
||||
$ cd WeChatTweak-macOS
|
||||
$ sudo make install # 安装或者更新动态库
|
||||
$ sudo make uninstall # 卸载动态库
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
1. 功能失效?
|
||||
请提交 **issue** 然后等待,或提交 **pull request** 一起发电。
|
||||
2. Issue 没有响应 or 回复?
|
||||
开源项目,用爱发电,耐心等。
|
||||
3. 兼容旧版本客户端吗?
|
||||
不,为了降低维护成本和保证更新速度,默认只支持最新 App Store 版本客户端。
|
||||
4. 安装出现错误:`Can not find the framework, please build first.`
|
||||
下载的是源码文件需要自行编译,开箱即用请点击:[](https://github.com/Sunnyyoung/WeChatTweak-macOS/releases/latest/download/WeChatTweak-macOS.zip)
|
||||
5. 会封号吗?
|
||||
在**只使用该工具**的情况下**没有**出现过封号/风险提示,若有**使用过其他同类工具**则有可能会出现封号/风险提示,因此风险自负。
|
||||
|
||||
## 参考
|
||||
|
||||
- [微信 macOS 客户端无限多开功能实践](https://blog.sunnyyoung.net/wei-xin-macos-ke-hu-duan-wu-xian-duo-kai-gong-neng-shi-jian/)
|
||||
|
|
@ -36,10 +72,31 @@ wechattweak versions
|
|||
|
||||
## 贡献者
|
||||
|
||||
This project exists thanks to all the people who contribute.
|
||||
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
|
||||
|
||||
[](https://github.com/sunnyyoung/WeChatTweak/graphs/contributors)
|
||||
[](https://github.com/Sunnyyoung/WeChatTweak-macOS/graphs/contributors)
|
||||
|
||||
## 支持者
|
||||
|
||||
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/WeChatTweak-macOS#backer)]
|
||||
|
||||
[](https://opencollective.com/WeChatTweak-macOS#backers)
|
||||
|
||||
## 赞助者
|
||||
|
||||
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/WeChatTweak-macOS#sponsor)]
|
||||
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/0/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/1/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/2/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/3/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/4/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/5/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/6/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/7/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/8/website)
|
||||
[](https://opencollective.com/WeChatTweak-macOS/sponsor/9/website)
|
||||
|
||||
## License
|
||||
|
||||
The [AGPL-3.0](LICENSE).
|
||||
The [Apache License 2.0](LICENSE).
|
||||
|
|
|
|||
BIN
Screenshot/0x01.png
Normal file
BIN
Screenshot/0x01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 520 KiB |
BIN
Screenshot/0x02.png
Normal file
BIN
Screenshot/0x02.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
BIN
Screenshot/0x03.png
Normal file
BIN
Screenshot/0x03.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
|
|
@ -1,57 +0,0 @@
|
|||
//
|
||||
// Command.swift
|
||||
//
|
||||
// Created by Sunny Young.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import ArgumentParser
|
||||
|
||||
struct Command {
|
||||
enum Error: @unchecked Sendable, LocalizedError {
|
||||
case executing(command: String, error: NSDictionary)
|
||||
|
||||
var errorDescription: String? {
|
||||
switch self {
|
||||
case let .executing(command, error):
|
||||
return "executing: \(command) error: \(error)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static func version(app: URL) async throws -> String? {
|
||||
try await Command.execute(command: "defaults read \(app.appendingPathComponent("Contents/Info.plist").path) CFBundleVersion")
|
||||
}
|
||||
|
||||
static func patch(app: URL, config: Config) async throws {
|
||||
try Patcher.patch(binary: app.appendingPathComponent("Contents/MacOS/WeChat"), config: config)
|
||||
}
|
||||
|
||||
static func resign(app: URL) async throws {
|
||||
try await Command.execute(command: "codesign --remove-sign \(app.path)")
|
||||
try await Command.execute(command: "codesign --force --deep --sign - \(app.path)")
|
||||
try await Command.execute(command: "xattr -cr \(app.path)")
|
||||
}
|
||||
|
||||
@discardableResult
|
||||
private static func execute(command: String) async throws -> String? {
|
||||
guard let script = NSAppleScript(source: "do shell script \"\(command)\"") else {
|
||||
throw Error.executing(
|
||||
command: command,
|
||||
error: ["error": "Create script failed."]
|
||||
)
|
||||
}
|
||||
|
||||
var error: NSDictionary?
|
||||
let descriptor = script.executeAndReturnError(&error)
|
||||
|
||||
if let error = error {
|
||||
throw Error.executing(
|
||||
command: command,
|
||||
error: error
|
||||
)
|
||||
} else {
|
||||
return descriptor.stringValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
//
|
||||
// Config.swift
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2025/12/5.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import MachO
|
||||
|
||||
struct Config: Decodable {
|
||||
enum Arch: String, Decodable {
|
||||
case arm64
|
||||
case x86_64
|
||||
|
||||
var cpu: UInt32 {
|
||||
switch self {
|
||||
case .arm64:
|
||||
return UInt32(CPU_TYPE_ARM64)
|
||||
case .x86_64:
|
||||
return UInt32(CPU_TYPE_X86_64)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct Entry: Decodable {
|
||||
let arch: Arch
|
||||
let addr: UInt64
|
||||
let asm: Data
|
||||
|
||||
private enum CodingKeys: CodingKey {
|
||||
case arch
|
||||
case addr
|
||||
case asm
|
||||
}
|
||||
|
||||
init(from decoder: any Decoder) throws {
|
||||
let container: KeyedDecodingContainer<CodingKeys> = try decoder.container(keyedBy: CodingKeys.self)
|
||||
self.arch = try container.decode(Arch.self, forKey: .arch)
|
||||
self.addr = try {
|
||||
let hex = try container.decode(String.self, forKey: .addr)
|
||||
guard let value = UInt64(hex, radix: 16) else {
|
||||
throw DecodingError.dataCorruptedError(
|
||||
forKey: CodingKeys.addr,
|
||||
in: container,
|
||||
debugDescription: "Invalid Entry.addr"
|
||||
)
|
||||
}
|
||||
return value
|
||||
}()
|
||||
self.asm = try {
|
||||
let hex = try container.decode(String.self, forKey: .asm)
|
||||
guard let value = Data(hex: hex) else {
|
||||
throw DecodingError.dataCorruptedError(
|
||||
forKey: CodingKeys.asm,
|
||||
in: container,
|
||||
debugDescription: "Invalid Entry.asm"
|
||||
)
|
||||
}
|
||||
return value
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
struct Target: Decodable {
|
||||
let identifier: String
|
||||
let entries: [Entry]
|
||||
|
||||
private enum CodingKeys: CodingKey {
|
||||
case identifier
|
||||
case entries
|
||||
}
|
||||
|
||||
init(from decoder: any Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
self.identifier = try container.decode(String.self, forKey: .identifier)
|
||||
self.entries = try container.decode([Entry].self, forKey: .entries)
|
||||
}
|
||||
}
|
||||
|
||||
let version: String
|
||||
let targets: [Target]
|
||||
|
||||
static func load(url: URL) async throws -> [Config] {
|
||||
if url.isFileURL {
|
||||
return try JSONDecoder().decode(
|
||||
[Config].self,
|
||||
from: Data(contentsOf: url)
|
||||
)
|
||||
} else {
|
||||
return try JSONDecoder().decode(
|
||||
[Config].self,
|
||||
from: try await URLSession.shared.data(from: url).0
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private extension Data {
|
||||
init?(hex: String) {
|
||||
let chars = Array(hex.utf8)
|
||||
guard chars.count % 2 == 0 else { return nil }
|
||||
|
||||
self.init()
|
||||
self.reserveCapacity(chars.count / 2)
|
||||
|
||||
func nibble(_ c: UInt8) -> UInt8? {
|
||||
switch c {
|
||||
case 48...57: return c - 48 // '0'...'9'
|
||||
case 65...70: return c - 55 // 'A'...'F'
|
||||
case 97...102: return c - 87 // 'a'...'f'
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
var i = 0
|
||||
while i < chars.count {
|
||||
guard let hi = nibble(chars[i]),
|
||||
let lo = nibble(chars[i + 1]) else { return nil }
|
||||
append(hi << 4 | lo)
|
||||
i += 2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
//
|
||||
// Patcher.swift
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2025/12/4.
|
||||
//
|
||||
|
||||
import Darwin
|
||||
import MachO
|
||||
import Foundation
|
||||
|
||||
struct Patcher {
|
||||
enum Error: Swift.Error {
|
||||
case invalidFile
|
||||
case not64BitMachO(magic: UInt32)
|
||||
case vaNotFound(arch: String, va: UInt64)
|
||||
case noArchMatched
|
||||
}
|
||||
|
||||
static func patch(binary: URL, config: Config) throws {
|
||||
guard FileManager.default.fileExists(atPath: binary.path) else {
|
||||
throw Error.invalidFile
|
||||
}
|
||||
|
||||
let entries = config.targets.flatMap { $0.entries }
|
||||
guard !entries.isEmpty else { throw Error.noArchMatched }
|
||||
|
||||
let fh = try FileHandle(forUpdating: binary)
|
||||
defer { try? fh.close() }
|
||||
|
||||
// 读 magic 判断 fat / thin
|
||||
guard let magicData = try fh.read(upToCount: 4), magicData.count == 4 else {
|
||||
throw Error.invalidFile
|
||||
}
|
||||
let magicBE = magicData.withUnsafeBytes { $0.load(as: UInt32.self).bigEndian }
|
||||
let isSwappedFat = (magicBE == FAT_CIGAM)
|
||||
|
||||
var patchedCount = 0
|
||||
if magicBE == FAT_MAGIC || magicBE == FAT_CIGAM {
|
||||
// FAT header: magic(4) + nfat_arch(4)
|
||||
guard let nfatData = try fh.read(upToCount: 4), nfatData.count == 4 else {
|
||||
throw Error.invalidFile
|
||||
}
|
||||
let rawNfat = nfatData.withUnsafeBytes { $0.load(as: UInt32.self) }
|
||||
let nfat = isSwappedFat ? UInt32(littleEndian: rawNfat) : UInt32(bigEndian: rawNfat)
|
||||
|
||||
// 先读完 fat_arch 表,避免 patch 时移动文件指针影响后续读取
|
||||
var archEntries: [(cputype: UInt32, offset: UInt32)] = []
|
||||
|
||||
for _ in 0..<nfat {
|
||||
// fat_arch: cputype(4) cpusub(4) offset(4) size(4) align(4) big-endian
|
||||
guard let archData = try fh.read(upToCount: 20), archData.count == 20 else {
|
||||
throw Error.invalidFile
|
||||
}
|
||||
let rawCpu = archData.withUnsafeBytes { $0.load(fromByteOffset: 0, as: UInt32.self) }
|
||||
let rawOff = archData.withUnsafeBytes { $0.load(fromByteOffset: 8, as: UInt32.self) }
|
||||
let cputype = isSwappedFat ? UInt32(littleEndian: rawCpu) : UInt32(bigEndian: rawCpu)
|
||||
let offset = isSwappedFat ? UInt32(littleEndian: rawOff) : UInt32(bigEndian: rawOff)
|
||||
archEntries.append((cputype, offset))
|
||||
}
|
||||
|
||||
for entry in archEntries {
|
||||
let matching = entries.filter { $0.arch.cpu == entry.cputype }
|
||||
for target in matching {
|
||||
try patchOneSlice(file: fh,
|
||||
sliceOffset: UInt64(entry.offset),
|
||||
targetVA: target.addr,
|
||||
patch: target.asm,
|
||||
archName: target.arch.rawValue)
|
||||
patchedCount += 1
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// thin mach-o:回到开头按 mach_header_64 解析(小端)
|
||||
try fh.seek(toOffset: 0)
|
||||
guard let hdr = try fh.read(upToCount: 32), hdr.count == 32 else {
|
||||
throw Error.invalidFile
|
||||
}
|
||||
let magic = hdr.withUnsafeBytes { $0.load(as: UInt32.self).littleEndian }
|
||||
let cputype = hdr.withUnsafeBytes { $0.load(fromByteOffset: 4, as: Int32.self).littleEndian }
|
||||
|
||||
guard magic == MH_MAGIC_64 else {
|
||||
throw Error.not64BitMachO(magic: magic)
|
||||
}
|
||||
|
||||
let matching = entries.filter { Int32(bitPattern: $0.arch.cpu) == cputype }
|
||||
if matching.isEmpty {
|
||||
throw Error.noArchMatched
|
||||
}
|
||||
|
||||
for target in matching {
|
||||
try patchOneSlice(file: fh,
|
||||
sliceOffset: 0,
|
||||
targetVA: target.addr,
|
||||
patch: target.asm,
|
||||
archName: target.arch.rawValue)
|
||||
patchedCount += 1
|
||||
}
|
||||
}
|
||||
|
||||
if patchedCount <= 0 {
|
||||
throw Error.noArchMatched
|
||||
}
|
||||
}
|
||||
|
||||
private static func patchOneSlice(file fh: FileHandle,
|
||||
sliceOffset: UInt64,
|
||||
targetVA: UInt64,
|
||||
patch: Data,
|
||||
archName: String) throws {
|
||||
|
||||
// 读 slice 内 mach_header_64
|
||||
try fh.seek(toOffset: sliceOffset)
|
||||
guard let hdr = try fh.read(upToCount: 32), hdr.count == 32 else {
|
||||
throw Error.invalidFile
|
||||
}
|
||||
|
||||
let magic = hdr.withUnsafeBytes { $0.load(as: UInt32.self).littleEndian }
|
||||
let ncmds = hdr.withUnsafeBytes { $0.load(fromByteOffset: 16, as: UInt32.self).littleEndian }
|
||||
|
||||
guard magic == MH_MAGIC_64 else {
|
||||
throw Error.not64BitMachO(magic: magic)
|
||||
}
|
||||
|
||||
var lcOffset = sliceOffset + 32
|
||||
|
||||
for _ in 0..<ncmds {
|
||||
try fh.seek(toOffset: lcOffset)
|
||||
guard let lcHead = try fh.read(upToCount: 8), lcHead.count == 8 else {
|
||||
throw Error.invalidFile
|
||||
}
|
||||
|
||||
let cmd = lcHead.withUnsafeBytes { $0.load(as: UInt32.self).littleEndian }
|
||||
let cmdsize = lcHead.withUnsafeBytes { $0.load(fromByteOffset: 4, as: UInt32.self).littleEndian }
|
||||
|
||||
if cmd == LC_SEGMENT_64 {
|
||||
guard let segData = try fh.read(upToCount: 64), segData.count == 64 else {
|
||||
throw Error.invalidFile
|
||||
}
|
||||
|
||||
let vmaddr = segData.withUnsafeBytes { $0.load(fromByteOffset: 16, as: UInt64.self).littleEndian }
|
||||
let vmsize = segData.withUnsafeBytes { $0.load(fromByteOffset: 24, as: UInt64.self).littleEndian }
|
||||
let fileoff = segData.withUnsafeBytes { $0.load(fromByteOffset: 32, as: UInt64.self).littleEndian }
|
||||
|
||||
if vmaddr <= targetVA && targetVA < vmaddr + vmsize {
|
||||
let fileOffset = sliceOffset + fileoff + (targetVA - vmaddr)
|
||||
print("[\(archName)] vmaddr=\(String(format: "0x%llx", vmaddr)), fileoff=\(String(format: "0x%llx", fileoff)), sliceoff=\(String(format: "0x%llx", sliceOffset))")
|
||||
print("[\(archName)] patch VA=\(String(format: "0x%llx", targetVA)), fileoff=\(String(format: "0x%llx", fileOffset))")
|
||||
|
||||
try fh.seek(toOffset: fileOffset)
|
||||
try fh.write(contentsOf: patch)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
lcOffset += UInt64(cmdsize)
|
||||
}
|
||||
|
||||
throw Error.vaNotFound(arch: archName, va: targetVA)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
//
|
||||
// main.swift
|
||||
//
|
||||
// Created by Sunny Young.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Dispatch
|
||||
import ArgumentParser
|
||||
|
||||
// MARK: Versions
|
||||
extension Tweak {
|
||||
struct Versions: AsyncParsableCommand {
|
||||
static let configuration = CommandConfiguration(abstract: "List all supported WeChat versions")
|
||||
|
||||
@OptionGroup
|
||||
var options: Tweak.Options
|
||||
|
||||
mutating func run() async throws {
|
||||
print("------ Current version ------")
|
||||
print(try await Command.version(app: options.app) ?? "unknown")
|
||||
print("------ Supported versions ------")
|
||||
try await Config.load(url: options.config).forEach({ print($0.version) })
|
||||
Darwin.exit(EXIT_SUCCESS)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Patch
|
||||
extension Tweak {
|
||||
struct Patch: AsyncParsableCommand {
|
||||
static let configuration = CommandConfiguration(abstract: "Patch WeChat.app")
|
||||
|
||||
@OptionGroup
|
||||
var options: Tweak.Options
|
||||
|
||||
mutating func run() async throws {
|
||||
print("------ Version ------")
|
||||
let version = try await Command.version(app: options.app)
|
||||
print("WeChat version: \(version ?? "unknown")")
|
||||
|
||||
print("------ Config ------")
|
||||
guard let config = (try await Config.load(url: options.config)).first(where: { $0.version == version }) else {
|
||||
throw Error.unsupportedVersion
|
||||
}
|
||||
print("Matched config: \(config)")
|
||||
|
||||
print("------ Patch ------")
|
||||
try await Command.patch(
|
||||
app: options.app,
|
||||
config: config
|
||||
)
|
||||
print("Done!")
|
||||
|
||||
print("------ Resign ------")
|
||||
try await Command.resign(
|
||||
app: options.app
|
||||
)
|
||||
print("Done!")
|
||||
|
||||
Darwin.exit(EXIT_SUCCESS)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: Tweak
|
||||
struct Tweak: AsyncParsableCommand {
|
||||
enum Error: LocalizedError {
|
||||
case invalidApp
|
||||
case invalidConfig
|
||||
case invalidVersion
|
||||
case unsupportedVersion
|
||||
|
||||
var errorDescription: String? {
|
||||
switch self {
|
||||
case .invalidApp:
|
||||
return "Invalid app path"
|
||||
case .invalidConfig:
|
||||
return "Invalid patch config"
|
||||
case .invalidVersion:
|
||||
return "Invalid app version"
|
||||
case .unsupportedVersion:
|
||||
return "Unsupported WeChat version"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct Options: ParsableArguments {
|
||||
@Option(
|
||||
name: .shortAndLong,
|
||||
help: "Path of WeChat.app",
|
||||
transform: {
|
||||
guard FileManager.default.fileExists(atPath: $0) else {
|
||||
throw Error.invalidApp
|
||||
}
|
||||
return URL(fileURLWithPath: $0)
|
||||
}
|
||||
)
|
||||
var app: URL = URL(fileURLWithPath: "/Applications/WeChat.app", isDirectory: true)
|
||||
|
||||
@Option(
|
||||
name: .shortAndLong,
|
||||
help: "Local path or Remote URL of config.json",
|
||||
transform: {
|
||||
if FileManager.default.fileExists(atPath: $0) {
|
||||
return URL(fileURLWithPath: $0)
|
||||
} else {
|
||||
guard let url = URL(string: $0) else {
|
||||
throw Error.invalidConfig
|
||||
}
|
||||
return url
|
||||
}
|
||||
}
|
||||
)
|
||||
var config: URL = URL(string:"https://raw.githubusercontent.com/sunnyyoung/WeChatTweak/refs/heads/master/config.json")!
|
||||
}
|
||||
|
||||
static let configuration = CommandConfiguration(
|
||||
commandName: "wechattweak",
|
||||
abstract: "A command-line tool for tweaking WeChat.",
|
||||
subcommands: [
|
||||
Versions.self,
|
||||
Patch.self
|
||||
]
|
||||
)
|
||||
|
||||
mutating func run() async throws {
|
||||
print(Tweak.helpMessage())
|
||||
Darwin.exit(EXIT_SUCCESS)
|
||||
}
|
||||
}
|
||||
|
||||
Task {
|
||||
await Tweak.main()
|
||||
}
|
||||
|
||||
Dispatch.dispatchMain()
|
||||
BIN
WeChat.alfredworkflow
Normal file
BIN
WeChat.alfredworkflow
Normal file
Binary file not shown.
53
WeChatTweak.lbaction/Contents/Info.plist
Normal file
53
WeChatTweak.lbaction/Contents/Info.plist
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>icon.png</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.viko16.LaunchBar.action.WeChatTweak</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>WeChatTweak</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LBAbbreviation</key>
|
||||
<string>wc</string>
|
||||
<key>LBDescription</key>
|
||||
<dict>
|
||||
<key>LBAuthor</key>
|
||||
<string>viko16</string>
|
||||
<key>LBEmail</key>
|
||||
<string></string>
|
||||
<key>LBSummary</key>
|
||||
<string>A LaunchBar action for WeChatTweak.</string>
|
||||
<key>LBTwitter</key>
|
||||
<string></string>
|
||||
<key>LBWebsiteURL</key>
|
||||
<string>https://github.com/viko16</string>
|
||||
</dict>
|
||||
<key>LBScripts</key>
|
||||
<dict>
|
||||
<key>LBDefaultScript</key>
|
||||
<dict>
|
||||
<key>LBAcceptedArgumentTypes</key>
|
||||
<array>
|
||||
<string>string</string>
|
||||
</array>
|
||||
<key>LBKeepWindowActive</key>
|
||||
<true/>
|
||||
<key>LBLiveFeedbackEnabled</key>
|
||||
<true/>
|
||||
<key>LBRequiresArgument</key>
|
||||
<true/>
|
||||
<key>LBResultType</key>
|
||||
<string>unknown</string>
|
||||
<key>LBReturnsResult</key>
|
||||
<true/>
|
||||
<key>LBScriptName</key>
|
||||
<string>default.js</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>LBTextInputTitle</key>
|
||||
<string>Search your friend...</string>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
WeChatTweak.lbaction/Contents/Resources/icon.png
Normal file
BIN
WeChatTweak.lbaction/Contents/Resources/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
32
WeChatTweak.lbaction/Contents/Scripts/default.js
Normal file
32
WeChatTweak.lbaction/Contents/Scripts/default.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// LaunchBar Action Script
|
||||
|
||||
function run(string) {
|
||||
if (!string) return [];
|
||||
|
||||
var url = 'http://localhost:48065/wechat/search?keyword=';
|
||||
var result = HTTP.getJSON(url + encodeURIComponent(string.trim()));
|
||||
|
||||
if (result == undefined) {
|
||||
LaunchBar.alert('HTTP.getJSON() returned undefined');
|
||||
return [];
|
||||
}
|
||||
|
||||
if (result.error != undefined) {
|
||||
LaunchBar.log('Error in HTTP request: ' + result.error);
|
||||
return [];
|
||||
}
|
||||
|
||||
return result.data.map(function (i) {
|
||||
return {
|
||||
title: i.m_nsRemark || i.m_nsNickName,
|
||||
subtitle: i.m_nsNickName,
|
||||
icon: i.wt_avatarPath || 'icon.png',
|
||||
action: "open",
|
||||
actionArgument: i.m_nsUsrName
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function open(id) {
|
||||
HTTP.get('http://localhost:48065/wechat/start?session=' + id);
|
||||
}
|
||||
548
WeChatTweak.xcodeproj/project.pbxproj
Normal file
548
WeChatTweak.xcodeproj/project.pbxproj
Normal file
|
|
@ -0,0 +1,548 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
7D14E5A41F6447DB00D75132 /* AlfredManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D14E5A21F6447DB00D75132 /* AlfredManager.h */; };
|
||||
7D14E5A51F6447DB00D75132 /* AlfredManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D14E5A31F6447DB00D75132 /* AlfredManager.m */; };
|
||||
7D2194C32646E62E0068F4CC /* AutoAuth.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D2194C12646E62E0068F4CC /* AutoAuth.h */; };
|
||||
7D2194C42646E62E0068F4CC /* AutoAuth.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D2194C22646E62E0068F4CC /* AutoAuth.m */; };
|
||||
7D2194CB264701950068F4CC /* AntiRevoke.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D2194C9264701950068F4CC /* AntiRevoke.h */; };
|
||||
7D2194CC264701950068F4CC /* AntiRevoke.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D2194CA264701950068F4CC /* AntiRevoke.m */; };
|
||||
7D54A05C20E74D9400CB5306 /* TweakPreferencesController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D54A05E20E74D9400CB5306 /* TweakPreferencesController.xib */; };
|
||||
7D54A06A20E74FE500CB5306 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7D54A06C20E74FE500CB5306 /* Localizable.strings */; };
|
||||
7D9049F51F82A41A004E6370 /* fishhook.c in Sources */ = {isa = PBXBuildFile; fileRef = 7D9049F31F82A415004E6370 /* fishhook.c */; };
|
||||
7D9049F61F82A41A004E6370 /* fishhook.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D9049F41F82A415004E6370 /* fishhook.h */; };
|
||||
7D9049F91F82B6FB004E6370 /* NSString+WeChatTweak.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D9049F81F82B6FB004E6370 /* NSString+WeChatTweak.m */; };
|
||||
7D9049FA1F82B708004E6370 /* NSString+WeChatTweak.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D9049F71F82B6FB004E6370 /* NSString+WeChatTweak.h */; };
|
||||
7DB8AFBE206211D900E683AE /* WTConfigManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DB8AFBC206211D900E683AE /* WTConfigManager.h */; };
|
||||
7DB8AFBF206211D900E683AE /* WTConfigManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DB8AFBD206211D900E683AE /* WTConfigManager.m */; };
|
||||
7DF8422C1F40583F00D42D79 /* WeChatTweak.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8422A1F40583F00D42D79 /* WeChatTweak.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
7DF842341F4058AB00D42D79 /* WeChatTweak.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DF842331F4058AB00D42D79 /* WeChatTweak.m */; };
|
||||
7DF842521F4058C600D42D79 /* TweakPreferencesController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8424F1F4058C600D42D79 /* TweakPreferencesController.h */; };
|
||||
7DF842531F4058C600D42D79 /* TweakPreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DF842501F4058C600D42D79 /* TweakPreferencesController.m */; };
|
||||
7DF8425B1F4058DD00D42D79 /* NSBundle+WeChatTweak.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF842571F4058DD00D42D79 /* NSBundle+WeChatTweak.h */; };
|
||||
7DF8425C1F4058DD00D42D79 /* NSBundle+WeChatTweak.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DF842581F4058DD00D42D79 /* NSBundle+WeChatTweak.m */; };
|
||||
7DF842601F40590500D42D79 /* WeChatTweakHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */; };
|
||||
7DF842651F40594400D42D79 /* Prefs-Tweak.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 7DF842641F40594400D42D79 /* Prefs-Tweak.tiff */; };
|
||||
D84599A16A2504BCF95DB436 /* libPods-WeChatTweak.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 153504EC5C9196C0D85213CF /* libPods-WeChatTweak.a */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
153504EC5C9196C0D85213CF /* libPods-WeChatTweak.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-WeChatTweak.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7D14E5A21F6447DB00D75132 /* AlfredManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlfredManager.h; sourceTree = "<group>"; };
|
||||
7D14E5A31F6447DB00D75132 /* AlfredManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AlfredManager.m; sourceTree = "<group>"; };
|
||||
7D2194C12646E62E0068F4CC /* AutoAuth.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AutoAuth.h; sourceTree = "<group>"; };
|
||||
7D2194C22646E62E0068F4CC /* AutoAuth.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AutoAuth.m; sourceTree = "<group>"; };
|
||||
7D2194C9264701950068F4CC /* AntiRevoke.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AntiRevoke.h; sourceTree = "<group>"; };
|
||||
7D2194CA264701950068F4CC /* AntiRevoke.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AntiRevoke.m; sourceTree = "<group>"; };
|
||||
7D54A05F20E74E4600CB5306 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/TweakPreferencesController.xib; sourceTree = "<group>"; };
|
||||
7D54A07020E74FFD00CB5306 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
7D54A07120E7535F00CB5306 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
|
||||
7D54A07220E7536300CB5306 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
|
||||
7D9049F31F82A415004E6370 /* fishhook.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = fishhook.c; sourceTree = "<group>"; };
|
||||
7D9049F41F82A415004E6370 /* fishhook.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fishhook.h; sourceTree = "<group>"; };
|
||||
7D9049F71F82B6FB004E6370 /* NSString+WeChatTweak.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+WeChatTweak.h"; sourceTree = "<group>"; };
|
||||
7D9049F81F82B6FB004E6370 /* NSString+WeChatTweak.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSString+WeChatTweak.m"; sourceTree = "<group>"; };
|
||||
7DB8AFBC206211D900E683AE /* WTConfigManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WTConfigManager.h; sourceTree = "<group>"; };
|
||||
7DB8AFBD206211D900E683AE /* WTConfigManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WTConfigManager.m; sourceTree = "<group>"; };
|
||||
7DF7065D23A8B69000DEA8F6 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/TweakPreferencesController.xib; sourceTree = "<group>"; };
|
||||
7DF7065E23A8B69A00DEA8F6 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "zh-Hans"; path = "zh-Hans.lproj/TweakPreferencesController.xib"; sourceTree = "<group>"; };
|
||||
7DF7065F23A8B6A400DEA8F6 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "zh-Hant"; path = "zh-Hant.lproj/TweakPreferencesController.xib"; sourceTree = "<group>"; };
|
||||
7DF842271F40583F00D42D79 /* WeChatTweak.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WeChatTweak.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7DF8422A1F40583F00D42D79 /* WeChatTweak.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WeChatTweak.h; sourceTree = "<group>"; };
|
||||
7DF8422B1F40583F00D42D79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
7DF842331F4058AB00D42D79 /* WeChatTweak.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WeChatTweak.m; sourceTree = "<group>"; };
|
||||
7DF8424F1F4058C600D42D79 /* TweakPreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TweakPreferencesController.h; sourceTree = "<group>"; };
|
||||
7DF842501F4058C600D42D79 /* TweakPreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TweakPreferencesController.m; sourceTree = "<group>"; };
|
||||
7DF842571F4058DD00D42D79 /* NSBundle+WeChatTweak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSBundle+WeChatTweak.h"; sourceTree = "<group>"; };
|
||||
7DF842581F4058DD00D42D79 /* NSBundle+WeChatTweak.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSBundle+WeChatTweak.m"; sourceTree = "<group>"; };
|
||||
7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeChatTweakHeaders.h; sourceTree = "<group>"; };
|
||||
7DF842641F40594400D42D79 /* Prefs-Tweak.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "Prefs-Tweak.tiff"; sourceTree = "<group>"; };
|
||||
A82E6F61C63DBD47219BB308 /* Pods-WeChatTweak.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeChatTweak.debug.xcconfig"; path = "Pods/Target Support Files/Pods-WeChatTweak/Pods-WeChatTweak.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
B418F83DA5D4A992F73514A9 /* Pods-WeChatTweak.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-WeChatTweak.release.xcconfig"; path = "Pods/Target Support Files/Pods-WeChatTweak/Pods-WeChatTweak.release.xcconfig"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
7DF842231F40583F00D42D79 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D84599A16A2504BCF95DB436 /* libPods-WeChatTweak.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
785C3947774E235ED4EB5A14 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
153504EC5C9196C0D85213CF /* libPods-WeChatTweak.a */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7D5AAF3320DF4B7B00860EEE /* Manager */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7D14E5A21F6447DB00D75132 /* AlfredManager.h */,
|
||||
7D14E5A31F6447DB00D75132 /* AlfredManager.m */,
|
||||
7DB8AFBC206211D900E683AE /* WTConfigManager.h */,
|
||||
7DB8AFBD206211D900E683AE /* WTConfigManager.m */,
|
||||
);
|
||||
path = Manager;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7D5AAF3520DF4B9700860EEE /* Controller */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7DF8424F1F4058C600D42D79 /* TweakPreferencesController.h */,
|
||||
7DF842501F4058C600D42D79 /* TweakPreferencesController.m */,
|
||||
7D54A05E20E74D9400CB5306 /* TweakPreferencesController.xib */,
|
||||
);
|
||||
path = Controller;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7D5AAF3620DF4BA400860EEE /* Category */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7DF842571F4058DD00D42D79 /* NSBundle+WeChatTweak.h */,
|
||||
7DF842581F4058DD00D42D79 /* NSBundle+WeChatTweak.m */,
|
||||
7D9049F71F82B6FB004E6370 /* NSString+WeChatTweak.h */,
|
||||
7D9049F81F82B6FB004E6370 /* NSString+WeChatTweak.m */,
|
||||
);
|
||||
path = Category;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7D5AAF3720DF4BB300860EEE /* Vendor */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7D9049F41F82A415004E6370 /* fishhook.h */,
|
||||
7D9049F31F82A415004E6370 /* fishhook.c */,
|
||||
);
|
||||
path = Vendor;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7D5AAF3820DF4BC400860EEE /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7DF8425F1F40590500D42D79 /* WeChatTweakHeaders.h */,
|
||||
7DF8422B1F40583F00D42D79 /* Info.plist */,
|
||||
7D54A06C20E74FE500CB5306 /* Localizable.strings */,
|
||||
);
|
||||
path = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7DF8421D1F40583F00D42D79 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7DF842291F40583F00D42D79 /* WeChatTweak */,
|
||||
7DF842281F40583F00D42D79 /* Products */,
|
||||
FEFA9C3F34481028661EEC5A /* Pods */,
|
||||
785C3947774E235ED4EB5A14 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7DF842281F40583F00D42D79 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7DF842271F40583F00D42D79 /* WeChatTweak.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7DF842291F40583F00D42D79 /* WeChatTweak */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7DF8422A1F40583F00D42D79 /* WeChatTweak.h */,
|
||||
7DF842331F4058AB00D42D79 /* WeChatTweak.m */,
|
||||
7D2194C12646E62E0068F4CC /* AutoAuth.h */,
|
||||
7D2194C22646E62E0068F4CC /* AutoAuth.m */,
|
||||
7D2194C9264701950068F4CC /* AntiRevoke.h */,
|
||||
7D2194CA264701950068F4CC /* AntiRevoke.m */,
|
||||
7D5AAF3720DF4BB300860EEE /* Vendor */,
|
||||
7D5AAF3620DF4BA400860EEE /* Category */,
|
||||
7D5AAF3520DF4B9700860EEE /* Controller */,
|
||||
7D5AAF3320DF4B7B00860EEE /* Manager */,
|
||||
7DF842631F40594400D42D79 /* Resources */,
|
||||
7D5AAF3820DF4BC400860EEE /* Supporting Files */,
|
||||
);
|
||||
path = WeChatTweak;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7DF842631F40594400D42D79 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7DF842641F40594400D42D79 /* Prefs-Tweak.tiff */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
FEFA9C3F34481028661EEC5A /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A82E6F61C63DBD47219BB308 /* Pods-WeChatTweak.debug.xcconfig */,
|
||||
B418F83DA5D4A992F73514A9 /* Pods-WeChatTweak.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
7DF842241F40583F00D42D79 /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7D9049FA1F82B708004E6370 /* NSString+WeChatTweak.h in Headers */,
|
||||
7DF8422C1F40583F00D42D79 /* WeChatTweak.h in Headers */,
|
||||
7DF8425B1F4058DD00D42D79 /* NSBundle+WeChatTweak.h in Headers */,
|
||||
7DB8AFBE206211D900E683AE /* WTConfigManager.h in Headers */,
|
||||
7D9049F61F82A41A004E6370 /* fishhook.h in Headers */,
|
||||
7D14E5A41F6447DB00D75132 /* AlfredManager.h in Headers */,
|
||||
7D2194CB264701950068F4CC /* AntiRevoke.h in Headers */,
|
||||
7DF842601F40590500D42D79 /* WeChatTweakHeaders.h in Headers */,
|
||||
7DF842521F4058C600D42D79 /* TweakPreferencesController.h in Headers */,
|
||||
7D2194C32646E62E0068F4CC /* AutoAuth.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
7DF842261F40583F00D42D79 /* WeChatTweak */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 7DF8422F1F40583F00D42D79 /* Build configuration list for PBXNativeTarget "WeChatTweak" */;
|
||||
buildPhases = (
|
||||
CB198514792C1F69F3B65026 /* [CP] Check Pods Manifest.lock */,
|
||||
7DF842221F40583F00D42D79 /* Sources */,
|
||||
7DF842231F40583F00D42D79 /* Frameworks */,
|
||||
7DF842241F40583F00D42D79 /* Headers */,
|
||||
7DF842251F40583F00D42D79 /* Resources */,
|
||||
7DE5D07F218319DF00ABCE56 /* Export Framework */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = WeChatTweak;
|
||||
productName = WeChatTweak;
|
||||
productReference = 7DF842271F40583F00D42D79 /* WeChatTweak.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
7DF8421E1F40583F00D42D79 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0940;
|
||||
ORGANIZATIONNAME = Sunnyyoung;
|
||||
TargetAttributes = {
|
||||
7DF842261F40583F00D42D79 = {
|
||||
CreatedOnToolsVersion = 8.3.3;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 7DF842211F40583F00D42D79 /* Build configuration list for PBXProject "WeChatTweak" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
"zh-Hans",
|
||||
"zh-Hant",
|
||||
);
|
||||
mainGroup = 7DF8421D1F40583F00D42D79;
|
||||
productRefGroup = 7DF842281F40583F00D42D79 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
7DF842261F40583F00D42D79 /* WeChatTweak */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
7DF842251F40583F00D42D79 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7DF842651F40594400D42D79 /* Prefs-Tweak.tiff in Resources */,
|
||||
7D54A06A20E74FE500CB5306 /* Localizable.strings in Resources */,
|
||||
7D54A05C20E74D9400CB5306 /* TweakPreferencesController.xib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
7DE5D07F218319DF00ABCE56 /* Export Framework */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputFileListPaths = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Export Framework";
|
||||
outputFileListPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "FRAMEWORK=\"${TARGET_NAME}.framework\"\nln -sf \"${BUILT_PRODUCTS_DIR}/${FRAMEWORK}\" \"${SRCROOT}\"\n";
|
||||
};
|
||||
CB198514792C1F69F3B65026 /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
|
||||
"${PODS_ROOT}/Manifest.lock",
|
||||
);
|
||||
name = "[CP] Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
"$(DERIVED_FILE_DIR)/Pods-WeChatTweak-checkManifestLockResult.txt",
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
7DF842221F40583F00D42D79 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7D14E5A51F6447DB00D75132 /* AlfredManager.m in Sources */,
|
||||
7DF842531F4058C600D42D79 /* TweakPreferencesController.m in Sources */,
|
||||
7D9049F91F82B6FB004E6370 /* NSString+WeChatTweak.m in Sources */,
|
||||
7D2194CC264701950068F4CC /* AntiRevoke.m in Sources */,
|
||||
7DF842341F4058AB00D42D79 /* WeChatTweak.m in Sources */,
|
||||
7DB8AFBF206211D900E683AE /* WTConfigManager.m in Sources */,
|
||||
7D9049F51F82A41A004E6370 /* fishhook.c in Sources */,
|
||||
7DF8425C1F4058DD00D42D79 /* NSBundle+WeChatTweak.m in Sources */,
|
||||
7D2194C42646E62E0068F4CC /* AutoAuth.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
7D54A05E20E74D9400CB5306 /* TweakPreferencesController.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
7D54A05F20E74E4600CB5306 /* Base */,
|
||||
7DF7065D23A8B69000DEA8F6 /* en */,
|
||||
7DF7065E23A8B69A00DEA8F6 /* zh-Hans */,
|
||||
7DF7065F23A8B6A400DEA8F6 /* zh-Hant */,
|
||||
);
|
||||
name = TweakPreferencesController.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7D54A06C20E74FE500CB5306 /* Localizable.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
7D54A07020E74FFD00CB5306 /* en */,
|
||||
7D54A07120E7535F00CB5306 /* zh-Hans */,
|
||||
7D54A07220E7536300CB5306 /* zh-Hant */,
|
||||
);
|
||||
name = Localizable.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
7DF8422D1F40583F00D42D79 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 12;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MARKETING_VERSION = 1.2.1;
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
7DF8422E1F40583F00D42D79 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 12;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.11;
|
||||
MARKETING_VERSION = 1.2.1;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
7DF842301F40583F00D42D79 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = A82E6F61C63DBD47219BB308 /* Pods-WeChatTweak.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 13;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 9;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_VERSION = A;
|
||||
INFOPLIST_FILE = "WeChatTweak/Supporting Files/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
MARKETING_VERSION = 1.2.2;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = app.tweaks.WeChatTweak;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
7DF842311F40583F00D42D79 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = B418F83DA5D4A992F73514A9 /* Pods-WeChatTweak.release.xcconfig */;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "";
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 13;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 9;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_VERSION = A;
|
||||
INFOPLIST_FILE = "WeChatTweak/Supporting Files/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
|
||||
MARKETING_VERSION = 1.2.2;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = app.tweaks.WeChatTweak;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
7DF842211F40583F00D42D79 /* Build configuration list for PBXProject "WeChatTweak" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
7DF8422D1F40583F00D42D79 /* Debug */,
|
||||
7DF8422E1F40583F00D42D79 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
7DF8422F1F40583F00D42D79 /* Build configuration list for PBXNativeTarget "WeChatTweak" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
7DF842301F40583F00D42D79 /* Debug */,
|
||||
7DF842311F40583F00D42D79 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 7DF8421E1F40583F00D42D79 /* Project object */;
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1120"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "7DF842261F40583F00D42D79"
|
||||
BuildableName = "WeChatTweak.framework"
|
||||
BlueprintName = "WeChatTweak"
|
||||
ReferencedContainer = "container:WeChatTweak.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "7DF842261F40583F00D42D79"
|
||||
BuildableName = "WeChatTweak.framework"
|
||||
BlueprintName = "WeChatTweak"
|
||||
ReferencedContainer = "container:WeChatTweak.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "7DF842261F40583F00D42D79"
|
||||
BuildableName = "WeChatTweak.framework"
|
||||
BlueprintName = "WeChatTweak"
|
||||
ReferencedContainer = "container:WeChatTweak.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
10
WeChatTweak.xcworkspace/contents.xcworkspacedata
generated
Normal file
10
WeChatTweak.xcworkspace/contents.xcworkspacedata
generated
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:WeChatTweak.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
20
WeChatTweak/AntiRevoke.h
Normal file
20
WeChatTweak/AntiRevoke.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
//
|
||||
// AntiRevoke.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2021/5/9.
|
||||
// Copyright © 2021 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <JRSwizzle/JRSwizzle.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NSObject (AntiRevoke)
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
230
WeChatTweak/AntiRevoke.m
Normal file
230
WeChatTweak/AntiRevoke.m
Normal file
|
|
@ -0,0 +1,230 @@
|
|||
//
|
||||
// AntiRevoke.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2021/5/9.
|
||||
// Copyright © 2021 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AntiRevoke.h"
|
||||
#import "WeChatTweakHeaders.h"
|
||||
#import "WTConfigManager.h"
|
||||
#import "NSString+WeChatTweak.h"
|
||||
#import "NSBundle+WeChatTweak.h"
|
||||
|
||||
@implementation NSObject (AntiRevoke)
|
||||
|
||||
static void __attribute__((constructor)) tweak(void) {
|
||||
[objc_getClass("FFProcessReqsvrZZ") jr_swizzleMethod:NSSelectorFromString(@"FFToNameFavChatZZ:sessionMsgList:") withMethod:@selector(tweak_FFToNameFavChatZZ:sessionMsgList:) error:nil];
|
||||
|
||||
[objc_getClass("MMMessageCellView") jr_swizzleMethod:NSSelectorFromString(@"initWithFrame:") withMethod:@selector(tweak_initWithFrame:) error:nil];
|
||||
[objc_getClass("MMMessageCellView") jr_swizzleMethod:NSSelectorFromString(@"populateWithMessage:") withMethod:@selector(tweak_populateWithMessage:) error:nil];
|
||||
[objc_getClass("MMMessageCellView") jr_swizzleMethod:NSSelectorFromString(@"layout") withMethod:@selector(tweak_layout) error:nil];
|
||||
}
|
||||
|
||||
- (void)tweak_FFToNameFavChatZZ:(MessageData *)message sessionMsgList:(nullable id)sessionMsgList {
|
||||
// - (id)GetMsgData:(id)arg1 svrId:(unsigned long long)arg2;
|
||||
SEL GetMsgDataSelector = NSSelectorFromString(@"GetMsgData:svrId:");
|
||||
if (![self respondsToSelector:GetMsgDataSelector]) {
|
||||
// Fallback to origin method
|
||||
return [self tweak_FFToNameFavChatZZ:message sessionMsgList:sessionMsgList];
|
||||
}
|
||||
// Decode message
|
||||
NSString *session = [message.msgContent tweak_subStringFrom:@"<session>" to:@"</session>"];
|
||||
NSUInteger newMessageID = [message.msgContent tweak_subStringFrom:@"<newmsgid>" to:@"</newmsgid>"].longLongValue;
|
||||
NSString *replaceMessage = [message.msgContent tweak_subStringFrom:@"<replacemsg><![CDATA[" to:@"]]></replacemsg>"];
|
||||
// Get message data
|
||||
MessageData *messageData = ((id (*)(id, SEL, id, unsigned long long))objc_msgSend)(self, GetMsgDataSelector, session, newMessageID);
|
||||
if (messageData.isSendFromSelf) {
|
||||
// Fallback to origin method
|
||||
[self tweak_FFToNameFavChatZZ:message sessionMsgList:sessionMsgList];
|
||||
} else {
|
||||
switch (WTConfigManager.sharedInstance.revokedMessageStyle) {
|
||||
case WTRevokedMessageStyleClassic:
|
||||
[self handleRevokedMessageIntoClassicStyleWithSession:session messageData:messageData replaceMessage:replaceMessage];
|
||||
break;
|
||||
case WTRevokedMessageStyleMask:
|
||||
[self handleRevokedMessageIntoMaskStyleWithSession:session messageData:messageData replaceMessage:replaceMessage];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)handleRevokedMessageIntoClassicStyleWithSession:(NSString *)session messageData:(MessageData *)messageData replaceMessage:(NSString *)replaceMessage {
|
||||
// Prepare message data
|
||||
MessageData *localMessageData = messageData;
|
||||
MessageData *promptMessageData = ({
|
||||
MessageData *data = [[objc_getClass("MessageData") alloc] initWithMsgType:10000];
|
||||
data.msgStatus = 4;
|
||||
data.toUsrName = localMessageData.toUsrName;
|
||||
data.fromUsrName = localMessageData.fromUsrName;
|
||||
data.mesSvrID = localMessageData.mesSvrID;
|
||||
data.mesLocalID = localMessageData.mesLocalID;
|
||||
data.msgCreateTime = localMessageData.msgCreateTime;
|
||||
data.msgContent = ({
|
||||
NSString *fromUserName = [replaceMessage componentsSeparatedByString:@" "].firstObject;
|
||||
NSString *userRevoke = [NSString stringWithFormat:@"%@ %@ ", fromUserName, [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.Recalled"]];
|
||||
NSString *tips = [NSString stringWithFormat:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.InterceptedARecalledMessage"], userRevoke];
|
||||
NSMutableString *msgContent = [NSMutableString stringWithString:tips];
|
||||
switch (localMessageData.messageType) {
|
||||
case MessageDataTypeText: {
|
||||
if (localMessageData.msgContent.length) {
|
||||
if ([session rangeOfString:@"@chatroom"].location == NSNotFound) {
|
||||
[msgContent appendFormat:@"\"%@\"", localMessageData.msgContent];
|
||||
} else {
|
||||
[msgContent appendFormat:@"\"%@\"", [localMessageData.msgContent componentsSeparatedByString:@":\n"].lastObject];
|
||||
}
|
||||
} else {
|
||||
[msgContent appendString:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.AMessage"]];
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MessageDataTypeImage:
|
||||
[msgContent appendFormat:@"<%@>", [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.Image"]]; break;
|
||||
case MessageDataTypeVoice:
|
||||
[msgContent appendFormat:@"<%@>", [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.Voice"]]; break;
|
||||
case MessageDataTypeVideo:
|
||||
[msgContent appendFormat:@"<%@>", [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.Video"]]; break;
|
||||
case MessageDataTypeSticker:
|
||||
[msgContent appendFormat:@"<%@>", [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.Sticker"]]; break;
|
||||
case MessageDataTypeAppUrl:
|
||||
[msgContent appendFormat:@"<%@>", [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.Link"]]; break;
|
||||
default:
|
||||
[msgContent appendString:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.Message.AMessage"]]; break;
|
||||
}
|
||||
msgContent.copy;
|
||||
});
|
||||
data;
|
||||
});
|
||||
// Prepare notification information
|
||||
MMServiceCenter *serviceCenter = [objc_getClass("MMServiceCenter") defaultCenter];
|
||||
NSUserNotification *userNotification = [[NSUserNotification alloc] init];
|
||||
BOOL isChatStatusNotifyOpen = YES;
|
||||
if ([session rangeOfString:@"@chatroom"].location == NSNotFound) {
|
||||
ContactStorage *contactStorage = [serviceCenter getService:objc_getClass("ContactStorage")];
|
||||
WCContactData *contact = [contactStorage GetContact:session];
|
||||
isChatStatusNotifyOpen = [contact isChatStatusNotifyOpen];
|
||||
userNotification.informativeText = replaceMessage;
|
||||
} else {
|
||||
GroupStorage *groupStorage = [serviceCenter getService:objc_getClass("GroupStorage")];
|
||||
WCContactData *groupContact = [groupStorage GetGroupContact:session];
|
||||
isChatStatusNotifyOpen = [groupContact isChatStatusNotifyOpen];
|
||||
NSString *groupName = groupContact.m_nsNickName.length ? groupContact.m_nsNickName : [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Title.Group"];
|
||||
userNotification.informativeText = [NSString stringWithFormat:@"%@: %@", groupName, replaceMessage];
|
||||
}
|
||||
// - (void)AddLocalMsg:(id)arg1 msgData:(id)arg2;
|
||||
SEL addMsgSelector = NSSelectorFromString(@"AddLocalMsg:msgData:");
|
||||
if ([self respondsToSelector:addMsgSelector]) {
|
||||
((void (*)(id, SEL, id, id))objc_msgSend)(self, addMsgSelector, session, promptMessageData);
|
||||
}
|
||||
// Dispatch notification
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// Deliver notification
|
||||
RevokeNotificationType notificationType = [[NSUserDefaults standardUserDefaults] integerForKey:WeChatTweakPreferenceRevokeNotificationTypeKey];
|
||||
if (notificationType == RevokeNotificationTypeReceiveAll || (notificationType == RevokeNotificationTypeFollow && isChatStatusNotifyOpen)) {
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:userNotification];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (void)handleRevokedMessageIntoMaskStyleWithSession:(NSString *)session messageData:(MessageData *)messageData replaceMessage:(NSString *)replaceMessage {
|
||||
MMRevokeMsgService *service = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MMRevokeMsgService")];
|
||||
[service.db insertRevokeMsg:({
|
||||
RevokeMsgItem *item = [[objc_getClass("RevokeMsgItem") alloc] init];
|
||||
item.svrId = @(messageData.mesSvrID).stringValue;
|
||||
item.createTime = UINT32_MAX;
|
||||
item;
|
||||
})];
|
||||
WeChat *wechat = [objc_getClass("WeChat") sharedInstance];
|
||||
if ([wechat respondsToSelector:NSSelectorFromString(@"chatsViewController")]) {
|
||||
id chatsViewController = [wechat valueForKey:@"chatsViewController"];
|
||||
if ([chatsViewController respondsToSelector:NSSelectorFromString(@"chatDetailSplitViewController")]) {
|
||||
id chatDetailSplitViewController = [chatsViewController valueForKey:@"chatDetailSplitViewController"];
|
||||
if ([chatDetailSplitViewController respondsToSelector:NSSelectorFromString(@"chatMessageViewController")]) {
|
||||
id chatMessageViewController = [chatDetailSplitViewController valueForKey:@"chatMessageViewController"];
|
||||
if ([chatMessageViewController respondsToSelector:NSSelectorFromString(@"reloadTableView")]) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
((void (*)(id, SEL))objc_msgSend)(chatMessageViewController, NSSelectorFromString(@"reloadTableView"));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Prepare notification information
|
||||
MMServiceCenter *serviceCenter = [objc_getClass("MMServiceCenter") defaultCenter];
|
||||
NSUserNotification *userNotification = [[NSUserNotification alloc] init];
|
||||
BOOL isChatStatusNotifyOpen = YES;
|
||||
if ([session rangeOfString:@"@chatroom"].location == NSNotFound) {
|
||||
ContactStorage *contactStorage = [serviceCenter getService:objc_getClass("ContactStorage")];
|
||||
WCContactData *contact = [contactStorage GetContact:session];
|
||||
isChatStatusNotifyOpen = [contact isChatStatusNotifyOpen];
|
||||
userNotification.informativeText = replaceMessage;
|
||||
} else {
|
||||
GroupStorage *groupStorage = [serviceCenter getService:objc_getClass("GroupStorage")];
|
||||
WCContactData *groupContact = [groupStorage GetGroupContact:session];
|
||||
isChatStatusNotifyOpen = [groupContact isChatStatusNotifyOpen];
|
||||
NSString *groupName = groupContact.m_nsNickName.length ? groupContact.m_nsNickName : [NSBundle.tweakBundle localizedStringForKey:@"Tweak.Title.Group"];
|
||||
userNotification.informativeText = [NSString stringWithFormat:@"%@: %@", groupName, replaceMessage];
|
||||
}
|
||||
// Dispatch notification
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// Deliver notification
|
||||
RevokeNotificationType notificationType = [[NSUserDefaults standardUserDefaults] integerForKey:WeChatTweakPreferenceRevokeNotificationTypeKey];
|
||||
if (notificationType == RevokeNotificationTypeReceiveAll || (notificationType == RevokeNotificationTypeFollow && isChatStatusNotifyOpen)) {
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:userNotification];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (instancetype)tweak_initWithFrame:(NSRect)arg1 {
|
||||
MMMessageCellView *view = (MMMessageCellView *)[self tweak_initWithFrame:arg1];
|
||||
NSTextField *revokeTextField = [[NSTextField alloc] init];
|
||||
revokeTextField.hidden = YES;
|
||||
revokeTextField.editable = NO;
|
||||
revokeTextField.selectable = NO;
|
||||
revokeTextField.bordered = NO;
|
||||
revokeTextField.drawsBackground = NO;
|
||||
revokeTextField.usesSingleLineMode = YES;
|
||||
revokeTextField.tag = 9527;
|
||||
revokeTextField.stringValue = @"[已撤回]";
|
||||
revokeTextField.font = [NSFont systemFontOfSize:10];
|
||||
revokeTextField.textColor = [NSColor lightGrayColor];
|
||||
[revokeTextField sizeToFit];
|
||||
[view addSubview:revokeTextField];
|
||||
return view;
|
||||
}
|
||||
|
||||
- (void)tweak_populateWithMessage:(MMMessageTableItem *)tableItem {
|
||||
[self tweak_populateWithMessage:tableItem];
|
||||
MMRevokeMsgService *service = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MMRevokeMsgService")];
|
||||
BOOL style = tableItem.message.messageType != MessageDataTypePrompt && [service.db getRevokeMsg:@(tableItem.message.mesSvrID).stringValue] != NULL;
|
||||
[((MMMessageCellView *)self).subviews enumerateObjectsUsingBlock:^(__kindof NSView * _Nonnull view, NSUInteger index, BOOL * _Nonnull stop) {
|
||||
if (view.tag != 9527) {
|
||||
return ;
|
||||
}
|
||||
*stop = YES;
|
||||
view.hidden = !style;
|
||||
}];
|
||||
((MMMessageCellView *)self).layer.backgroundColor = style ? [NSColor.systemYellowColor colorWithAlphaComponent:0.3].CGColor : ((MMMessageCellView *)self).layer.backgroundColor;
|
||||
}
|
||||
|
||||
- (void)tweak_layout {
|
||||
[self tweak_layout];
|
||||
[((MMMessageCellView *)self).subviews enumerateObjectsUsingBlock:^(__kindof NSView * _Nonnull view, NSUInteger index, BOOL * _Nonnull stop) {
|
||||
if (view.tag != 9527) {
|
||||
return ;
|
||||
}
|
||||
*stop = YES;
|
||||
view.frame = ({
|
||||
NSView *avatarView = ((MMMessageCellView *)self).avatarImgView;
|
||||
CGFloat x = CGRectGetMidX(avatarView.frame) - CGRectGetWidth(view.frame) / 2.0;
|
||||
CGFloat y = CGRectGetMinY(avatarView.frame) - CGRectGetHeight(view.frame);
|
||||
NSRect frame = NSMakeRect(x, y, CGRectGetWidth(view.frame), CGRectGetHeight(view.frame));
|
||||
frame;
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
20
WeChatTweak/AutoAuth.h
Normal file
20
WeChatTweak/AutoAuth.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
//
|
||||
// AutoAuth.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2021/5/8.
|
||||
// Copyright © 2021 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <JRSwizzle/JRSwizzle.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NSObject (AutoAuth)
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
56
WeChatTweak/AutoAuth.m
Normal file
56
WeChatTweak/AutoAuth.m
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
//
|
||||
// AutoAuth.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2021/5/8.
|
||||
// Copyright © 2021 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AutoAuth.h"
|
||||
#import "WeChatTweakHeaders.h"
|
||||
#import "WTConfigManager.h"
|
||||
|
||||
@implementation NSObject(AutoAuth)
|
||||
|
||||
static void __attribute__((constructor)) tweak(void) {
|
||||
[objc_getClass("MMLoginOneClickViewController") jr_swizzleMethod:NSSelectorFromString(@"onLoginButtonClicked:") withMethod:@selector(tweak_onLoginButtonClicked:) error:nil];
|
||||
[objc_getClass("MMMainViewController") jr_swizzleMethod:NSSelectorFromString(@"viewDidLoad") withMethod:@selector(tweak_viewDidLoad) error:nil];
|
||||
[objc_getClass("LogoutCGI") jr_swizzleMethod:NSSelectorFromString(@"FFVCRecvDataAddDataToMsgChatMgrRecvZZ:") withMethod:@selector(tweak_FFVCRecvDataAddDataToMsgChatMgrRecvZZ:) error:nil];
|
||||
[objc_getClass("AccountService") jr_swizzleMethod:NSSelectorFromString(@"FFAddSvrMsgImgVCZZ") withMethod:@selector(tweak_FFAddSvrMsgImgVCZZ) error:nil];
|
||||
}
|
||||
|
||||
- (void)tweak_onLoginButtonClicked:(id)sender {
|
||||
AccountService *accountService = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("AccountService")];
|
||||
BOOL enabledAutoAuth = [NSUserDefaults.standardUserDefaults boolForKey:WeChatTweakPreferenceAutoAuthKey];
|
||||
BOOL canAutoAuth = accountService.canAutoAuth;
|
||||
if (enabledAutoAuth && canAutoAuth) {
|
||||
[accountService AutoAuth];
|
||||
} else {
|
||||
[self tweak_onLoginButtonClicked:sender];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tweak_viewDidLoad {
|
||||
[self tweak_viewDidLoad];
|
||||
if ([NSUserDefaults.standardUserDefaults boolForKey:WeChatTweakPreferenceAutoAuthKey]) {
|
||||
MMSessionMgr *mgr = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MMSessionMgr")];
|
||||
[mgr loadSessionData];
|
||||
[mgr loadBrandSessionData];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tweak_FFVCRecvDataAddDataToMsgChatMgrRecvZZ:(id)arg {
|
||||
if (![NSUserDefaults.standardUserDefaults boolForKey:WeChatTweakPreferenceAutoAuthKey]) {
|
||||
[self tweak_FFVCRecvDataAddDataToMsgChatMgrRecvZZ:arg];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tweak_FFAddSvrMsgImgVCZZ {
|
||||
if ([NSUserDefaults.standardUserDefaults boolForKey:WeChatTweakPreferenceAutoAuthKey]) {
|
||||
return;
|
||||
} else {
|
||||
[self tweak_FFAddSvrMsgImgVCZZ];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
16
WeChatTweak/Category/NSBundle+WeChatTweak.h
Normal file
16
WeChatTweak/Category/NSBundle+WeChatTweak.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// NSBundle+WeChatTweak.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/8/12.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSBundle (WeChatTweak)
|
||||
|
||||
+ (instancetype)tweakBundle;
|
||||
- (NSString *)localizedStringForKey:(NSString *)key;
|
||||
|
||||
@end
|
||||
21
WeChatTweak/Category/NSBundle+WeChatTweak.m
Normal file
21
WeChatTweak/Category/NSBundle+WeChatTweak.m
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// NSBundle+WeChatTweak.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/8/12.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSBundle+WeChatTweak.h"
|
||||
|
||||
@implementation NSBundle (WeChatTweak)
|
||||
|
||||
+ (instancetype)tweakBundle {
|
||||
return [NSBundle bundleWithIdentifier:@"app.tweaks.WeChatTweak"];
|
||||
}
|
||||
|
||||
- (NSString *)localizedStringForKey:(NSString *)key {
|
||||
return [self localizedStringForKey:key value:nil table:nil];
|
||||
}
|
||||
|
||||
@end
|
||||
15
WeChatTweak/Category/NSString+WeChatTweak.h
Normal file
15
WeChatTweak/Category/NSString+WeChatTweak.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
//
|
||||
// NSString+WeChatTweak.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/8/12.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface NSString (WeChatTweak)
|
||||
|
||||
- (NSString *)tweak_subStringFrom:(NSString *)beginString to:(NSString *)endString;
|
||||
|
||||
@end
|
||||
29
WeChatTweak/Category/NSString+WeChatTweak.m
Normal file
29
WeChatTweak/Category/NSString+WeChatTweak.m
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// NSString+WeChatTweak.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/8/12.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSString+WeChatTweak.h"
|
||||
|
||||
@implementation NSString (WeChatTweak)
|
||||
|
||||
- (NSString *)tweak_subStringFrom:(NSString *)beginString to:(NSString *)endString {
|
||||
NSRange begin = [self rangeOfString:beginString];
|
||||
if (begin.location == NSNotFound) {
|
||||
return nil;
|
||||
}
|
||||
NSRange end = [self rangeOfString:endString];
|
||||
if (end.location == NSNotFound) {
|
||||
return nil;
|
||||
}
|
||||
NSRange range = NSMakeRange(begin.location + begin.length, end.location - begin.location - begin.length);
|
||||
if (range.location == NSNotFound) {
|
||||
return nil;
|
||||
}
|
||||
return [self substringWithRange:range];
|
||||
}
|
||||
|
||||
@end
|
||||
188
WeChatTweak/Controller/Base.lproj/TweakPreferencesController.xib
Normal file
188
WeChatTweak/Controller/Base.lproj/TweakPreferencesController.xib
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15702" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15702"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="TweakPreferencesController">
|
||||
<connections>
|
||||
<outlet property="autoAuthButton" destination="5by-EJ-3f2" id="VIV-sZ-ybx"/>
|
||||
<outlet property="compressedJSONEnabledButton" destination="ylY-lF-oFq" id="yqW-Bl-hNf"/>
|
||||
<outlet property="notificationTypeButton" destination="6x2-KV-p8w" id="Kfn-2a-Yup"/>
|
||||
<outlet property="revokedMessageStyleButton" destination="eqS-1n-9dO" id="QVg-Sy-CoY"/>
|
||||
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="431" height="152"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RFE-oR-GRm">
|
||||
<rect key="frame" x="58" y="116" width="138" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Auto login:" usesSingleLineMode="YES" id="UiV-zj-l6I">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="B87-eD-uhI">
|
||||
<rect key="frame" x="10" y="84" width="186" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Message recalled notification:" usesSingleLineMode="YES" id="UKv-CM-nGt">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5by-EJ-3f2">
|
||||
<rect key="frame" x="200" y="111" width="91" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Disabled" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="Vcv-eD-OM9" id="8qB-Jj-tlv">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="sFO-8T-61S">
|
||||
<items>
|
||||
<menuItem title="Disabled" state="on" id="Vcv-eD-OM9">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Enabled" id="KQg-jN-y9a">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchAutoAuthAction:" target="-2" id="P6Q-aT-ADE"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6x2-KV-p8w">
|
||||
<rect key="frame" x="200" y="79" width="92" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Inherited" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="gec-CY-E1x" id="wek-GT-N5V">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="H2J-gJ-aGD">
|
||||
<items>
|
||||
<menuItem title="Inherited" state="on" id="gec-CY-E1x">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="All" id="da4-aJ-lEy">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Disabled" id="Uk9-Oc-Jtv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchNotificationTypeAction:" target="-2" id="xjO-Ck-wem"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zsd-Bb-6l4">
|
||||
<rect key="frame" x="32" y="52" width="164" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Alfred JSON compressing:" usesSingleLineMode="YES" id="jHw-2a-B2t">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7wK-v5-BgQ">
|
||||
<rect key="frame" x="46" y="20" width="150" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Revoked message style:" usesSingleLineMode="YES" id="mPT-nA-idf">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ylY-lF-oFq">
|
||||
<rect key="frame" x="200" y="47" width="91" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Disabled" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="MEN-Kg-wfj" id="taL-8q-Quu">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="2qr-A3-Yo5">
|
||||
<items>
|
||||
<menuItem title="Enabled" id="10G-t9-s4T">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Disabled" state="on" id="MEN-Kg-wfj">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchCompressedJSONEnabledAction:" target="-2" id="HLt-oc-7An"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kNm-y0-HmG">
|
||||
<rect key="frame" x="296" y="52" width="96" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" title="Need to restart" usesSingleLineMode="YES" id="2vl-mc-m3L">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="eqS-1n-9dO">
|
||||
<rect key="frame" x="200" y="15" width="82" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Classic" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="wRC-UO-k1G" id="6UY-90-fFH">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="FiI-39-AD8">
|
||||
<items>
|
||||
<menuItem title="Classic" state="on" id="wRC-UO-k1G">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Mask" id="gH0-wV-Bx0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchRevokedMessageStyleButton:" target="-2" id="n3n-hX-s3H"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ftV-1F-OnB">
|
||||
<rect key="frame" x="287" y="20" width="130" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="left" title="Experimental feature" usesSingleLineMode="YES" id="lHs-du-a6F">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="3p1-WF-TYr"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="top" secondItem="B87-eD-uhI" secondAttribute="bottom" constant="16" id="62W-9V-E2u"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="BjP-RS-ASM"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ftV-1F-OnB" secondAttribute="trailing" constant="12" id="Bug-Cf-VNT"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="CWK-cO-DBz"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="5by-EJ-3f2" secondAttribute="trailing" constant="12" id="KRA-o3-Ab4"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="kNm-y0-HmG" secondAttribute="trailing" constant="12" id="Le8-Ns-wyj"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="centerY" secondItem="7wK-v5-BgQ" secondAttribute="centerY" id="Pbm-17-TcF"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="centerY" secondItem="RFE-oR-GRm" secondAttribute="centerY" id="QLN-KI-HUD"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="60" id="R8y-0p-4Sk"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="TgK-yZ-mK1"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="6x2-KV-p8w" secondAttribute="trailing" constant="12" id="VbQ-1W-cmx"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="WSG-53-r8r"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="Wlh-6X-UJN"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="top" secondItem="zsd-Bb-6l4" secondAttribute="bottom" constant="16" id="Ynk-No-M1P"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="centerY" secondItem="ylY-lF-oFq" secondAttribute="centerY" id="eMk-RJ-Mbw"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="leading" secondItem="eqS-1n-9dO" secondAttribute="trailing" constant="10" id="g0f-zV-Ldd"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="centerY" secondItem="B87-eD-uhI" secondAttribute="centerY" id="gqp-om-e0O"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="centerY" secondItem="zsd-Bb-6l4" secondAttribute="centerY" id="h7g-u6-ZwV"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="icK-YZ-ZLo"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="top" secondItem="RFE-oR-GRm" secondAttribute="bottom" constant="16" id="lG1-vw-epo"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="qb1-VH-ddg"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="leading" secondItem="ylY-lF-oFq" secondAttribute="trailing" constant="10" id="urr-9v-Okd"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="centerY" secondItem="eqS-1n-9dO" secondAttribute="centerY" id="v6d-17-iac"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="leading" secondItem="RFE-oR-GRm" secondAttribute="trailing" constant="8" id="v9V-TW-Voc"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="wQB-cU-fmf"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="wQn-0O-HSa"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="139" y="194"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
||||
13
WeChatTweak/Controller/TweakPreferencesController.h
Normal file
13
WeChatTweak/Controller/TweakPreferencesController.h
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
//
|
||||
// TweakPreferencesController.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/8/12.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WeChatTweakHeaders.h"
|
||||
|
||||
@interface TweakPreferencesController : NSViewController
|
||||
|
||||
@end
|
||||
88
WeChatTweak/Controller/TweakPreferencesController.m
Normal file
88
WeChatTweak/Controller/TweakPreferencesController.m
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
//
|
||||
// TweakPreferencesController.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/8/12.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TweakPreferencesController.h"
|
||||
#import "NSBundle+WeChatTweak.h"
|
||||
#import "WTConfigManager.h"
|
||||
|
||||
@interface TweakPreferencesController () <MASPreferencesViewController>
|
||||
|
||||
@property (weak) IBOutlet NSPopUpButton *autoAuthButton;
|
||||
@property (weak) IBOutlet NSPopUpButton *notificationTypeButton;
|
||||
@property (weak) IBOutlet NSPopUpButton *compressedJSONEnabledButton;
|
||||
@property (weak) IBOutlet NSPopUpButton *revokedMessageStyleButton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation TweakPreferencesController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear {
|
||||
[super viewWillAppear];
|
||||
[self reloadData];
|
||||
}
|
||||
|
||||
- (void)reloadData {
|
||||
WTConfigManager *configManager = WTConfigManager.sharedInstance;
|
||||
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
|
||||
BOOL enabledAutoAuth = [userDefaults boolForKey:WeChatTweakPreferenceAutoAuthKey];
|
||||
RevokeNotificationType notificationType = [userDefaults integerForKey:WeChatTweakPreferenceRevokeNotificationTypeKey];
|
||||
[self.autoAuthButton selectItemAtIndex:enabledAutoAuth ? 1 : 0];
|
||||
[self.notificationTypeButton selectItemAtIndex:notificationType];
|
||||
[self.compressedJSONEnabledButton selectItemAtIndex:configManager.compressedJSONEnabled ? 0 : 1];
|
||||
[self.revokedMessageStyleButton selectItemAtIndex:configManager.revokedMessageStyle];
|
||||
}
|
||||
|
||||
#pragma mark - Event method
|
||||
|
||||
- (IBAction)switchAutoAuthAction:(NSPopUpButton *)sender {
|
||||
BOOL enabled = sender.indexOfSelectedItem == 1;
|
||||
[[NSUserDefaults standardUserDefaults] setBool:enabled forKey:WeChatTweakPreferenceAutoAuthKey];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
- (IBAction)switchNotificationTypeAction:(NSPopUpButton *)sender {
|
||||
RevokeNotificationType type = sender.indexOfSelectedItem;
|
||||
[[NSUserDefaults standardUserDefaults] setInteger:type forKey:WeChatTweakPreferenceRevokeNotificationTypeKey];
|
||||
}
|
||||
|
||||
- (IBAction)switchCompressedJSONEnabledAction:(NSPopUpButton *)sender {
|
||||
BOOL enabled = sender.indexOfSelectedItem == 0;
|
||||
WTConfigManager.sharedInstance.compressedJSONEnabled = enabled;
|
||||
}
|
||||
|
||||
- (IBAction)switchRevokedMessageStyleButton:(NSPopUpButton *)sender {
|
||||
WTConfigManager.sharedInstance.revokedMessageStyle = sender.indexOfSelectedItem;
|
||||
}
|
||||
|
||||
#pragma mark - MASPreferencesViewController
|
||||
|
||||
- (NSString *)identifier {
|
||||
return @"tweak";
|
||||
}
|
||||
|
||||
- (NSString *)toolbarItemLabel {
|
||||
return @"Tweak";
|
||||
}
|
||||
|
||||
- (NSImage *)toolbarItemImage {
|
||||
return [[NSBundle tweakBundle] imageForResource:@"Prefs-Tweak"];
|
||||
}
|
||||
|
||||
- (BOOL)hasResizableWidth {
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)hasResizableHeight {
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
||||
188
WeChatTweak/Controller/en.lproj/TweakPreferencesController.xib
Normal file
188
WeChatTweak/Controller/en.lproj/TweakPreferencesController.xib
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15702" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15702"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="TweakPreferencesController">
|
||||
<connections>
|
||||
<outlet property="autoAuthButton" destination="5by-EJ-3f2" id="VIV-sZ-ybx"/>
|
||||
<outlet property="compressedJSONEnabledButton" destination="ylY-lF-oFq" id="yqW-Bl-hNf"/>
|
||||
<outlet property="notificationTypeButton" destination="6x2-KV-p8w" id="Kfn-2a-Yup"/>
|
||||
<outlet property="revokedMessageStyleButton" destination="eqS-1n-9dO" id="QVg-Sy-CoY"/>
|
||||
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="431" height="152"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RFE-oR-GRm">
|
||||
<rect key="frame" x="58" y="116" width="138" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Auto login:" usesSingleLineMode="YES" id="UiV-zj-l6I">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="B87-eD-uhI">
|
||||
<rect key="frame" x="10" y="84" width="186" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Message recalled notification:" usesSingleLineMode="YES" id="UKv-CM-nGt">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5by-EJ-3f2">
|
||||
<rect key="frame" x="200" y="111" width="91" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Disabled" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="Vcv-eD-OM9" id="8qB-Jj-tlv">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="sFO-8T-61S">
|
||||
<items>
|
||||
<menuItem title="Disabled" state="on" id="Vcv-eD-OM9">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Enabled" id="KQg-jN-y9a">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchAutoAuthAction:" target="-2" id="P6Q-aT-ADE"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6x2-KV-p8w">
|
||||
<rect key="frame" x="200" y="79" width="92" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Inherited" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="gec-CY-E1x" id="wek-GT-N5V">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="H2J-gJ-aGD">
|
||||
<items>
|
||||
<menuItem title="Inherited" state="on" id="gec-CY-E1x">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="All" id="da4-aJ-lEy">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Disabled" id="Uk9-Oc-Jtv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchNotificationTypeAction:" target="-2" id="xjO-Ck-wem"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zsd-Bb-6l4">
|
||||
<rect key="frame" x="32" y="52" width="164" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Alfred JSON compressing:" usesSingleLineMode="YES" id="jHw-2a-B2t">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7wK-v5-BgQ">
|
||||
<rect key="frame" x="46" y="20" width="150" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Revoked message style:" usesSingleLineMode="YES" id="mPT-nA-idf">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ylY-lF-oFq">
|
||||
<rect key="frame" x="200" y="47" width="91" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Disabled" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="MEN-Kg-wfj" id="taL-8q-Quu">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="2qr-A3-Yo5">
|
||||
<items>
|
||||
<menuItem title="Enabled" id="10G-t9-s4T">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Disabled" state="on" id="MEN-Kg-wfj">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchCompressedJSONEnabledAction:" target="-2" id="HLt-oc-7An"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kNm-y0-HmG">
|
||||
<rect key="frame" x="296" y="52" width="96" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" title="Need to restart" usesSingleLineMode="YES" id="2vl-mc-m3L">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="eqS-1n-9dO">
|
||||
<rect key="frame" x="200" y="15" width="82" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Classic" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="wRC-UO-k1G" id="6UY-90-fFH">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="FiI-39-AD8">
|
||||
<items>
|
||||
<menuItem title="Classic" state="on" id="wRC-UO-k1G">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="Mask" id="gH0-wV-Bx0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchRevokedMessageStyleButton:" target="-2" id="n3n-hX-s3H"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ftV-1F-OnB">
|
||||
<rect key="frame" x="287" y="20" width="130" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="left" title="Experimental feature" usesSingleLineMode="YES" id="lHs-du-a6F">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="3p1-WF-TYr"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="top" secondItem="B87-eD-uhI" secondAttribute="bottom" constant="16" id="62W-9V-E2u"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="BjP-RS-ASM"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ftV-1F-OnB" secondAttribute="trailing" constant="12" id="Bug-Cf-VNT"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="CWK-cO-DBz"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="5by-EJ-3f2" secondAttribute="trailing" constant="12" id="KRA-o3-Ab4"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="kNm-y0-HmG" secondAttribute="trailing" constant="12" id="Le8-Ns-wyj"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="centerY" secondItem="7wK-v5-BgQ" secondAttribute="centerY" id="Pbm-17-TcF"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="centerY" secondItem="RFE-oR-GRm" secondAttribute="centerY" id="QLN-KI-HUD"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="60" id="R8y-0p-4Sk"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="TgK-yZ-mK1"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="6x2-KV-p8w" secondAttribute="trailing" constant="12" id="VbQ-1W-cmx"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="WSG-53-r8r"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="Wlh-6X-UJN"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="top" secondItem="zsd-Bb-6l4" secondAttribute="bottom" constant="16" id="Ynk-No-M1P"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="centerY" secondItem="ylY-lF-oFq" secondAttribute="centerY" id="eMk-RJ-Mbw"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="leading" secondItem="eqS-1n-9dO" secondAttribute="trailing" constant="10" id="g0f-zV-Ldd"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="centerY" secondItem="B87-eD-uhI" secondAttribute="centerY" id="gqp-om-e0O"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="centerY" secondItem="zsd-Bb-6l4" secondAttribute="centerY" id="h7g-u6-ZwV"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="icK-YZ-ZLo"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="top" secondItem="RFE-oR-GRm" secondAttribute="bottom" constant="16" id="lG1-vw-epo"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="qb1-VH-ddg"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="leading" secondItem="ylY-lF-oFq" secondAttribute="trailing" constant="10" id="urr-9v-Okd"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="centerY" secondItem="eqS-1n-9dO" secondAttribute="centerY" id="v6d-17-iac"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="leading" secondItem="RFE-oR-GRm" secondAttribute="trailing" constant="8" id="v9V-TW-Voc"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="wQB-cU-fmf"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="wQn-0O-HSa"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="139" y="194"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
||||
|
|
@ -0,0 +1,188 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15702" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15702"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="TweakPreferencesController">
|
||||
<connections>
|
||||
<outlet property="autoAuthButton" destination="5by-EJ-3f2" id="VIV-sZ-ybx"/>
|
||||
<outlet property="compressedJSONEnabledButton" destination="ylY-lF-oFq" id="yqW-Bl-hNf"/>
|
||||
<outlet property="notificationTypeButton" destination="6x2-KV-p8w" id="Kfn-2a-Yup"/>
|
||||
<outlet property="revokedMessageStyleButton" destination="eqS-1n-9dO" id="QVg-Sy-CoY"/>
|
||||
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="431" height="152"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RFE-oR-GRm">
|
||||
<rect key="frame" x="58" y="116" width="81" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="免认证登录:" usesSingleLineMode="YES" id="UiV-zj-l6I">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="B87-eD-uhI">
|
||||
<rect key="frame" x="45" y="84" width="94" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="消息撤回通知:" usesSingleLineMode="YES" id="UKv-CM-nGt">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5by-EJ-3f2">
|
||||
<rect key="frame" x="143" y="111" width="65" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="关闭" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="Vcv-eD-OM9" id="8qB-Jj-tlv">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="sFO-8T-61S">
|
||||
<items>
|
||||
<menuItem title="关闭" state="on" id="Vcv-eD-OM9">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="开启" id="KQg-jN-y9a">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchAutoAuthAction:" target="-2" id="P6Q-aT-ADE"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6x2-KV-p8w">
|
||||
<rect key="frame" x="143" y="79" width="118" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="跟随聊天设置" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="gec-CY-E1x" id="wek-GT-N5V">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="H2J-gJ-aGD">
|
||||
<items>
|
||||
<menuItem title="跟随聊天设置" state="on" id="gec-CY-E1x">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="全部接收" id="da4-aJ-lEy">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="关闭" id="Uk9-Oc-Jtv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchNotificationTypeAction:" target="-2" id="xjO-Ck-wem"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zsd-Bb-6l4">
|
||||
<rect key="frame" x="20" y="52" width="119" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Alfred JSON 压缩:" usesSingleLineMode="YES" id="jHw-2a-B2t">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7wK-v5-BgQ">
|
||||
<rect key="frame" x="45" y="20" width="94" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="消息撤回样式:" usesSingleLineMode="YES" id="mPT-nA-idf">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ylY-lF-oFq">
|
||||
<rect key="frame" x="143" y="47" width="65" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="关闭" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="MEN-Kg-wfj" id="taL-8q-Quu">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="2qr-A3-Yo5">
|
||||
<items>
|
||||
<menuItem title="开启" id="10G-t9-s4T">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="关闭" state="on" id="MEN-Kg-wfj">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchCompressedJSONEnabledAction:" target="-2" id="HLt-oc-7An"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kNm-y0-HmG">
|
||||
<rect key="frame" x="213" y="52" width="84" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" title="需重启客户端" usesSingleLineMode="YES" id="2vl-mc-m3L">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="eqS-1n-9dO">
|
||||
<rect key="frame" x="143" y="15" width="65" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="经典" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="wRC-UO-k1G" id="6UY-90-fFH">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="FiI-39-AD8">
|
||||
<items>
|
||||
<menuItem title="经典" state="on" id="wRC-UO-k1G">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="遮罩" id="gH0-wV-Bx0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchRevokedMessageStyleButton:" target="-2" id="n3n-hX-s3H"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ftV-1F-OnB">
|
||||
<rect key="frame" x="213" y="20" width="71" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="left" title="试验性功能" usesSingleLineMode="YES" id="lHs-du-a6F">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="3p1-WF-TYr"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="top" secondItem="B87-eD-uhI" secondAttribute="bottom" constant="16" id="62W-9V-E2u"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="BjP-RS-ASM"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ftV-1F-OnB" secondAttribute="trailing" constant="12" id="Bug-Cf-VNT"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="CWK-cO-DBz"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="5by-EJ-3f2" secondAttribute="trailing" constant="12" id="KRA-o3-Ab4"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="kNm-y0-HmG" secondAttribute="trailing" constant="12" id="Le8-Ns-wyj"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="centerY" secondItem="7wK-v5-BgQ" secondAttribute="centerY" id="Pbm-17-TcF"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="centerY" secondItem="RFE-oR-GRm" secondAttribute="centerY" id="QLN-KI-HUD"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="60" id="R8y-0p-4Sk"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="TgK-yZ-mK1"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="6x2-KV-p8w" secondAttribute="trailing" constant="12" id="VbQ-1W-cmx"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="WSG-53-r8r"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="Wlh-6X-UJN"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="top" secondItem="zsd-Bb-6l4" secondAttribute="bottom" constant="16" id="Ynk-No-M1P"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="centerY" secondItem="ylY-lF-oFq" secondAttribute="centerY" id="eMk-RJ-Mbw"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="leading" secondItem="eqS-1n-9dO" secondAttribute="trailing" constant="10" id="g0f-zV-Ldd"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="centerY" secondItem="B87-eD-uhI" secondAttribute="centerY" id="gqp-om-e0O"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="centerY" secondItem="zsd-Bb-6l4" secondAttribute="centerY" id="h7g-u6-ZwV"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="icK-YZ-ZLo"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="top" secondItem="RFE-oR-GRm" secondAttribute="bottom" constant="16" id="lG1-vw-epo"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="qb1-VH-ddg"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="leading" secondItem="ylY-lF-oFq" secondAttribute="trailing" constant="10" id="urr-9v-Okd"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="centerY" secondItem="eqS-1n-9dO" secondAttribute="centerY" id="v6d-17-iac"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="leading" secondItem="RFE-oR-GRm" secondAttribute="trailing" constant="8" id="v9V-TW-Voc"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="wQB-cU-fmf"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="wQn-0O-HSa"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="138.5" y="194"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
||||
|
|
@ -0,0 +1,188 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15702" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15702"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="TweakPreferencesController">
|
||||
<connections>
|
||||
<outlet property="autoAuthButton" destination="5by-EJ-3f2" id="VIV-sZ-ybx"/>
|
||||
<outlet property="compressedJSONEnabledButton" destination="ylY-lF-oFq" id="yqW-Bl-hNf"/>
|
||||
<outlet property="notificationTypeButton" destination="6x2-KV-p8w" id="Kfn-2a-Yup"/>
|
||||
<outlet property="revokedMessageStyleButton" destination="eqS-1n-9dO" id="QVg-Sy-CoY"/>
|
||||
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="431" height="152"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RFE-oR-GRm">
|
||||
<rect key="frame" x="58" y="116" width="81" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="免認證登錄:" usesSingleLineMode="YES" id="UiV-zj-l6I">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="B87-eD-uhI">
|
||||
<rect key="frame" x="45" y="84" width="94" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="消息撤回通知:" usesSingleLineMode="YES" id="UKv-CM-nGt">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5by-EJ-3f2">
|
||||
<rect key="frame" x="143" y="111" width="65" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="關閉" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="Vcv-eD-OM9" id="8qB-Jj-tlv">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="sFO-8T-61S">
|
||||
<items>
|
||||
<menuItem title="關閉" state="on" id="Vcv-eD-OM9">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="開啟" id="KQg-jN-y9a">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchAutoAuthAction:" target="-2" id="P6Q-aT-ADE"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6x2-KV-p8w">
|
||||
<rect key="frame" x="143" y="79" width="118" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="跟隨聊天設置" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="gec-CY-E1x" id="wek-GT-N5V">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="H2J-gJ-aGD">
|
||||
<items>
|
||||
<menuItem title="跟隨聊天設置" state="on" id="gec-CY-E1x">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="全部接收" id="da4-aJ-lEy">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="關閉" id="Uk9-Oc-Jtv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchNotificationTypeAction:" target="-2" id="xjO-Ck-wem"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zsd-Bb-6l4">
|
||||
<rect key="frame" x="20" y="52" width="119" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="Alfred JSON 壓縮:" usesSingleLineMode="YES" id="jHw-2a-B2t">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7wK-v5-BgQ">
|
||||
<rect key="frame" x="45" y="20" width="94" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="right" title="消息撤回樣式:" usesSingleLineMode="YES" id="mPT-nA-idf">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ylY-lF-oFq">
|
||||
<rect key="frame" x="143" y="47" width="65" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="關閉" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="MEN-Kg-wfj" id="taL-8q-Quu">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="2qr-A3-Yo5">
|
||||
<items>
|
||||
<menuItem title="開啟" id="10G-t9-s4T">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="關閉" state="on" id="MEN-Kg-wfj">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchCompressedJSONEnabledAction:" target="-2" id="HLt-oc-7An"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kNm-y0-HmG">
|
||||
<rect key="frame" x="213" y="52" width="84" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" title="需重啟客戶端" usesSingleLineMode="YES" id="2vl-mc-m3L">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="eqS-1n-9dO">
|
||||
<rect key="frame" x="143" y="15" width="65" height="25"/>
|
||||
<popUpButtonCell key="cell" type="push" title="經典" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="axesIndependently" inset="2" selectedItem="wRC-UO-k1G" id="6UY-90-fFH">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
<menu key="menu" id="FiI-39-AD8">
|
||||
<items>
|
||||
<menuItem title="經典" state="on" id="wRC-UO-k1G">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="遮罩" id="gH0-wV-Bx0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<action selector="switchRevokedMessageStyleButton:" target="-2" id="n3n-hX-s3H"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ftV-1F-OnB">
|
||||
<rect key="frame" x="213" y="20" width="71" height="16"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" alignment="left" title="試驗性功能" usesSingleLineMode="YES" id="lHs-du-a6F">
|
||||
<font key="font" size="13" name=".PingFangSC-Regular"/>
|
||||
<color key="textColor" name="systemRedColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="3p1-WF-TYr"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="top" secondItem="B87-eD-uhI" secondAttribute="bottom" constant="16" id="62W-9V-E2u"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="BjP-RS-ASM"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ftV-1F-OnB" secondAttribute="trailing" constant="12" id="Bug-Cf-VNT"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="CWK-cO-DBz"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="5by-EJ-3f2" secondAttribute="trailing" constant="12" id="KRA-o3-Ab4"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="kNm-y0-HmG" secondAttribute="trailing" constant="12" id="Le8-Ns-wyj"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="centerY" secondItem="7wK-v5-BgQ" secondAttribute="centerY" id="Pbm-17-TcF"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="centerY" secondItem="RFE-oR-GRm" secondAttribute="centerY" id="QLN-KI-HUD"/>
|
||||
<constraint firstItem="RFE-oR-GRm" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="60" id="R8y-0p-4Sk"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="TgK-yZ-mK1"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="6x2-KV-p8w" secondAttribute="trailing" constant="12" id="VbQ-1W-cmx"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="WSG-53-r8r"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="Wlh-6X-UJN"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="top" secondItem="zsd-Bb-6l4" secondAttribute="bottom" constant="16" id="Ynk-No-M1P"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="centerY" secondItem="ylY-lF-oFq" secondAttribute="centerY" id="eMk-RJ-Mbw"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="leading" secondItem="eqS-1n-9dO" secondAttribute="trailing" constant="10" id="g0f-zV-Ldd"/>
|
||||
<constraint firstItem="6x2-KV-p8w" firstAttribute="centerY" secondItem="B87-eD-uhI" secondAttribute="centerY" id="gqp-om-e0O"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="centerY" secondItem="zsd-Bb-6l4" secondAttribute="centerY" id="h7g-u6-ZwV"/>
|
||||
<constraint firstItem="zsd-Bb-6l4" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="12" id="icK-YZ-ZLo"/>
|
||||
<constraint firstItem="B87-eD-uhI" firstAttribute="top" secondItem="RFE-oR-GRm" secondAttribute="bottom" constant="16" id="lG1-vw-epo"/>
|
||||
<constraint firstItem="eqS-1n-9dO" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="qb1-VH-ddg"/>
|
||||
<constraint firstItem="kNm-y0-HmG" firstAttribute="leading" secondItem="ylY-lF-oFq" secondAttribute="trailing" constant="10" id="urr-9v-Okd"/>
|
||||
<constraint firstItem="ftV-1F-OnB" firstAttribute="centerY" secondItem="eqS-1n-9dO" secondAttribute="centerY" id="v6d-17-iac"/>
|
||||
<constraint firstItem="5by-EJ-3f2" firstAttribute="leading" secondItem="RFE-oR-GRm" secondAttribute="trailing" constant="8" id="v9V-TW-Voc"/>
|
||||
<constraint firstItem="ylY-lF-oFq" firstAttribute="leading" secondItem="5by-EJ-3f2" secondAttribute="leading" id="wQB-cU-fmf"/>
|
||||
<constraint firstItem="7wK-v5-BgQ" firstAttribute="trailing" secondItem="RFE-oR-GRm" secondAttribute="trailing" id="wQn-0O-HSa"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="139" y="194"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
||||
23
WeChatTweak/Manager/AlfredManager.h
Normal file
23
WeChatTweak/Manager/AlfredManager.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
//
|
||||
// AlfredManager.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/9/10.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <YYModel/YYModel.h>
|
||||
#import <GCDWebServer/GCDWebServer.h>
|
||||
#import <GCDWebServer/GCDWebServerDataResponse.h>
|
||||
|
||||
@interface AlfredManager : NSObject
|
||||
|
||||
+ (instancetype)sharedInstance;
|
||||
|
||||
- (void)startListener;
|
||||
- (void)stopListener;
|
||||
|
||||
@end
|
||||
120
WeChatTweak/Manager/AlfredManager.m
Normal file
120
WeChatTweak/Manager/AlfredManager.m
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
//
|
||||
// AlfredManager.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/9/10.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "AlfredManager.h"
|
||||
#import "WeChatTweakHeaders.h"
|
||||
|
||||
@interface AlfredManager()
|
||||
|
||||
@property (nonatomic, strong, nullable) GCDWebServer *server;
|
||||
|
||||
@end
|
||||
|
||||
@implementation AlfredManager
|
||||
|
||||
static int port = 48065;
|
||||
|
||||
+ (instancetype)sharedInstance {
|
||||
static dispatch_once_t onceToken;
|
||||
static AlfredManager *shared;
|
||||
dispatch_once(&onceToken, ^{
|
||||
shared = [[AlfredManager alloc] init];
|
||||
});
|
||||
return shared;
|
||||
}
|
||||
|
||||
- (void)startListener {
|
||||
if (self.server != nil) {
|
||||
return;
|
||||
}
|
||||
self.server = [[GCDWebServer alloc] init];
|
||||
// Search contancts
|
||||
[self.server addHandlerForMethod:@"GET" path:@"/wechat/search" requestClass:[GCDWebServerRequest class] processBlock:^GCDWebServerResponse * _Nullable(__kindof GCDWebServerRequest * _Nonnull request) {
|
||||
NSString *keyword = [request.query[@"keyword"] lowercaseString] ? : @"";
|
||||
|
||||
NSString *hostname = request.headers[@"Host"];
|
||||
NSString *url1 = [NSString stringWithFormat:@"127.0.0.1:%d", port];
|
||||
NSString *url2 = [NSString stringWithFormat:@"localhost:%d", port];
|
||||
if(!([hostname isEqualToString:url1] | [hostname isEqualToString:url2])){
|
||||
return [GCDWebServerResponse responseWithStatusCode:404];
|
||||
}
|
||||
|
||||
NSArray<WCContactData *> *contacts = ({
|
||||
MMServiceCenter *serviceCenter = [objc_getClass("MMServiceCenter") defaultCenter];
|
||||
ContactStorage *contactStorage = [serviceCenter getService:objc_getClass("ContactStorage")];
|
||||
GroupStorage *groupStorage = [serviceCenter getService:objc_getClass("GroupStorage")];
|
||||
NSMutableArray<WCContactData *> *array = [NSMutableArray array];
|
||||
[array addObjectsFromArray:[contactStorage GetAllFriendContacts]];
|
||||
[array addObjectsFromArray:[groupStorage GetGroupContactList:2 ContactType:0]];
|
||||
array;
|
||||
});
|
||||
NSArray<WCContactData *> *results = ({
|
||||
NSMutableArray<WCContactData *> *results = [NSMutableArray array];
|
||||
for (WCContactData *contact in contacts) {
|
||||
BOOL isOfficialAccount = (contact.m_uiCertificationFlag >> 0x3 & 0x1) == 1;
|
||||
BOOL containsNickName = [contact.m_nsNickName.lowercaseString containsString:keyword];
|
||||
BOOL containsUsername = [contact.m_nsUsrName.lowercaseString containsString:keyword];
|
||||
BOOL containsAliasName = [contact.m_nsAliasName.lowercaseString containsString:keyword];
|
||||
BOOL containsRemark = [contact.m_nsRemark.lowercaseString containsString:keyword];
|
||||
BOOL containsNickNamePinyin = [contact.m_nsFullPY.lowercaseString containsString:keyword];
|
||||
BOOL containsRemarkPinyin = [contact.m_nsRemarkPYFull.lowercaseString containsString:keyword];
|
||||
BOOL matchRemarkShortPinyin = [contact.m_nsRemarkPYShort.lowercaseString isEqualToString:keyword];
|
||||
if (!isOfficialAccount && (containsNickName || containsUsername || containsAliasName || containsRemark || containsNickNamePinyin || containsRemarkPinyin || matchRemarkShortPinyin)) {
|
||||
[results addObject:contact];
|
||||
}
|
||||
}
|
||||
results;
|
||||
});
|
||||
return [GCDWebServerDataResponse responseWithJSONObject:[results yy_modelToJSONObject]];
|
||||
}];
|
||||
// Start chat
|
||||
[self.server addHandlerForMethod:@"GET" path:@"/wechat/start" requestClass:[GCDWebServerRequest class] processBlock:^GCDWebServerResponse * _Nullable(__kindof GCDWebServerRequest * _Nonnull request) {
|
||||
|
||||
NSString *hostname = request.headers[@"Host"];
|
||||
NSString *url1 = [NSString stringWithFormat:@"127.0.0.1:%d", port];
|
||||
NSString *url2 = [NSString stringWithFormat:@"localhost:%d", port];
|
||||
if(!([hostname isEqualToString:url1] | [hostname isEqualToString:url2])){
|
||||
return [GCDWebServerResponse responseWithStatusCode:404];
|
||||
}
|
||||
|
||||
WCContactData *contact = ({
|
||||
NSString *session = request.query[@"session"];
|
||||
WCContactData *contact = nil;
|
||||
if (session != nil) {
|
||||
MMServiceCenter *serviceCenter = [objc_getClass("MMServiceCenter") defaultCenter];
|
||||
if ([session rangeOfString:@"@chatroom"].location == NSNotFound) {
|
||||
ContactStorage *contactStorage = [serviceCenter getService:objc_getClass("ContactStorage")];
|
||||
contact = [contactStorage GetContact:session];
|
||||
} else {
|
||||
GroupStorage *groupStorage = [serviceCenter getService:objc_getClass("GroupStorage")];
|
||||
contact = [groupStorage GetGroupContact:session];
|
||||
}
|
||||
}
|
||||
contact;
|
||||
});
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[[objc_getClass("WeChat") sharedInstance] startANewChatWithContact:contact];
|
||||
[[objc_getClass("WeChat") sharedInstance] showMainWindow];
|
||||
[[NSApplication sharedApplication] activateIgnoringOtherApps: YES];
|
||||
});
|
||||
return [GCDWebServerResponse responseWithStatusCode:200];
|
||||
}];
|
||||
[self.server startWithOptions:@{GCDWebServerOption_Port: [NSNumber numberWithInt:port],
|
||||
GCDWebServerOption_BindToLocalhost: @(YES)} error:nil];
|
||||
}
|
||||
|
||||
- (void)stopListener {
|
||||
if (self.server == nil) {
|
||||
return;
|
||||
}
|
||||
[self.server stop];
|
||||
[self.server removeAllHandlers];
|
||||
self.server = nil;
|
||||
}
|
||||
|
||||
@end
|
||||
25
WeChatTweak/Manager/WTConfigManager.h
Normal file
25
WeChatTweak/Manager/WTConfigManager.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// WTConfigManager.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 21/03/2018.
|
||||
// Copyright © 2018 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
|
||||
typedef NS_ENUM(NSUInteger, WTRevokedMessageStyle) {
|
||||
WTRevokedMessageStyleClassic = 0,
|
||||
WTRevokedMessageStyleMask
|
||||
};
|
||||
|
||||
@interface WTConfigManager : NSObject
|
||||
|
||||
@property (nonatomic, assign) BOOL compressedJSONEnabled;
|
||||
@property (nonatomic, assign) WTRevokedMessageStyle revokedMessageStyle;
|
||||
|
||||
+ (instancetype)sharedInstance;
|
||||
|
||||
@end
|
||||
57
WeChatTweak/Manager/WTConfigManager.m
Normal file
57
WeChatTweak/Manager/WTConfigManager.m
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
//
|
||||
// WTConfigManager.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 21/03/2018.
|
||||
// Copyright © 2018 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WTConfigManager.h"
|
||||
|
||||
static NSString * const WeChatTweakCompressedJSONEnabledKey = @"WeChatTweakCompressedJSONEnabledKey";
|
||||
static NSString * const WeChatTweakRevokedMessageStyleKey = @"WeChatTweakRevokedMessageStyleKey";
|
||||
|
||||
@interface WTConfigManager()
|
||||
|
||||
@end
|
||||
|
||||
@implementation WTConfigManager
|
||||
|
||||
+ (instancetype)sharedInstance {
|
||||
static dispatch_once_t onceToken;
|
||||
static WTConfigManager *shared;
|
||||
dispatch_once(&onceToken, ^{
|
||||
shared = [[WTConfigManager alloc] init];
|
||||
});
|
||||
return shared;
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
NSUserDefaults *userDefaults = NSUserDefaults.standardUserDefaults;
|
||||
if ([userDefaults objectForKey:WeChatTweakCompressedJSONEnabledKey]) {
|
||||
_compressedJSONEnabled = [userDefaults boolForKey:WeChatTweakCompressedJSONEnabledKey];
|
||||
} else {
|
||||
_compressedJSONEnabled = YES;
|
||||
}
|
||||
_revokedMessageStyle = [userDefaults integerForKey:WeChatTweakRevokedMessageStyleKey];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Property method
|
||||
|
||||
- (void)setCompressedJSONEnabled:(BOOL)compressedJSONEnabled {
|
||||
_compressedJSONEnabled = compressedJSONEnabled;
|
||||
[NSUserDefaults.standardUserDefaults setBool:compressedJSONEnabled forKey:WeChatTweakCompressedJSONEnabledKey];
|
||||
[NSUserDefaults.standardUserDefaults synchronize];
|
||||
}
|
||||
|
||||
- (void)setRevokedMessageStyle:(WTRevokedMessageStyle)revokedMessageStyle {
|
||||
_revokedMessageStyle = revokedMessageStyle;
|
||||
[NSUserDefaults.standardUserDefaults setInteger:revokedMessageStyle forKey:WeChatTweakRevokedMessageStyleKey];
|
||||
[NSUserDefaults.standardUserDefaults synchronize];
|
||||
}
|
||||
|
||||
@end
|
||||
BIN
WeChatTweak/Resources/Prefs-Tweak.tiff
Normal file
BIN
WeChatTweak/Resources/Prefs-Tweak.tiff
Normal file
Binary file not shown.
24
WeChatTweak/Supporting Files/Info.plist
Normal file
24
WeChatTweak/Supporting Files/Info.plist
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2017年 Sunnyyoung. All rights reserved.</string>
|
||||
</dict>
|
||||
</plist>
|
||||
210
WeChatTweak/Supporting Files/WeChatTweakHeaders.h
Normal file
210
WeChatTweak/Supporting Files/WeChatTweakHeaders.h
Normal file
|
|
@ -0,0 +1,210 @@
|
|||
//
|
||||
// WeChatTweakHeaders.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/8/11.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
|
||||
typedef NS_ENUM(NSUInteger, RevokeNotificationType) {
|
||||
RevokeNotificationTypeFollow = 0,
|
||||
RevokeNotificationTypeReceiveAll,
|
||||
RevokeNotificationTypeDisable,
|
||||
};
|
||||
|
||||
typedef NS_ENUM(unsigned int, MessageDataType) {
|
||||
MessageDataTypeText = 1,
|
||||
MessageDataTypeImage = 3,
|
||||
MessageDataTypeVoice = 34,
|
||||
MessageDataTypeVideo = 43,
|
||||
MessageDataTypeSticker = 47,
|
||||
MessageDataTypeAppUrl = 49,
|
||||
MessageDataTypePrompt = 10000
|
||||
};
|
||||
|
||||
static NSString * const WeChatTweakPreferenceAutoAuthKey = @"WeChatTweakPreferenceAutoAuthKey";
|
||||
static NSString * const WeChatTweakPreferenceRevokeNotificationTypeKey = @"WeChatTweakPreferenceRevokeNotificationTypeKey";
|
||||
|
||||
@interface NSString (MD5)
|
||||
|
||||
- (NSString *)md5String;
|
||||
|
||||
@end
|
||||
|
||||
@interface WeChat : NSObject
|
||||
|
||||
+ (instancetype)sharedInstance;
|
||||
- (void)lock:(id)block;
|
||||
- (void)showMainWindow;
|
||||
- (void)startANewChatWithContact:(id)contact;
|
||||
|
||||
@end
|
||||
|
||||
@interface PathUtility : NSObject
|
||||
|
||||
+ (NSString *)GetCurUserDocumentPath;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMSearchResultItem : NSObject
|
||||
|
||||
@property(nonatomic) unsigned long long type; // 0 is single chat, 1 is group chat
|
||||
@property(readonly, nonatomic) NSString *identifier;
|
||||
|
||||
@end
|
||||
|
||||
@interface MessageData: NSObject
|
||||
|
||||
@property(nonatomic) MessageDataType messageType;
|
||||
@property(nonatomic) unsigned int msgStatus;
|
||||
@property(nonatomic) long long mesSvrID;
|
||||
@property(retain, nonatomic) NSString *toUsrName;
|
||||
@property(retain, nonatomic) NSString *fromUsrName;
|
||||
@property(retain, nonatomic) NSString *msgContent;
|
||||
@property(nonatomic) unsigned int msgCreateTime;
|
||||
@property(nonatomic) unsigned int mesLocalID;
|
||||
|
||||
- (instancetype)initWithMsgType:(long long)arg1;
|
||||
- (BOOL)isSendFromSelf;
|
||||
- (id)getChatNameForCurMsg;
|
||||
- (id)savingImageFileNameWithLocalID;
|
||||
|
||||
@end
|
||||
|
||||
@interface WCContactData : NSObject
|
||||
|
||||
@property(nonatomic) unsigned int m_uiCertificationFlag;
|
||||
@property(retain, nonatomic) NSString *m_nsHeadImgUrl;
|
||||
@property(retain, nonatomic) NSString *m_nsNickName;
|
||||
@property(retain, nonatomic) NSString *m_nsUsrName;
|
||||
@property(retain, nonatomic) NSString *m_nsAliasName;
|
||||
@property(retain, nonatomic) NSString *m_nsRemark;
|
||||
@property(retain, nonatomic) NSString *m_nsFullPY;
|
||||
@property(retain, nonatomic) NSString *m_nsRemarkPYShort;
|
||||
@property(retain, nonatomic) NSString *m_nsRemarkPYFull;
|
||||
@property(retain, nonatomic) NSString *wt_avatarPath;
|
||||
|
||||
- (BOOL)isChatStatusNotifyOpen;
|
||||
|
||||
@end
|
||||
|
||||
@interface ContactStorage : NSObject
|
||||
|
||||
- (WCContactData *)GetContact:(NSString *)session;
|
||||
- (NSArray<WCContactData *> *)GetAllFriendContacts;
|
||||
|
||||
@end
|
||||
|
||||
@interface GroupStorage: NSObject
|
||||
|
||||
- (WCContactData *)GetGroupContact:(NSString *)session;
|
||||
- (NSArray<WCContactData *> *)GetAllGroups;
|
||||
- (NSArray<WCContactData *> *)GetGroupContactList:(NSInteger)arg1 ContactType:(NSInteger)arg2;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMServiceCenter : NSObject
|
||||
|
||||
+ (id)defaultCenter;
|
||||
- (id)getService:(Class)name;
|
||||
|
||||
@end
|
||||
|
||||
@interface AccountService: NSObject
|
||||
|
||||
- (BOOL)canAutoAuth;
|
||||
- (void)AutoAuth;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMAvatarService: NSObject
|
||||
|
||||
- (NSString *)avatarCachePath;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMSessionMgr: NSObject
|
||||
|
||||
- (void)loadSessionData;
|
||||
- (void)loadBrandSessionData;
|
||||
|
||||
@end
|
||||
|
||||
@interface RevokeMsgItem : NSObject
|
||||
|
||||
@property (nonatomic, assign) unsigned int createTime;
|
||||
@property (nonatomic, retain) NSString *svrId;
|
||||
@property (nonatomic, retain) NSString *content;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMRevokeMsgDB : NSObject
|
||||
|
||||
- (BOOL)insertRevokeMsg:(id)msg;
|
||||
- (id)getRevokeMsg:(NSString *)svrId;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMRevokeMsgService : NSObject
|
||||
|
||||
@property (nonatomic, strong) MMRevokeMsgDB *db;
|
||||
|
||||
@end
|
||||
|
||||
@protocol MASPreferencesViewController <NSObject>
|
||||
|
||||
@property(readonly, nonatomic) NSString *toolbarItemLabel;
|
||||
@property(readonly, nonatomic) NSImage *toolbarItemImage;
|
||||
@property(readonly, nonatomic) NSString *identifier;
|
||||
|
||||
@optional
|
||||
@property(readonly, nonatomic) BOOL hasResizableHeight;
|
||||
@property(readonly, nonatomic) BOOL hasResizableWidth;
|
||||
|
||||
@end
|
||||
|
||||
@interface MASPreferencesWindowController: NSWindowController
|
||||
|
||||
- (id)initWithViewControllers:(NSArray *)arg1;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMMessageTableItem : NSObject
|
||||
|
||||
@property(retain, nonatomic) MessageData *message;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMMessageCellView : NSTableCellView
|
||||
|
||||
@property(retain, nonatomic) NSView *avatarImgView;
|
||||
@property(retain, nonatomic) MMMessageTableItem *messageTableItem;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMImageMessageCellView : MMMessageCellView
|
||||
|
||||
@property(retain, nonatomic) NSImage *displayedImage;
|
||||
|
||||
@end
|
||||
|
||||
@interface MMService : NSObject
|
||||
|
||||
@end
|
||||
|
||||
@interface EmoticonMgr : MMService
|
||||
|
||||
- (id)getEmotionDataWithMD5:(id)arg1;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSDictionary (XMLDictionary)
|
||||
|
||||
+ (id)dictionaryWithXMLString:(id)arg1;
|
||||
|
||||
@end
|
||||
23
WeChatTweak/Supporting Files/en.lproj/Localizable.strings
Normal file
23
WeChatTweak/Supporting Files/en.lproj/Localizable.strings
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
Localizable.strings
|
||||
WeChatTweak
|
||||
|
||||
Created by Sunny Young on 2018/6/30.
|
||||
Copyright © 2018 Sunnyyoung. All rights reserved.
|
||||
*/
|
||||
|
||||
"Tweak.Title.LoginAnotherAccount" = "Login new account";
|
||||
"Tweak.Title.Group" = "Group";
|
||||
"Tweak.Message.InterceptedARecalledMessage" = "[Intercepted a recalled message]\n%@";
|
||||
"Tweak.Message.Recalled" = "recalled";
|
||||
"Tweak.Message.Image" = "Image";
|
||||
"Tweak.Message.Voice" = "Voice";
|
||||
"Tweak.Message.Video" = "Video";
|
||||
"Tweak.Message.Sticker" = "Sticker";
|
||||
"Tweak.Message.Link" = "Link";
|
||||
"Tweak.Message.AMessage" = "a message";
|
||||
"Tweak.MessageMenuItem.CopyLink" = "Copy Link";
|
||||
"Tweak.MessageMenuItem.OpenInBrowser" = "Open In Browser";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCode" = "Identify QRCode";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "The result of the recognition has been copied to the pasteboard";
|
||||
"Tweak.MessageMenuItem.ExportSticker" = "Export Sticker";
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
Localizable.strings
|
||||
WeChatTweak
|
||||
|
||||
Created by Sunny Young on 2018/6/30.
|
||||
Copyright © 2018 Sunnyyoung. All rights reserved.
|
||||
*/
|
||||
|
||||
"Tweak.Title.LoginAnotherAccount" = "登录新的账号";
|
||||
"Tweak.Title.Group" = "群组";
|
||||
"Tweak.Message.InterceptedARecalledMessage" = "[已拦截一条撤回消息]\n%@";
|
||||
"Tweak.Message.Recalled" = "撤回了";
|
||||
"Tweak.Message.Image" = "图片";
|
||||
"Tweak.Message.Voice" = "语音";
|
||||
"Tweak.Message.Video" = "视频";
|
||||
"Tweak.Message.Sticker" = "表情";
|
||||
"Tweak.Message.Link" = "链接";
|
||||
"Tweak.Message.AMessage" = "一条消息";
|
||||
"Tweak.MessageMenuItem.CopyLink" = "复制链接";
|
||||
"Tweak.MessageMenuItem.OpenInBrowser" = "使用浏览器打开";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCode" = "识别二维码";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "识别结果已复制到粘贴板";
|
||||
"Tweak.MessageMenuItem.ExportSticker" = "导出表情";
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
Localizable.strings
|
||||
WeChatTweak
|
||||
|
||||
Created by Sunny Young on 2018/6/30.
|
||||
Copyright © 2018 Sunnyyoung. All rights reserved.
|
||||
*/
|
||||
|
||||
"Tweak.Title.LoginAnotherAccount" = "登錄新的賬號";
|
||||
"Tweak.Title.Group" = "群組";
|
||||
"Tweak.Message.InterceptedARecalledMessage" = "[已攔截壹條撤回消息]\n%@";
|
||||
"Tweak.Message.Recalled" = "撤回了";
|
||||
"Tweak.Message.Image" = "图片";
|
||||
"Tweak.Message.Voice" = "语音";
|
||||
"Tweak.Message.Video" = "视频";
|
||||
"Tweak.Message.Sticker" = "表情";
|
||||
"Tweak.Message.Link" = "链接";
|
||||
"Tweak.Message.AMessage" = "一条消息";
|
||||
"Tweak.MessageMenuItem.CopyLink" = "複製鏈接";
|
||||
"Tweak.MessageMenuItem.OpenInBrowser" = "使用瀏覽器打開";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCode" = "識別QRCode";
|
||||
"Tweak.MessageMenuItem.IdentifyQRCodeNotification" = "識別結果已復製到粘貼板";
|
||||
"Tweak.MessageMenuItem.ExportSticker" = "導出貼圖";
|
||||
210
WeChatTweak/Vendor/fishhook.c
vendored
Normal file
210
WeChatTweak/Vendor/fishhook.c
vendored
Normal file
|
|
@ -0,0 +1,210 @@
|
|||
// Copyright (c) 2013, Facebook, Inc.
|
||||
// All rights reserved.
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither the name Facebook nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#import "fishhook.h"
|
||||
|
||||
#import <dlfcn.h>
|
||||
#import <stdlib.h>
|
||||
#import <string.h>
|
||||
#import <sys/types.h>
|
||||
#import <mach-o/dyld.h>
|
||||
#import <mach-o/loader.h>
|
||||
#import <mach-o/nlist.h>
|
||||
|
||||
#ifdef __LP64__
|
||||
typedef struct mach_header_64 mach_header_t;
|
||||
typedef struct segment_command_64 segment_command_t;
|
||||
typedef struct section_64 section_t;
|
||||
typedef struct nlist_64 nlist_t;
|
||||
#define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT_64
|
||||
#else
|
||||
typedef struct mach_header mach_header_t;
|
||||
typedef struct segment_command segment_command_t;
|
||||
typedef struct section section_t;
|
||||
typedef struct nlist nlist_t;
|
||||
#define LC_SEGMENT_ARCH_DEPENDENT LC_SEGMENT
|
||||
#endif
|
||||
|
||||
#ifndef SEG_DATA_CONST
|
||||
#define SEG_DATA_CONST "__DATA_CONST"
|
||||
#endif
|
||||
|
||||
struct rebindings_entry {
|
||||
struct rebinding *rebindings;
|
||||
size_t rebindings_nel;
|
||||
struct rebindings_entry *next;
|
||||
};
|
||||
|
||||
static struct rebindings_entry *_rebindings_head;
|
||||
|
||||
static int prepend_rebindings(struct rebindings_entry **rebindings_head,
|
||||
struct rebinding rebindings[],
|
||||
size_t nel) {
|
||||
struct rebindings_entry *new_entry = (struct rebindings_entry *) malloc(sizeof(struct rebindings_entry));
|
||||
if (!new_entry) {
|
||||
return -1;
|
||||
}
|
||||
new_entry->rebindings = (struct rebinding *) malloc(sizeof(struct rebinding) * nel);
|
||||
if (!new_entry->rebindings) {
|
||||
free(new_entry);
|
||||
return -1;
|
||||
}
|
||||
memcpy(new_entry->rebindings, rebindings, sizeof(struct rebinding) * nel);
|
||||
new_entry->rebindings_nel = nel;
|
||||
new_entry->next = *rebindings_head;
|
||||
*rebindings_head = new_entry;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void perform_rebinding_with_section(struct rebindings_entry *rebindings,
|
||||
section_t *section,
|
||||
intptr_t slide,
|
||||
nlist_t *symtab,
|
||||
char *strtab,
|
||||
uint32_t *indirect_symtab) {
|
||||
uint32_t *indirect_symbol_indices = indirect_symtab + section->reserved1;
|
||||
void **indirect_symbol_bindings = (void **)((uintptr_t)slide + section->addr);
|
||||
for (uint i = 0; i < section->size / sizeof(void *); i++) {
|
||||
uint32_t symtab_index = indirect_symbol_indices[i];
|
||||
if (symtab_index == INDIRECT_SYMBOL_ABS || symtab_index == INDIRECT_SYMBOL_LOCAL ||
|
||||
symtab_index == (INDIRECT_SYMBOL_LOCAL | INDIRECT_SYMBOL_ABS)) {
|
||||
continue;
|
||||
}
|
||||
uint32_t strtab_offset = symtab[symtab_index].n_un.n_strx;
|
||||
char *symbol_name = strtab + strtab_offset;
|
||||
if (strnlen(symbol_name, 2) < 2) {
|
||||
continue;
|
||||
}
|
||||
struct rebindings_entry *cur = rebindings;
|
||||
while (cur) {
|
||||
for (uint j = 0; j < cur->rebindings_nel; j++) {
|
||||
if (strcmp(&symbol_name[1], cur->rebindings[j].name) == 0) {
|
||||
if (cur->rebindings[j].replaced != NULL &&
|
||||
indirect_symbol_bindings[i] != cur->rebindings[j].replacement) {
|
||||
*(cur->rebindings[j].replaced) = indirect_symbol_bindings[i];
|
||||
}
|
||||
indirect_symbol_bindings[i] = cur->rebindings[j].replacement;
|
||||
goto symbol_loop;
|
||||
}
|
||||
}
|
||||
cur = cur->next;
|
||||
}
|
||||
symbol_loop:;
|
||||
}
|
||||
}
|
||||
|
||||
static void rebind_symbols_for_image(struct rebindings_entry *rebindings,
|
||||
const struct mach_header *header,
|
||||
intptr_t slide) {
|
||||
Dl_info info;
|
||||
if (dladdr(header, &info) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
segment_command_t *cur_seg_cmd;
|
||||
segment_command_t *linkedit_segment = NULL;
|
||||
struct symtab_command* symtab_cmd = NULL;
|
||||
struct dysymtab_command* dysymtab_cmd = NULL;
|
||||
|
||||
uintptr_t cur = (uintptr_t)header + sizeof(mach_header_t);
|
||||
for (uint i = 0; i < header->ncmds; i++, cur += cur_seg_cmd->cmdsize) {
|
||||
cur_seg_cmd = (segment_command_t *)cur;
|
||||
if (cur_seg_cmd->cmd == LC_SEGMENT_ARCH_DEPENDENT) {
|
||||
if (strcmp(cur_seg_cmd->segname, SEG_LINKEDIT) == 0) {
|
||||
linkedit_segment = cur_seg_cmd;
|
||||
}
|
||||
} else if (cur_seg_cmd->cmd == LC_SYMTAB) {
|
||||
symtab_cmd = (struct symtab_command*)cur_seg_cmd;
|
||||
} else if (cur_seg_cmd->cmd == LC_DYSYMTAB) {
|
||||
dysymtab_cmd = (struct dysymtab_command*)cur_seg_cmd;
|
||||
}
|
||||
}
|
||||
|
||||
if (!symtab_cmd || !dysymtab_cmd || !linkedit_segment ||
|
||||
!dysymtab_cmd->nindirectsyms) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Find base symbol/string table addresses
|
||||
uintptr_t linkedit_base = (uintptr_t)slide + linkedit_segment->vmaddr - linkedit_segment->fileoff;
|
||||
nlist_t *symtab = (nlist_t *)(linkedit_base + symtab_cmd->symoff);
|
||||
char *strtab = (char *)(linkedit_base + symtab_cmd->stroff);
|
||||
|
||||
// Get indirect symbol table (array of uint32_t indices into symbol table)
|
||||
uint32_t *indirect_symtab = (uint32_t *)(linkedit_base + dysymtab_cmd->indirectsymoff);
|
||||
|
||||
cur = (uintptr_t)header + sizeof(mach_header_t);
|
||||
for (uint i = 0; i < header->ncmds; i++, cur += cur_seg_cmd->cmdsize) {
|
||||
cur_seg_cmd = (segment_command_t *)cur;
|
||||
if (cur_seg_cmd->cmd == LC_SEGMENT_ARCH_DEPENDENT) {
|
||||
if (strcmp(cur_seg_cmd->segname, SEG_DATA) != 0 &&
|
||||
strcmp(cur_seg_cmd->segname, SEG_DATA_CONST) != 0) {
|
||||
continue;
|
||||
}
|
||||
for (uint j = 0; j < cur_seg_cmd->nsects; j++) {
|
||||
section_t *sect =
|
||||
(section_t *)(cur + sizeof(segment_command_t)) + j;
|
||||
if ((sect->flags & SECTION_TYPE) == S_LAZY_SYMBOL_POINTERS) {
|
||||
perform_rebinding_with_section(rebindings, sect, slide, symtab, strtab, indirect_symtab);
|
||||
}
|
||||
if ((sect->flags & SECTION_TYPE) == S_NON_LAZY_SYMBOL_POINTERS) {
|
||||
perform_rebinding_with_section(rebindings, sect, slide, symtab, strtab, indirect_symtab);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void _rebind_symbols_for_image(const struct mach_header *header,
|
||||
intptr_t slide) {
|
||||
rebind_symbols_for_image(_rebindings_head, header, slide);
|
||||
}
|
||||
|
||||
int rebind_symbols_image(void *header,
|
||||
intptr_t slide,
|
||||
struct rebinding rebindings[],
|
||||
size_t rebindings_nel) {
|
||||
struct rebindings_entry *rebindings_head = NULL;
|
||||
int retval = prepend_rebindings(&rebindings_head, rebindings, rebindings_nel);
|
||||
rebind_symbols_for_image(rebindings_head, (const struct mach_header *) header, slide);
|
||||
free(rebindings_head);
|
||||
return retval;
|
||||
}
|
||||
|
||||
int rebind_symbols(struct rebinding rebindings[], size_t rebindings_nel) {
|
||||
int retval = prepend_rebindings(&_rebindings_head, rebindings, rebindings_nel);
|
||||
if (retval < 0) {
|
||||
return retval;
|
||||
}
|
||||
// If this was the first call, register callback for image additions (which is also invoked for
|
||||
// existing images, otherwise, just run on existing images
|
||||
if (!_rebindings_head->next) {
|
||||
_dyld_register_func_for_add_image(_rebind_symbols_for_image);
|
||||
} else {
|
||||
uint32_t c = _dyld_image_count();
|
||||
for (uint32_t i = 0; i < c; i++) {
|
||||
_rebind_symbols_for_image(_dyld_get_image_header(i), _dyld_get_image_vmaddr_slide(i));
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
76
WeChatTweak/Vendor/fishhook.h
vendored
Normal file
76
WeChatTweak/Vendor/fishhook.h
vendored
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
// Copyright (c) 2013, Facebook, Inc.
|
||||
// All rights reserved.
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither the name Facebook nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef fishhook_h
|
||||
#define fishhook_h
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if !defined(FISHHOOK_EXPORT)
|
||||
#define FISHHOOK_VISIBILITY __attribute__((visibility("hidden")))
|
||||
#else
|
||||
#define FISHHOOK_VISIBILITY __attribute__((visibility("default")))
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif //__cplusplus
|
||||
|
||||
/*
|
||||
* A structure representing a particular intended rebinding from a symbol
|
||||
* name to its replacement
|
||||
*/
|
||||
struct rebinding {
|
||||
const char *name;
|
||||
void *replacement;
|
||||
void **replaced;
|
||||
};
|
||||
|
||||
/*
|
||||
* For each rebinding in rebindings, rebinds references to external, indirect
|
||||
* symbols with the specified name to instead point at replacement for each
|
||||
* image in the calling process as well as for all future images that are loaded
|
||||
* by the process. If rebind_functions is called more than once, the symbols to
|
||||
* rebind are added to the existing list of rebindings, and if a given symbol
|
||||
* is rebound more than once, the later rebinding will take precedence.
|
||||
*/
|
||||
FISHHOOK_VISIBILITY
|
||||
int rebind_symbols(struct rebinding rebindings[], size_t rebindings_nel);
|
||||
|
||||
/*
|
||||
* Rebinds as above, but only in the specified image. The header should point
|
||||
* to the mach-o header, the slide should be the slide offset. Others as above.
|
||||
*/
|
||||
FISHHOOK_VISIBILITY
|
||||
int rebind_symbols_image(void *header,
|
||||
intptr_t slide,
|
||||
struct rebinding rebindings[],
|
||||
size_t rebindings_nel);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif //__cplusplus
|
||||
|
||||
#endif //fishhook_h
|
||||
|
||||
16
WeChatTweak/WeChatTweak.h
Normal file
16
WeChatTweak/WeChatTweak.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// WeChatTweak.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/8/11.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <objc/runtime.h>
|
||||
#import <objc/message.h>
|
||||
#import <JRSwizzle/JRSwizzle.h>
|
||||
#import <CoreImage/CoreImage.h>
|
||||
|
||||
FOUNDATION_EXPORT double WeChatTweakVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char WeChatTweakVersionString[];
|
||||
271
WeChatTweak/WeChatTweak.m
Executable file
271
WeChatTweak/WeChatTweak.m
Executable file
|
|
@ -0,0 +1,271 @@
|
|||
//
|
||||
// WeChatTweak.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunnyyoung on 2017/8/11.
|
||||
// Copyright © 2017年 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "WeChatTweak.h"
|
||||
#import "WeChatTweakHeaders.h"
|
||||
#import "fishhook.h"
|
||||
#import "NSBundle+WeChatTweak.h"
|
||||
#import "NSString+WeChatTweak.h"
|
||||
#import "TweakPreferencesController.h"
|
||||
#import "AlfredManager.h"
|
||||
#import "WTConfigManager.h"
|
||||
|
||||
// Global Function
|
||||
static NSString *(*original_NSHomeDirectory)(void);
|
||||
static NSArray<NSString *> *(*original_NSSearchPathForDirectoriesInDomains)(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, BOOL expandTilde);
|
||||
NSString *tweak_NSHomeDirectory(void) {
|
||||
return [original_NSHomeDirectory() stringByAppendingPathComponent:@"/Library/Containers/com.tencent.xinWeChat/Data/"];
|
||||
}
|
||||
NSArray<NSString *> *tweak_NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, BOOL expandTilde) {
|
||||
if (domainMask == NSUserDomainMask) {
|
||||
NSMutableArray<NSString *> *directories = [original_NSSearchPathForDirectoriesInDomains(directory, domainMask, expandTilde) mutableCopy];
|
||||
[directories enumerateObjectsUsingBlock:^(NSString * _Nonnull object, NSUInteger index, BOOL * _Nonnull stop) {
|
||||
switch (directory) {
|
||||
case NSDocumentDirectory: directories[index] = [tweak_NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; break;
|
||||
case NSLibraryDirectory: directories[index] = [tweak_NSHomeDirectory() stringByAppendingPathComponent:@"Library"]; break;
|
||||
case NSApplicationSupportDirectory: directories[index] = [tweak_NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support"]; break;
|
||||
case NSCachesDirectory: directories[index] = [tweak_NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"]; break;
|
||||
default: break;
|
||||
}
|
||||
}];
|
||||
return directories;
|
||||
} else {
|
||||
return original_NSSearchPathForDirectoriesInDomains(directory, domainMask, expandTilde);
|
||||
}
|
||||
}
|
||||
|
||||
@implementation NSObject (WeChatTweak)
|
||||
|
||||
#pragma mark - Constructor
|
||||
|
||||
static void __attribute__((constructor)) tweak(void) {
|
||||
// Global Function Hook
|
||||
rebind_symbols((struct rebinding[2]) {
|
||||
{ "NSHomeDirectory", tweak_NSHomeDirectory, (void *)&original_NSHomeDirectory },
|
||||
{ "NSSearchPathForDirectoriesInDomains", tweak_NSSearchPathForDirectoriesInDomains, (void *)&original_NSSearchPathForDirectoriesInDomains }
|
||||
}, 2);
|
||||
// Method Swizzling
|
||||
class_addMethod(objc_getClass("AppDelegate"), @selector(applicationDockMenu:), method_getImplementation(class_getInstanceMethod(objc_getClass("AppDelegate"), @selector(tweak_applicationDockMenu:))), "@:@");
|
||||
[objc_getClass("AppDelegate") jr_swizzleMethod:NSSelectorFromString(@"applicationDidFinishLaunching:") withMethod:@selector(tweak_applicationDidFinishLaunching:) error:nil];
|
||||
[objc_getClass("CUtility") jr_swizzleClassMethod:NSSelectorFromString(@"HasWechatInstance") withClassMethod:@selector(tweak_HasWechatInstance) error:nil];
|
||||
[objc_getClass("NSRunningApplication") jr_swizzleClassMethod:NSSelectorFromString(@"runningApplicationsWithBundleIdentifier:") withClassMethod:@selector(tweak_runningApplicationsWithBundleIdentifier:) error:nil];
|
||||
[objc_getClass("MASPreferencesWindowController") jr_swizzleMethod:NSSelectorFromString(@"initWithViewControllers:") withMethod:@selector(tweak_initWithViewControllers:) error:nil];
|
||||
|
||||
[objc_getClass("MMMessageCellView") jr_swizzleMethod:NSSelectorFromString(@"contextMenu") withMethod:@selector(tweak_contextMenu) error:nil];
|
||||
|
||||
objc_property_attribute_t type = { "T", "@\"NSString\"" }; // NSString
|
||||
objc_property_attribute_t atom = { "N", "" }; // nonatomic
|
||||
objc_property_attribute_t ownership = { "&", "" }; // C = copy & = strong
|
||||
objc_property_attribute_t backingivar = { "V", "_m_nsHeadImgUrl" }; // ivar name
|
||||
objc_property_attribute_t attrs[] = { type, atom, ownership, backingivar };
|
||||
class_addProperty(objc_getClass("WCContactData"), "wt_avatarPath", attrs, 4);
|
||||
class_addMethod(objc_getClass("WCContactData"), @selector(wt_avatarPath), method_getImplementation(class_getInstanceMethod(objc_getClass("WCContactData"), @selector(wt_avatarPath))), "@@:");
|
||||
class_addMethod(objc_getClass("WCContactData"), @selector(setWt_avatarPath:), method_getImplementation(class_getInstanceMethod(objc_getClass("WCContactData"), @selector(setWt_avatarPath:))), "v@:@");
|
||||
class_addMethod(objc_getClass("WCContactData"), @selector(modelPropertyWhitelist), method_getImplementation(class_getClassMethod(objc_getClass("WCContactData"), @selector(modelPropertyWhitelist))), "v@:");
|
||||
}
|
||||
|
||||
#pragma mark - AppUrlMessageMenu
|
||||
|
||||
- (id)tweak_contextMenu {
|
||||
NSMenu *menu = (NSMenu *)[self tweak_contextMenu];
|
||||
switch (((MMMessageCellView *)self).messageTableItem.message.messageType) {
|
||||
case MessageDataTypeAppUrl:
|
||||
[menu addItem:NSMenuItem.separatorItem];
|
||||
[menu addItem:({
|
||||
NSMenuItem *copyUrlItem = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.CopyLink"]
|
||||
action:@selector(tweakCopyURL:)
|
||||
keyEquivalent:@""];
|
||||
copyUrlItem;
|
||||
})];
|
||||
[menu addItem:({
|
||||
NSMenuItem *openUrlItem = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.OpenInBrowser"]
|
||||
action:@selector(tweakOpenURL:)
|
||||
keyEquivalent:@""];
|
||||
openUrlItem;
|
||||
})];
|
||||
break;
|
||||
case MessageDataTypeImage:
|
||||
[menu addItem:NSMenuItem.separatorItem];
|
||||
[menu addItem:({
|
||||
NSMenuItem *qrCodeItem = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.IdentifyQRCode"]
|
||||
action:@selector(tweakIdentifyQRCode:)
|
||||
keyEquivalent:@""];
|
||||
qrCodeItem;
|
||||
})];
|
||||
case MessageDataTypeSticker:
|
||||
[menu addItem:NSMenuItem.separatorItem];
|
||||
[menu addItem:({
|
||||
NSMenuItem *exportStickerItem = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.ExportSticker"]
|
||||
action:@selector(tweakExportSticker:)
|
||||
keyEquivalent:@""];
|
||||
exportStickerItem;
|
||||
})];
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
|
||||
- (void)tweakExportSticker:(id)sender {
|
||||
MMMessageCellView *cell = (MMMessageCellView *)self;
|
||||
MessageData *messageData = cell.messageTableItem.message;
|
||||
NSString *content = messageData.msgContent;
|
||||
NSString *emoji = [[content tweak_subStringFrom:@"<msg>" to:@"</msg>"] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
NSDictionary *dictionary = [NSDictionary dictionaryWithXMLString:emoji];
|
||||
if (![dictionary objectForKey:@"_md5"]) {
|
||||
return;
|
||||
}
|
||||
NSString *stickerMD5 = dictionary[@"_md5"];
|
||||
if (!stickerMD5.length) {
|
||||
return;
|
||||
}
|
||||
NSString *localID = [messageData savingImageFileNameWithLocalID];
|
||||
NSSavePanel *panel = [NSSavePanel savePanel];
|
||||
[panel setNameFieldStringValue:localID];
|
||||
[panel setAllowsOtherFileTypes:YES];
|
||||
[panel setAllowedFileTypes:@[@"gif"]];
|
||||
[panel setExtensionHidden:NO];
|
||||
[panel setCanCreateDirectories:YES];
|
||||
[panel beginSheetModalForWindow:cell.window completionHandler:^(NSModalResponse result) {
|
||||
if (result == NSModalResponseOK) {
|
||||
NSString *path = panel.URL.path;
|
||||
MMServiceCenter *serviceCenter = [objc_getClass("MMServiceCenter") defaultCenter];
|
||||
EmoticonMgr *emoticonMgr = [serviceCenter getService:objc_getClass("EmoticonMgr")];
|
||||
NSData *stickerData = [emoticonMgr getEmotionDataWithMD5:stickerMD5];
|
||||
[stickerData writeToFile:path atomically:YES];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)tweakCopyURL:(id)sender {
|
||||
NSString *url = [self _tweakMessageContentUrl];
|
||||
if (url.length) {
|
||||
[NSPasteboard.generalPasteboard clearContents];
|
||||
[NSPasteboard.generalPasteboard setString:url forType:NSStringPboardType];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tweakOpenURL:(id)sender {
|
||||
NSString *url = [self _tweakMessageContentUrl];
|
||||
if (url.length) {
|
||||
[NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:url]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tweakIdentifyQRCode:(id)sender {
|
||||
MMImageMessageCellView *cell = (MMImageMessageCellView *)self;
|
||||
NSImage *image = cell.displayedImage;
|
||||
if (image) {
|
||||
NSData *imageData = [image TIFFRepresentation];
|
||||
CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:nil options:@{CIDetectorAccuracy: CIDetectorAccuracyHigh}];
|
||||
NSArray *results = [detector featuresInImage:[CIImage imageWithData:imageData]];
|
||||
if (results.count) {
|
||||
CIQRCodeFeature *result = results.firstObject;
|
||||
NSString *content = result.messageString;
|
||||
if (content.length) {
|
||||
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
|
||||
[pasteboard clearContents];
|
||||
[pasteboard setString:content forType:NSStringPboardType];
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:({
|
||||
NSUserNotification *notification = [[NSUserNotification alloc] init];
|
||||
notification.informativeText = [NSBundle.tweakBundle localizedStringForKey:@"Tweak.MessageMenuItem.IdentifyQRCodeNotification"];
|
||||
notification;
|
||||
})];
|
||||
NSURL *url = [NSURL URLWithString:content];
|
||||
if ([url.scheme containsString:@"http"]) {
|
||||
[[NSWorkspace sharedWorkspace] openURL:url];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)_tweakMessageContentUrl {
|
||||
MMMessageCellView *cell = (MMMessageCellView *)self;
|
||||
NSString *content = cell.messageTableItem.message.msgContent;
|
||||
if ([content containsString:@"<url><![CDATA["]) {
|
||||
return [content tweak_subStringFrom:@"<url><![CDATA[" to:@"]]></url>"];
|
||||
} else {
|
||||
return [content tweak_subStringFrom:@"<url>" to:@"</url>"];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Mutiple Instance
|
||||
|
||||
+ (BOOL)tweak_HasWechatInstance {
|
||||
return NO;
|
||||
}
|
||||
|
||||
+ (NSArray<NSRunningApplication *> *)tweak_runningApplicationsWithBundleIdentifier:(NSString *)bundleIdentifier {
|
||||
if ([bundleIdentifier isEqualToString:NSBundle.mainBundle.bundleIdentifier] ) {
|
||||
return @[NSRunningApplication.currentApplication];
|
||||
} else {
|
||||
return [self tweak_runningApplicationsWithBundleIdentifier:bundleIdentifier];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSMenu *)tweak_applicationDockMenu:(NSApplication *)sender {
|
||||
NSMenu *menu = [[NSMenu alloc] init];
|
||||
NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:[NSBundle.tweakBundle localizedStringForKey:@"Tweak.Title.LoginAnotherAccount"]
|
||||
action:@selector(openNewWeChatInstace:)
|
||||
keyEquivalent:@""];
|
||||
[menu insertItem:menuItem atIndex:0];
|
||||
return menu;
|
||||
}
|
||||
|
||||
- (void)openNewWeChatInstace:(id)sender {
|
||||
NSString *applicationPath = NSBundle.mainBundle.bundlePath;
|
||||
NSTask *task = [[NSTask alloc] init];
|
||||
task.launchPath = @"/usr/bin/open";
|
||||
task.arguments = @[@"-n", applicationPath];
|
||||
[task launch];
|
||||
[task waitUntilExit];
|
||||
}
|
||||
|
||||
#pragma mark - Alfred
|
||||
|
||||
- (void)tweak_applicationDidFinishLaunching:(NSNotification *)notification {
|
||||
[AlfredManager.sharedInstance startListener];
|
||||
[self tweak_applicationDidFinishLaunching:notification];
|
||||
}
|
||||
|
||||
#pragma mark - Preferences Window
|
||||
|
||||
- (id)tweak_initWithViewControllers:(NSArray *)arg1 {
|
||||
NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:arg1];
|
||||
TweakPreferencesController *controller = [[TweakPreferencesController alloc] initWithNibName:nil bundle:[NSBundle tweakBundle]];
|
||||
[viewControllers addObject:controller];
|
||||
return [self tweak_initWithViewControllers:viewControllers];
|
||||
}
|
||||
|
||||
#pragma mark - WCContact Data
|
||||
|
||||
- (NSString *)wt_avatarPath {
|
||||
if (![objc_getClass("PathUtility") respondsToSelector:@selector(GetCurUserDocumentPath)]) {
|
||||
return @"";
|
||||
}
|
||||
NSString *pathString = [NSString stringWithFormat:@"%@/Avatar/%@.jpg", [objc_getClass("PathUtility") GetCurUserDocumentPath], [((WCContactData *)self).m_nsUsrName md5String]];
|
||||
return [NSFileManager.defaultManager fileExistsAtPath:pathString] ? pathString : @"";
|
||||
}
|
||||
|
||||
- (void)setWt_avatarPath:(NSString *)avatarPath {
|
||||
// For readonly
|
||||
return;
|
||||
}
|
||||
|
||||
+ (NSArray *)modelPropertyWhitelist {
|
||||
NSArray *list =@[
|
||||
@"wt_avatarPath",
|
||||
@"m_nsRemark",
|
||||
@"m_nsNickName",
|
||||
@"m_nsUsrName"
|
||||
];
|
||||
return WTConfigManager.sharedInstance.compressedJSONEnabled ? list : nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
theme: jekyll-theme-cayman
|
||||
show_downloads: true
|
||||
github:
|
||||
zip_url: https://github.com/Sunnyyoung/WeChatTweak-macOS/releases/latest/download/WeChatTweak-macOS.zip
|
||||
282
config.json
282
config.json
|
|
@ -1,282 +0,0 @@
|
|||
[
|
||||
{
|
||||
"version": "31927",
|
||||
"targets": [
|
||||
{
|
||||
"identifier": "revoke",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "103dba3d0",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "startUpdater",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001ea41c",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "startBackgroundUpdatesCheck",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001ed3b4",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "checkForUpdates",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001ecf9c",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "enableAutoUpdate",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001ed920",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "automaticallyDownloadsUpdates",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001f6ee8",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "canCheckForUpdate",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001f6ef8",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "multiInstance",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001e1c10",
|
||||
"asm": "20008052C0035FD6"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "32281",
|
||||
"targets": [
|
||||
{
|
||||
"identifier": "revoke",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "103db33e0",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "startUpdater",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001e9ed0",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "startBackgroundUpdatesCheck",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001ecb10",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "checkForUpdates",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001ec73c",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "enableAutoUpdate",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001ecfc0",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "automaticallyDownloadsUpdates",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001f59e0",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "canCheckForUpdate",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001f59e0",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "multiInstance",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001e1a74",
|
||||
"asm": "20008052C0035FD6"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "32288",
|
||||
"targets": [
|
||||
{
|
||||
"identifier": "revoke",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "103db34c0",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "startUpdater",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001e9ed0",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "startBackgroundUpdatesCheck",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001ecb10",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "checkForUpdates",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001ec73c",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "enableAutoUpdate",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001ecfc0",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "automaticallyDownloadsUpdates",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001f59e0",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "canCheckForUpdate",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001f59e0",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "multiInstance",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001e1a74",
|
||||
"asm": "20008052C0035FD6"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "31960",
|
||||
"targets": [
|
||||
{
|
||||
"identifier": "revoke",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "10408a408",
|
||||
"asm": "00008052C0035FD6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"identifier": "multiInstance",
|
||||
"entries": [
|
||||
{
|
||||
"arch": "arm64",
|
||||
"addr": "1001e4a38",
|
||||
"asm": "20008052C0035FD6"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
BIN
insert_dylib
Executable file
BIN
insert_dylib
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user