├── .gitignore ├── .idea ├── .gitignore ├── .name ├── codeStyles │ └── Project.xml ├── compiler.xml ├── deploymentTargetDropDown.xml ├── gradle.xml ├── jarRepositories.xml ├── migrations.xml ├── misc.xml └── vcs.xml ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro ├── release │ └── output-metadata.json └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── xposed_init │ ├── java │ └── com │ │ └── specher │ │ └── superhookbox │ │ ├── Utils.java │ │ ├── XConfig.java │ │ ├── activity │ │ └── MainActivity.java │ │ └── hook │ │ ├── BaseHook.java │ │ ├── Hook.java │ │ ├── MiMacro.java │ │ ├── Nubia.java │ │ ├── Quark.java │ │ ├── Telegram.java │ │ ├── Tiktok.java │ │ └── WeChat.java │ └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── drawable │ └── ic_launcher_background.xml │ ├── layout │ └── activity_main.xml │ ├── menu │ └── menu.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── values │ ├── arrays.xml │ ├── colors.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ └── file.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | SuperHookBox -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | xmlns:android 14 | 15 | ^$ 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | xmlns:.* 25 | 26 | ^$ 27 | 28 | 29 | BY_NAME 30 | 31 |
32 |
33 | 34 | 35 | 36 | .*:id 37 | 38 | http://schemas.android.com/apk/res/android 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 | .*:name 48 | 49 | http://schemas.android.com/apk/res/android 50 | 51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 | name 59 | 60 | ^$ 61 | 62 | 63 | 64 |
65 |
66 | 67 | 68 | 69 | style 70 | 71 | ^$ 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 | 80 | .* 81 | 82 | ^$ 83 | 84 | 85 | BY_NAME 86 | 87 |
88 |
89 | 90 | 91 | 92 | .* 93 | 94 | http://schemas.android.com/apk/res/android 95 | 96 | 97 | ANDROID_ATTRIBUTE_ORDER 98 | 99 |
100 |
101 | 102 | 103 | 104 | .* 105 | 106 | .* 107 | 108 | 109 | BY_NAME 110 | 111 |
112 |
113 |
114 |
115 |
116 |
-------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/deploymentTargetDropDown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /.idea/migrations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SuperHookBox 2 | - 个人常用Xposed模块功能集合项目 3 | ------ 4 | 注意,使用本源代码需要遵循GPLv3协议进行开源并注明出处。 5 | 6 | 免责声明:此项目免费开源,仅供学习交流,严禁用于商业用途,否则后果自负。 7 | ------ 8 | 联系方式: 9 | 10 | Telegram:@HookBox(https://t.me/HookBox) 11 | 12 | E-mail:Specher@qq.com 13 | # Features 14 | - 小米、红魔一键连招限制解除 15 | - Telegram存储重定向/防撤回消息/阻止阅后即焚 16 | 17 | # License 18 | [GPL-3.0](LICENSE) 19 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | 5 | defaultConfig { 6 | applicationId "com.specher.superhookbox" 7 | minSdkVersion 23 8 | //noinspection EditedTargetSdkVersion 9 | targetSdkVersion 35 10 | versionCode 15 11 | versionName "4.0" 12 | 13 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 14 | } 15 | 16 | buildTypes { 17 | release { 18 | minifyEnabled true 19 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | compileOptions { 23 | sourceCompatibility JavaVersion.VERSION_1_8 24 | targetCompatibility JavaVersion.VERSION_1_8 25 | } 26 | compileSdk 35 27 | namespace 'com.specher.superhookbox' 28 | buildFeatures { 29 | buildConfig true 30 | } 31 | } 32 | 33 | dependencies { 34 | 35 | 36 | compileOnly 'de.robv.android.xposed:api:82' 37 | implementation 'org.luckypray:dexkit:2.0.3' 38 | 39 | //implementation fileTree(dir: "libs", include: ["*.jar"]) 40 | implementation 'androidx.appcompat:appcompat:1.7.0' 41 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4' 42 | implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) 43 | 44 | testImplementation 'junit:junit:4.13.2' 45 | androidTestImplementation 'androidx.test.ext:junit:1.1.5' 46 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' 47 | 48 | 49 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | 23 | -keep class com.specher.superhookbox.hook.Hook{ *; } 24 | 25 | #-keepnames class com.specher.superhookbox.hook.**{ *; } 26 | 27 | -keepclassmembers class 28 | com.specher.superhookbox.hook.** { 29 | public void hook(...); 30 | } 31 | -dontwarn okhttp3.** 32 | -keep class okhttp3.*{*;} 33 | 34 | # 清除日志 35 | -assumenosideeffects class android.util.Log { 36 | public static *** d(...); 37 | public static *** e(...); 38 | public static *** i(...); 39 | public static *** v(...); 40 | public static *** println(...); 41 | public static *** w(...); 42 | } -------------------------------------------------------------------------------- /app/release/output-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "artifactType": { 4 | "type": "APK", 5 | "kind": "Directory" 6 | }, 7 | "applicationId": "com.specher.superhookbox", 8 | "variantName": "release", 9 | "elements": [ 10 | { 11 | "type": "SINGLE", 12 | "filters": [], 13 | "attributes": [], 14 | "versionCode": 15, 15 | "versionName": "4.0", 16 | "outputFile": "app-release.apk" 17 | } 18 | ], 19 | "elementType": "File", 20 | "baselineProfiles": [ 21 | { 22 | "minApi": 28, 23 | "maxApi": 30, 24 | "baselineProfiles": [ 25 | "baselineProfiles/1/app-release.dm" 26 | ] 27 | }, 28 | { 29 | "minApi": 31, 30 | "maxApi": 2147483647, 31 | "baselineProfiles": [ 32 | "baselineProfiles/0/app-release.dm" 33 | ] 34 | } 35 | ], 36 | "minSdkVersionForDexing": 23 37 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 32 | 35 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/assets/xposed_init: -------------------------------------------------------------------------------- 1 | com.specher.superhookbox.hook.Hook -------------------------------------------------------------------------------- /app/src/main/java/com/specher/superhookbox/Utils.java: -------------------------------------------------------------------------------- 1 | package com.specher.superhookbox; 2 | 3 | import android.app.ActivityManager; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.os.SystemClock; 7 | import android.view.MotionEvent; 8 | import android.view.View; 9 | 10 | import java.io.File; 11 | import java.io.IOException; 12 | import java.lang.reflect.Method; 13 | import java.util.List; 14 | 15 | import de.robv.android.xposed.XposedBridge; 16 | import de.robv.android.xposed.XposedHelpers; 17 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 18 | 19 | public class Utils { 20 | 21 | public static String TAG = "HookBox"; 22 | 23 | /** 24 | * 获取目标应用 VersionName 25 | * 26 | * @param lpparam 27 | * @return 28 | */ 29 | public static String getPackageVersionName(XC_LoadPackage.LoadPackageParam lpparam) { 30 | try { 31 | Class parserCls = XposedHelpers.findClass("android.content.pm.PackageParser", lpparam.classLoader); 32 | Object parser = parserCls.newInstance(); 33 | File apkPath = new File(lpparam.appInfo.sourceDir); 34 | Object pkg = XposedHelpers.callMethod(parser, "parsePackage", apkPath, 0); 35 | String versionName = (String) XposedHelpers.getObjectField(pkg, "mVersionName"); 36 | return versionName; 37 | } catch (Throwable e) { 38 | return "(unknown)"; 39 | } 40 | } 41 | 42 | /** 43 | * 获取目标应用 VersionCode 44 | * 45 | * @param lpparam 46 | * @return 47 | */ 48 | public static int getPackageVersionCode(XC_LoadPackage.LoadPackageParam lpparam) { 49 | try { 50 | Class parserCls = XposedHelpers.findClass("android.content.pm.PackageParser", lpparam.classLoader); 51 | Object parser = parserCls.newInstance(); 52 | File apkPath = new File(lpparam.appInfo.sourceDir); 53 | Object pkg = XposedHelpers.callMethod(parser, "parsePackage", apkPath, 0); 54 | String versionName = (String) XposedHelpers.getObjectField(pkg, "mVersionName"); 55 | int versionCode = XposedHelpers.getIntField(pkg, "mVersionCode"); 56 | 57 | return versionCode; 58 | } catch (Throwable e) { 59 | return 0; 60 | } 61 | } 62 | 63 | /** 64 | * Xposed打印日志 65 | * 66 | * @param log 67 | */ 68 | public static void log(String log) { 69 | XposedBridge.log(TAG + ":" + log); 70 | } 71 | 72 | 73 | /** 74 | * 通过返回值查找方法 75 | * @param className 76 | * @param returnType 77 | * @return 78 | */ 79 | public static Method findMethodbyReturnType(Class className, String returnType) { 80 | Method[] methods = className.getDeclaredMethods(); 81 | for (Method method : methods) { 82 | //通过返回值类型来寻找方法 83 | if (method.getReturnType().getName().equals(returnType)) { 84 | Utils.log("find method success"); 85 | return method; 86 | } 87 | } 88 | return null; 89 | } 90 | 91 | public static void exitApp(Context context){ 92 | ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); 93 | List appTaskList = activityManager.getAppTasks(); 94 | for (ActivityManager.AppTask appTask : appTaskList) { 95 | appTask.finishAndRemoveTask(); 96 | } 97 | android.os.Process.killProcess(android.os.Process.myPid()); 98 | System.exit(0); 99 | } 100 | 101 | /** 102 | * 模拟点击某个指定坐标作用在View上 103 | * @param view 104 | * @param x 105 | * @param y 106 | */ 107 | public void clickView(View view, float x, float y) 108 | { 109 | long downTime = SystemClock.uptimeMillis(); 110 | final MotionEvent downEvent = MotionEvent.obtain( 111 | downTime, downTime, MotionEvent.ACTION_DOWN, x, y, 0); 112 | downTime+=10; 113 | final MotionEvent upEvent = MotionEvent.obtain( 114 | downTime, downTime, MotionEvent.ACTION_UP, x, y, 0); 115 | view.onTouchEvent(downEvent); 116 | view.onTouchEvent(upEvent); 117 | downEvent.recycle(); 118 | upEvent.recycle(); 119 | } 120 | 121 | /** 122 | * 通过v1或者是wxid 加人 123 | * @param v1 对方的v1值 124 | * @param scene 场景方式 125 | * @param bundleScene bundle参数方式 126 | */ 127 | public static void addFriend(String v1,int scene,int bundleScene){ 128 | 129 | // 计算出py的值 130 | String py = ""; 131 | String [] ss = v1.split("_"); 132 | for (String s1:ss){ 133 | py +=s1; 134 | } 135 | // 将py转化为大写 136 | String upper = py.toUpperCase(); 137 | 138 | if (bundleScene == 1){// 只有contact user和场景 139 | String s = "adb shell am start -n com.tencent.mm/com.tencent.mm.plugin.profile.ui.ContactInfoUI "+ 140 | "--es Contact_User \""+v1+"\" "+ 141 | "--ei Contact_Scene "+ scene +" "+ 142 | ""; 143 | try { 144 | Runtime.getRuntime().exec(s); 145 | } catch (IOException e) { 146 | e.printStackTrace(); 147 | } 148 | }else if (bundleScene == 2 ){ // bundle类型为2,所有参数除了brand 149 | 150 | if(scene == 15){ // 通过手机号搜索 151 | //I/set ( 1193): bundle = Bundle[{Contact_NeedShowChangeRemarkButton=false, Contact_QuanPin=wxidlnt4ahvg2esr22, 152 | // Contact_PyInitial=WXIDLNT4AHVG2ESR22, Contact_RegionCode=CN_Guangdong_Guangzhou, Contact_BrandList=, 153 | // Contact_KSnsBgId=0, add_more_friend_search_scene=2, Contact_Search_Mobile=18814143556, Contact_KWeiboNick=null, Contact_KSnsBgUrl=null, 154 | // Contact_KSnsIFlag=0, Contact_KWeibo_flag=0, Contact_Signature=多的是,你不知道的事, Contact_BIZ_KF_WORKER_ID=null, Contact_VUser_Info=null, 155 | // Contact_KHideExpose=true, Contact_Nick=林, Contact_User=wxid_lnt4ahvg2esr22, Contact_VUser_Info_Flag=0, Contact_Sex=1, 156 | // Contact_Alias=q961513094, Contact_Scene=15, Contact_KWeibo=null, 157 | // AntispamTicket=v2_e574085f9339eb7cdac3e14cac25a4bcbb1f186311910df6c32be54b4ebe4c5b3caafa2fcee01e96195b5e1c39f1dd8f@stranger, 158 | // Contact_NeedShowChangeSnsPreButton=false}] 159 | String s = "adb shell am start -n com.tencent.mm/com.tencent.mm.plugin.profile.ui.ContactInfoUI "+ 160 | "--ez Contact_NeedShowChangeRemarkButton false "+ 161 | "--es Contact_QuanPin \""+py+"\" "+ 162 | "--es Contact_PyInitial \""+upper+"\" "+ 163 | "--ei Contact_KSnsBgId 0 "+ 164 | "--ei add_more_friend_search_scene 2 " + 165 | "--es Contact_KWeiboNick \"null\" "+ 166 | "--es Contact_KSnsBgUrl \"null\" "+ 167 | "--ei Contact_KSnsIFlag 0 "+ 168 | "--ei Contact_KWeibo_flag 0 "+ 169 | "--es Contact_Signature \"null\" "+ 170 | "--es Contact_BIZ_KF_WORKER_ID \"null\" "+ 171 | "--es Contact_VUser_Info \"null\" "+ 172 | "--ez Contact_KHideExpose true "+ 173 | "--es Contact_User \""+v1+"\" "+ 174 | "--ei Contact_VUser_Info_Flag 0 "+ 175 | "--ei Contact_Scene "+ scene +" "+ 176 | "--es Contact_KWeibo \"null\" "+ 177 | "--ez Contact_NeedShowChangeSnsPreButton false "+ 178 | ""; 179 | try { 180 | Runtime.getRuntime().exec(s); 181 | } catch (IOException e) { 182 | e.printStackTrace(); 183 | } 184 | }else if (scene == 14){ // 通过群好友 185 | // I/set ( 1107): bundle = Bundle[{Contact_NeedShowChangeRemarkButton=false, Contact_ChatRoomId=636235605@chatroom, 186 | // room_name=636235605@chatroom, Is_RoomOwner=false, Contact_RoomNickname=蔡建, Contact_User=wxid_lnt4ahvg2esr22, Contact_Scene=14, 187 | // Contact_NeedShowChangeSnsPreButton=false}] 188 | String s = "adb shell am start -n com.tencent.mm/com.tencent.mm.plugin.profile.ui.ContactInfoUI "+ 189 | "--ez Contact_NeedShowChangeRemarkButton false "+ 190 | // "--es Contact_ChatRoomId \"636235605@chatroom\" "+ 191 | // "--es room_name \"636235605@chatroom\" "+ 192 | "--ez Is_RoomOwner false "+ 193 | // "--es Contact_RoomNickname \"蔡建\" "+ 194 | "--es Contact_User \""+v1+"\" "+ 195 | "--ei Contact_Scene "+ scene +" "+ 196 | "--ez Contact_NeedShowChangeSnsPreButton false "+ 197 | ""; 198 | try { 199 | Runtime.getRuntime().exec(s); 200 | } catch (IOException e) { 201 | e.printStackTrace(); 202 | } 203 | }else if (scene == 30) {// 通过扫一扫 204 | //I/set ( 1517): bundle = Bundle[{Contact_NeedShowChangeRemarkButton=false, Contact_QuanPin=wxidqxve6fsx4ery12, 205 | // Contact_PyInitial=WXIDQXVE6FSX4ERY12, Contact_RegionCode=CN_Guangdong_Guangzhou, 206 | // Contact_BrandList=, Contact_KSnsBgId=0, Contact_IsLBSFriend=true, 207 | // Contact_KWeiboNick=null, Contact_KSnsBgUrl=null, Contact_KSnsIFlag=0, Contact_KWeibo_flag=0, 208 | // Contact_Signature=宅若久时天然呆, 呆到深处自然萌, Contact_BIZ_KF_WORKER_ID=null, Contact_VUser_Info=null, 209 | // Contact_KHideExpose=true, Contact_Nick=雯雯, 210 | // Contact_User=v1_4b6ece89d367aed49ce765008cd11b297b3c3836bbc71c70ad71dc3e5da1b2359ee868dfe958ef76121ce676f53ab246@stranger, 211 | // Contact_VUser_Info_Flag=0, Contact_Sex=2, Contact_Alias=aa15596417033, Contact_Scene=30, Contact_KWeibo=null, 212 | // AntispamTicket=v2_973dea324a20f5da3d5de134c8c725d768ffb73ba1ec057d61c89f3140fb128e211dd1239af7f458ef7d20df144fcc76@stranger, 213 | // Contact_NeedShowChangeSnsPreButton=false}] 214 | String s = "adb shell am start -n com.tencent.mm/com.tencent.mm.plugin.profile.ui.ContactInfoUI "+ 215 | "--ez Contact_NeedShowChangeRemarkButton false "+ 216 | "--es Contact_QuanPin \""+py+"\" "+ 217 | "--es Contact_PyInitial \""+upper+"\" "+ 218 | "--ei Contact_KSnsBgId 0 "+ 219 | "--ez Contact_IsLBSFriend true "+ 220 | "--es Contact_KWeiboNick \"null\" "+ 221 | "--es Contact_KSnsBgUrl \"null\" "+ 222 | "--ei Contact_KSnsIFlag 0 "+ 223 | "--ei Contact_KWeibo_flag 0 "+ 224 | "--es Contact_Signature \"null\" "+ 225 | "--es Contact_BIZ_KF_WORKER_ID \"null\" "+ 226 | "--es Contact_VUser_Info \"null\" "+ 227 | "--ez Contact_KHideExpose true "+ 228 | "--es Contact_User \""+v1+"\" "+ 229 | "--ei Contact_VUser_Info_Flag 0 "+ 230 | "--ei Contact_Scene "+ scene +" "+ 231 | "--es Contact_KWeibo \"null\" "+ 232 | "--ez Contact_NeedShowChangeSnsPreButton false "+ 233 | ""; 234 | try { 235 | Runtime.getRuntime().exec(s); 236 | } catch (IOException e) { 237 | e.printStackTrace(); 238 | } 239 | } 240 | 241 | 242 | }else if (bundleScene == 3){ // bundle类型为3的时候 243 | 244 | if(scene == 15){ // 通过手机号搜索 245 | //I/set ( 1193): bundle = Bundle[{Contact_NeedShowChangeRemarkButton=false, Contact_QuanPin=wxidlnt4ahvg2esr22, 246 | // Contact_PyInitial=WXIDLNT4AHVG2ESR22, Contact_RegionCode=CN_Guangdong_Guangzhou, Contact_BrandList=, 247 | // Contact_KSnsBgId=0, add_more_friend_search_scene=2, Contact_Search_Mobile=18814143556, Contact_KWeiboNick=null, Contact_KSnsBgUrl=null, 248 | // Contact_KSnsIFlag=0, Contact_KWeibo_flag=0, Contact_Signature=多的是,你不知道的事, Contact_BIZ_KF_WORKER_ID=null, Contact_VUser_Info=null, 249 | // Contact_KHideExpose=true, Contact_Nick=林, Contact_User=wxid_lnt4ahvg2esr22, Contact_VUser_Info_Flag=0, Contact_Sex=1, 250 | // Contact_Alias=q961513094, Contact_Scene=15, Contact_KWeibo=null, 251 | // AntispamTicket=v2_e574085f9339eb7cdac3e14cac25a4bcbb1f186311910df6c32be54b4ebe4c5b3caafa2fcee01e96195b5e1c39f1dd8f@stranger, 252 | // Contact_NeedShowChangeSnsPreButton=false}] 253 | String s = "adb shell am start -n com.tencent.mm/com.tencent.mm.plugin.profile.ui.ContactInfoUI "+ 254 | "--ez Contact_NeedShowChangeRemarkButton false "+ 255 | "--es Contact_QuanPin \""+py+"\" "+ 256 | "--es Contact_PyInitial \""+upper+"\" "+ 257 | "--es Contact_BrandList \"\" "+ 258 | "--ei Contact_KSnsBgId 0 "+ 259 | "--ei add_more_friend_search_scene 2 " + 260 | "--es Contact_KWeiboNick \"null\" "+ 261 | "--es Contact_KSnsBgUrl \"null\" "+ 262 | "--ei Contact_KSnsIFlag 0 "+ 263 | "--ei Contact_KWeibo_flag 0 "+ 264 | "--es Contact_Signature \"null\" "+ 265 | "--es Contact_BIZ_KF_WORKER_ID \"null\" "+ 266 | "--es Contact_VUser_Info \"null\" "+ 267 | "--ez Contact_KHideExpose true "+ 268 | "--es Contact_User \""+v1+"\" "+ 269 | "--ei Contact_VUser_Info_Flag 0 "+ 270 | "--ei Contact_Scene "+ scene +" "+ 271 | "--es Contact_KWeibo \"null\" "+ 272 | "--ez Contact_NeedShowChangeSnsPreButton false "+ 273 | ""; 274 | try { 275 | Runtime.getRuntime().exec(s); 276 | } catch (IOException e) { 277 | e.printStackTrace(); 278 | } 279 | }else if (scene == 14){ // 通过群好友 280 | // I/set ( 1107): bundle = Bundle[{Contact_NeedShowChangeRemarkButton=false, Contact_ChatRoomId=636235605@chatroom, 281 | // room_name=636235605@chatroom, Is_RoomOwner=false, Contact_RoomNickname=蔡建, Contact_User=wxid_lnt4ahvg2esr22, Contact_Scene=14, 282 | // Contact_NeedShowChangeSnsPreButton=false}] 283 | String s = "adb shell am start -n com.tencent.mm/com.tencent.mm.plugin.profile.ui.ContactInfoUI "+ 284 | "--ez Contact_NeedShowChangeRemarkButton false "+ 285 | // "--es Contact_ChatRoomId \"636235605@chatroom\" "+ 286 | // "--es room_name \"636235605@chatroom\" "+ 287 | "--ez Is_RoomOwner false "+ 288 | // "--es Contact_RoomNickname \"蔡建\" "+ 289 | "--es Contact_User \""+v1+"\" "+ 290 | "--ei Contact_Scene "+ scene +" "+ 291 | "--ez Contact_NeedShowChangeSnsPreButton false "+ 292 | ""; 293 | try { 294 | Runtime.getRuntime().exec(s); 295 | } catch (IOException e) { 296 | e.printStackTrace(); 297 | } 298 | }else if (scene == 30) {// 通过扫一扫 299 | //I/set ( 1517): bundle = Bundle[{Contact_NeedShowChangeRemarkButton=false, Contact_QuanPin=wxidqxve6fsx4ery12, 300 | // Contact_PyInitial=WXIDQXVE6FSX4ERY12, Contact_RegionCode=CN_Guangdong_Guangzhou, 301 | // Contact_BrandList=, Contact_KSnsBgId=0, Contact_IsLBSFriend=true, 302 | // Contact_KWeiboNick=null, Contact_KSnsBgUrl=null, Contact_KSnsIFlag=0, Contact_KWeibo_flag=0, 303 | // Contact_Signature=宅若久时天然呆, 呆到深处自然萌, Contact_BIZ_KF_WORKER_ID=null, Contact_VUser_Info=null, 304 | // Contact_KHideExpose=true, Contact_Nick=雯雯, 305 | // Contact_User=v1_4b6ece89d367aed49ce765008cd11b297b3c3836bbc71c70ad71dc3e5da1b2359ee868dfe958ef76121ce676f53ab246@stranger, 306 | // Contact_VUser_Info_Flag=0, Contact_Sex=2, Contact_Alias=aa15596417033, Contact_Scene=30, Contact_KWeibo=null, 307 | // AntispamTicket=v2_973dea324a20f5da3d5de134c8c725d768ffb73ba1ec057d61c89f3140fb128e211dd1239af7f458ef7d20df144fcc76@stranger, 308 | // Contact_NeedShowChangeSnsPreButton=false}] 309 | String s = "adb shell am start -n com.tencent.mm/com.tencent.mm.plugin.profile.ui.ContactInfoUI "+ 310 | "--ez Contact_NeedShowChangeRemarkButton false "+ 311 | "--es Contact_QuanPin \""+py+"\" "+ 312 | "--es Contact_PyInitial \""+upper+"\" "+ 313 | "--es Contact_BrandList \"\" "+ 314 | "--ei Contact_KSnsBgId 0 "+ 315 | "--ez Contact_IsLBSFriend true "+ 316 | "--es Contact_KWeiboNick \"null\" "+ 317 | "--es Contact_KSnsBgUrl \"null\" "+ 318 | "--ei Contact_KSnsIFlag 0 "+ 319 | "--ei Contact_KWeibo_flag 0 "+ 320 | "--es Contact_Signature \"null\" "+ 321 | "--es Contact_BIZ_KF_WORKER_ID \"null\" "+ 322 | "--es Contact_VUser_Info \"null\" "+ 323 | "--ez Contact_KHideExpose true "+ 324 | "--es Contact_User \""+v1+"\" "+ 325 | "--ei Contact_VUser_Info_Flag 0 "+ 326 | "--ei Contact_Scene "+ scene +" "+ 327 | "--es Contact_KWeibo \"null\" "+ 328 | "--ez Contact_NeedShowChangeSnsPreButton false "+ 329 | ""; 330 | try { 331 | Runtime.getRuntime().exec(s); 332 | } catch (IOException e) { 333 | e.printStackTrace(); 334 | } 335 | } 336 | } 337 | 338 | } 339 | 340 | 341 | // 自动生成9位数的字符串 342 | static String getRandom(){ 343 | Double random = Math.random(); 344 | String str = random.toString().substring(2,11); 345 | return str; 346 | } 347 | public static void addFriendByWxid(Context context,String wxid,int scene,String tuiWxid,String tuiNickName,String RemarkName){ 348 | Intent params = new Intent(); 349 | params.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 350 | params.setClassName(context, "com.tencent.mm.plugin.profile.ui.SayHiWithSnsPermissionUI"); 351 | params.putExtra("sayhi_with_sns_perm_send_verify", true); 352 | params.putExtra("room_name", "null"); 353 | params.putExtra("source_from_user_name", tuiWxid); 354 | params.putExtra("sayhi_with_sns_perm_add_remark", true); 355 | params.putExtra("source_from_nick_name", tuiNickName); 356 | params.putExtra("Contact_Nick", ""); 357 | params.putExtra("Contact_User", wxid); 358 | params.putExtra("Contact_Scene", scene); 359 | params.putExtra("Contact_RemarkName", RemarkName); 360 | params.putExtra("sayhi_with_sns_perm_set_label", false); 361 | context.startActivity(params); 362 | } 363 | } 364 | -------------------------------------------------------------------------------- /app/src/main/java/com/specher/superhookbox/XConfig.java: -------------------------------------------------------------------------------- 1 | package com.specher.superhookbox; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.app.Application; 5 | import android.content.AttributionSource; 6 | import android.content.Context; 7 | import android.content.SharedPreferences; 8 | import android.os.Environment; 9 | import android.preference.Preference; 10 | import android.util.Log; 11 | import android.widget.Toast; 12 | 13 | import androidx.annotation.Nullable; 14 | 15 | import com.specher.superhookbox.BuildConfig; 16 | import com.specher.superhookbox.Utils; 17 | 18 | import org.json.JSONException; 19 | import org.json.JSONObject; 20 | 21 | import java.io.BufferedReader; 22 | import java.io.File; 23 | import java.io.FileInputStream; 24 | import java.io.FileOutputStream; 25 | import java.io.InputStreamReader; 26 | import java.util.Iterator; 27 | import java.util.Map; 28 | import java.util.Objects; 29 | import java.util.Set; 30 | 31 | import de.robv.android.xposed.XSharedPreferences; 32 | 33 | public class XConfig { 34 | 35 | private int count=0; 36 | private static final String tiktokShow = "支持版本:28.8.0(280801)"; 37 | private static final String telegramShow = 38 | "阻止删除消息重新打开聊天界面删除的消息即会出现。\n" + 39 | "支持版本:Telegram官方版/Beta版/科学版/TG Plus/Nekogram/Nekogram X"; 40 | private static final String macroShow = "小米自动连招黑名单解除\n" + 41 | "支持版本:手机管家5.4.4-210722.0.3/5.6.3-211109.0.2\n" + "红魔自动连招黑名单解除\n" + 42 | "有封号风险,谨慎使用,自行承担后果。"; 43 | 44 | private static final String configName_tiktok = "tiktok.json"; 45 | private static final String configName_tg = "Telegram.json"; 46 | private static final String configName_hookbox = "HookBox.json"; 47 | private static final String configName_macro = "MiMacro.json"; 48 | 49 | public String prefFilename; 50 | public JSONObject globalJSON = new JSONObject(); 51 | public static String isTikTok = "开启抖X功能"; 52 | public String isAutoPlay = "自动播放下一条"; 53 | public String isAutoPlayC = "评论打开时不自动播放下一条"; 54 | public String downLoadVideo = "无水印下载"; 55 | public String isFullScreen = "去除视频黑边"; 56 | public String isJumpSplashAd = "跳过启动广告"; 57 | public String isCommentDark = "评论暗黑模式"; 58 | public String jumpAD = "跳过视频广告"; 59 | public String jumpLive = "跳过直播"; 60 | public String jumpADTip = "跳过广告时提示"; 61 | public String hideRightMenu = "全屏时隐藏右侧按钮"; 62 | public String hideAwemeIntro = "全屏时隐藏文字"; 63 | public String fullVideoPlay = "长按切换全屏模式"; 64 | public String hideStatusBar = "全屏时隐藏状态栏"; 65 | public String hideBottomTab = "全屏时隐藏底栏"; 66 | public String hideTopTab = "全屏时隐藏顶栏"; 67 | public static String isTelegram = "开启Telegram功能"; 68 | public String unRecalled = "阻止删除消息"; 69 | public String unDelete = "阻止消息自毁(阅后即焚)"; 70 | 71 | public String isPremium = "本地Premium"; 72 | public static String isHookBox = "开启HookBox"; 73 | public static String isMiMacro = "开启自动连招"; 74 | public String macroPatch = "自动连招限制解除"; 75 | public String isFirst = "首次启动"+ BuildConfig.VERSION_CODE; 76 | 77 | private Context mContext=null; 78 | 79 | public SharedPreferences pref ; 80 | @SuppressLint("WorldReadableFiles") 81 | public XConfig(Context context, String prefFilename) throws Exception { 82 | 83 | this.prefFilename = prefFilename; 84 | mContext = context; 85 | initPref(context); 86 | 87 | 88 | } 89 | 90 | 91 | private static XSharedPreferences getPref(String path) { 92 | XSharedPreferences pref = new XSharedPreferences(BuildConfig.APPLICATION_ID, path); 93 | return pref.getFile().canRead() ? pref : null; 94 | } 95 | 96 | 97 | public static String getConfigName(String optionName){ 98 | if(optionName.equals(isTikTok)){ 99 | return configName_tiktok; 100 | }else if(optionName.equals(isTelegram)){ 101 | return configName_tg; 102 | }else if(optionName.equals(isHookBox)) { 103 | return configName_hookbox; 104 | }else if (optionName.equals(isMiMacro)){ 105 | return configName_macro; 106 | }else{ 107 | return null; 108 | } 109 | } 110 | public String getShow(String optionName){ 111 | if(optionName.equals(isTikTok)){ 112 | return tiktokShow; 113 | }if(optionName.equals(isTelegram)){ 114 | return telegramShow; 115 | }if(optionName.equals(isMiMacro)){ 116 | return macroShow; 117 | }else return null; 118 | } 119 | 120 | public JSONObject readPref() throws Exception { 121 | 122 | String JsonStr = pref.getString(prefFilename,null); 123 | this.globalJSON=new JSONObject(JsonStr); 124 | return this.globalJSON; 125 | 126 | } 127 | 128 | public void writePref(JSONObject json) throws Exception { 129 | JSONObject oldJson = this.globalJSON; 130 | Iterator keys = json.keys(); 131 | while (keys.hasNext()) { 132 | String tmp = keys.next(); 133 | oldJson.put(tmp, json.getBoolean(tmp)); 134 | } 135 | pref.edit().putString(prefFilename,oldJson.toString()).apply(); 136 | } 137 | 138 | 139 | public String getOption(int index) throws JSONException { 140 | return this.globalJSON.names().get(index).toString(); 141 | } 142 | 143 | public int getOptionLength() { 144 | return this.globalJSON.length(); 145 | } 146 | 147 | public String[] getOptions() throws JSONException { 148 | String[] arr = new String[getOptionLength()]; 149 | for (int i = 0; i < getOptionLength(); i++) { 150 | arr[i] = globalJSON.names().get(i).toString(); 151 | Log.i("test", arr[i]); 152 | } 153 | return arr; 154 | } 155 | 156 | @SuppressLint("WorldReadableFiles") 157 | private void initPref(Context context) throws Exception { 158 | 159 | switch (prefFilename) { 160 | case configName_tiktok: 161 | this.globalJSON.put(this.isJumpSplashAd, false); 162 | this.globalJSON.put(this.jumpAD, false); 163 | this.globalJSON.put(this.jumpADTip, false); 164 | this.globalJSON.put(this.fullVideoPlay, false); 165 | this.globalJSON.put(this.hideStatusBar, false); 166 | break; 167 | case configName_tg: 168 | this.globalJSON.put(this.isPremium, false); 169 | this.globalJSON.put(this.unRecalled, false); 170 | this.globalJSON.put(this.unDelete, false); 171 | break; 172 | case configName_hookbox: 173 | this.globalJSON.put(isTikTok, false); 174 | this.globalJSON.put(isTelegram, false); 175 | this.globalJSON.put(isMiMacro,false); 176 | this.globalJSON.put(this.isFirst, true); 177 | break; 178 | case configName_macro: 179 | this.globalJSON.put(macroPatch,false); 180 | break; 181 | 182 | } 183 | 184 | if(context.getPackageName().equals(BuildConfig.APPLICATION_ID)) { 185 | pref = context.getSharedPreferences(prefFilename, Context.MODE_WORLD_READABLE); 186 | } 187 | else { 188 | pref = getPref(prefFilename); 189 | } 190 | 191 | if(pref.getString(prefFilename,null) == null) { 192 | //初始化设置 193 | pref.edit().putString(prefFilename, this.globalJSON.toString()).apply(); 194 | } 195 | 196 | //检查配置文件是否正常 197 | Iterator keys = this.globalJSON.keys(); 198 | try{ 199 | while (keys.hasNext()) { 200 | if (!readPref().has(keys.next())) { 201 | //配置文件有变化或者错误 202 | count++; 203 | if(count>2){ 204 | Utils.exitApp(mContext); 205 | }else{ 206 | Toast.makeText(mContext,"配置文件有更新,请重新配置。",Toast.LENGTH_SHORT).show(); 207 | pref.edit().clear().apply(); 208 | initPref(context); 209 | } 210 | } 211 | } 212 | keys = this.readPref().keys(); 213 | JSONObject temp=this.globalJSON; 214 | while (keys.hasNext()) { 215 | if (!temp.has(keys.next())) { 216 | //配置文件有变化或者错误 217 | count++; 218 | if(count>2){ 219 | Utils.exitApp(mContext); 220 | }else{ 221 | Toast.makeText(mContext,"配置文件有更新,请重新配置。",Toast.LENGTH_SHORT).show(); 222 | pref.edit().clear().apply(); 223 | initPref(context); 224 | } 225 | } 226 | } 227 | 228 | } 229 | catch(Exception e){ 230 | Log.i("HookBox", Objects.requireNonNull(e.getMessage())); 231 | Toast.makeText(mContext,"读取配置异常,请检查是否给与全部文件读写权限。"+ e,Toast.LENGTH_LONG).show(); 232 | count++; 233 | if(count>2){ 234 | Utils.exitApp(mContext); 235 | }else{ 236 | pref.edit().putString(prefFilename,null).apply(); 237 | pref.edit().remove(prefFilename).apply(); 238 | pref.edit().clear().apply(); 239 | initPref(context); 240 | } 241 | } 242 | } 243 | 244 | 245 | 246 | } 247 | -------------------------------------------------------------------------------- /app/src/main/java/com/specher/superhookbox/activity/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.specher.superhookbox.activity; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.app.AlertDialog; 5 | import android.content.DialogInterface; 6 | import android.content.pm.PackageInfo; 7 | import android.content.pm.PackageManager; 8 | import android.os.Bundle; 9 | import android.os.Handler; 10 | import android.os.Message; 11 | import android.text.Html; 12 | import android.text.method.LinkMovementMethod; 13 | import android.util.Log; 14 | import android.view.Menu; 15 | import android.view.MenuItem; 16 | import android.view.View; 17 | import android.widget.Button; 18 | import android.widget.CheckBox; 19 | import android.widget.CompoundButton; 20 | import android.widget.LinearLayout; 21 | import android.widget.ScrollView; 22 | import android.widget.TextView; 23 | import android.widget.Toast; 24 | 25 | import androidx.annotation.NonNull; 26 | import androidx.appcompat.app.AppCompatActivity; 27 | 28 | import com.specher.superhookbox.R; 29 | import com.specher.superhookbox.Utils; 30 | import com.specher.superhookbox.XConfig; 31 | 32 | import org.json.JSONException; 33 | import org.json.JSONObject; 34 | 35 | import java.util.Iterator; 36 | 37 | 38 | public class MainActivity extends AppCompatActivity { 39 | 40 | private XConfig config, mConfig; 41 | View.OnClickListener button_click = new View.OnClickListener() { 42 | @Override 43 | public void onClick(View v) { 44 | try { 45 | final String what = config.getOption((int) v.getTag()); 46 | Log.i(Utils.TAG, "打开设置"); 47 | final AlertDialog.Builder builder = new AlertDialog.Builder(v.getContext()); 48 | mConfig = new XConfig(MainActivity.this.getApplication(), XConfig.getConfigName(what)); 49 | builder.setTitle(what.replace("开启","")+"插件设置"); 50 | boolean[] checkItems = new boolean[mConfig.getOptionLength()]; 51 | try { 52 | mChecks = mConfig.readPref(); 53 | Iterator keys = mChecks.keys(); 54 | int i = 0; 55 | while (keys.hasNext()) { 56 | checkItems[i] = mChecks.getBoolean(keys.next()); 57 | i++; 58 | } 59 | } catch (Exception e) { 60 | e.printStackTrace(); 61 | } 62 | builder.setCancelable(false); 63 | builder.setMultiChoiceItems(mConfig.getOptions(), checkItems, new DialogInterface.OnMultiChoiceClickListener() { 64 | public void onClick(DialogInterface dialog, int which, boolean isChecked) { 65 | try { 66 | mChecks.put(mConfig.getOption(which), isChecked); 67 | } catch (Exception e) { 68 | e.printStackTrace(); 69 | } 70 | 71 | } 72 | }); 73 | 74 | builder.setPositiveButton("保存", new DialogInterface.OnClickListener() { 75 | public void onClick(DialogInterface dialog, int which) { 76 | try { 77 | mConfig.writePref(mChecks); 78 | Toast.makeText(MainActivity.this, "部分功能需重启APP才会生效", Toast.LENGTH_SHORT).show(); 79 | dialog.dismiss(); 80 | } catch (Exception e) { 81 | e.printStackTrace(); 82 | } 83 | 84 | } 85 | }); 86 | builder.setNegativeButton("取消", null); 87 | builder.setNeutralButton("说明", null); 88 | AlertDialog alertDialog = builder.create(); 89 | alertDialog.show(); 90 | alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL).setOnClickListener(new View.OnClickListener() { 91 | @Override 92 | public void onClick(View v) { 93 | final AlertDialog alertDialog = new AlertDialog.Builder(v.getContext()).setPositiveButton("确定", null).create(); 94 | alertDialog.setTitle("说明"); 95 | alertDialog.setMessage(config.getShow(what)); 96 | alertDialog.show(); 97 | } 98 | }); 99 | } catch (Exception e) { 100 | e.printStackTrace(); 101 | } 102 | } 103 | }; 104 | private JSONObject checks, mChecks; 105 | @SuppressLint("HandlerLeak") 106 | private final Handler mHandler = new Handler() { 107 | public void handleMessage(@NonNull Message msg) { 108 | super.handleMessage(msg); 109 | try { 110 | checks.put(config.isFirst, false); 111 | config.writePref(checks); 112 | } catch (Exception e) { 113 | e.printStackTrace(); 114 | } 115 | } 116 | }; 117 | CompoundButton.OnCheckedChangeListener checkbox_click = new CompoundButton.OnCheckedChangeListener() { 118 | @Override 119 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 120 | try { 121 | if(!checks.getBoolean(config.isFirst)) { 122 | checks.put(config.getOption((int) buttonView.getTag()), isChecked); 123 | config.writePref(checks); 124 | } 125 | } catch (Exception e) { 126 | e.printStackTrace(); 127 | } 128 | 129 | } 130 | }; 131 | 132 | @Override 133 | protected void onCreate(Bundle savedInstanceState) { 134 | super.onCreate(savedInstanceState); 135 | setContentView(R.layout.activity_main); 136 | try { 137 | initView(); 138 | } catch (Exception e) { 139 | e.printStackTrace(); 140 | } 141 | } 142 | 143 | @Override 144 | public boolean onCreateOptionsMenu(Menu menu) { 145 | getMenuInflater().inflate(R.menu.menu, menu); 146 | return super.onCreateOptionsMenu(menu); 147 | } 148 | 149 | private void showAbout() throws PackageManager.NameNotFoundException, JSONException { 150 | PackageManager pm = getPackageManager(); 151 | PackageInfo pi = pm.getPackageInfo(getPackageName(), 0);//getPackageName()是你当前类的包名,0代表是获取版本信息 152 | String name = pi.versionName; 153 | 154 | final AlertDialog.Builder builder = new AlertDialog.Builder(this); 155 | builder.setTitle("说明"); 156 | ScrollView scrollView = new ScrollView(this); 157 | TextView textView = new TextView(this); 158 | textView.setPadding(48, 48, 48, 48); 159 | textView.setText(Html.fromHtml("

HookBox" + name + " 个人常用Xposed功能集合模块

" + 160 | "

Specher制作 E-mail:Specher@qq.com

" + 161 | "

获取更新/反馈请加TG频道:@HookBox

" + 162 | "

GitHub开源:@SuperHookBox

" + 163 | "

免责声明及使用协议:

此软件是免费软件,仅供学习交流,严禁用于商业用途或传播,否则后果自负。
若用户利用本软件从事任何违法或侵权行为,由用户自行承担全部责任。本软件作者不承担任何法律及连带责任。因此给作者或任何第三方造成的任何损失,用户应负责全额赔偿。

")); 164 | textView.setMovementMethod(LinkMovementMethod.getInstance()); 165 | final CheckBox checkBox = new CheckBox(this); 166 | checkBox.setText("我已阅读并同意该协议"); 167 | LinearLayout linearLayout = new LinearLayout(this); 168 | linearLayout.setOrientation(LinearLayout.VERTICAL); 169 | linearLayout.addView(textView); 170 | linearLayout.addView(checkBox); 171 | scrollView.addView(linearLayout); 172 | builder.setView(scrollView); 173 | builder.setCancelable(false); 174 | builder.setPositiveButton("确认", null); 175 | if(checks.getBoolean(config.isFirst)) { 176 | builder.setNeutralButton("拒绝", null); 177 | } 178 | final AlertDialog alertDialog = builder.create(); 179 | alertDialog.show(); 180 | if(!checks.getBoolean(config.isFirst)){ 181 | checkBox.setChecked(true); 182 | checkBox.setText("您已同意该协议"); 183 | checkBox.setClickable(false); 184 | }else{ 185 | alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL).setOnClickListener(new View.OnClickListener() { 186 | @Override 187 | public void onClick(View v) { 188 | Toast.makeText(MainActivity.this, "由于您拒绝了协议,无法继续使用本软件。", Toast.LENGTH_LONG).show(); 189 | alertDialog.dismiss(); 190 | MainActivity.this.finish(); 191 | } 192 | }); 193 | } 194 | 195 | alertDialog.getButton(DialogInterface.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() { 196 | @Override 197 | public void onClick(View v) { 198 | if(checkBox.isChecked()) { 199 | Message msg = mHandler.obtainMessage(); 200 | msg.what = 1; 201 | mHandler.sendMessage(msg); 202 | alertDialog.dismiss(); 203 | }else{ 204 | Toast.makeText(MainActivity.this,"请阅读协议并勾选同意后方可使用本软件",Toast.LENGTH_LONG).show(); 205 | 206 | } 207 | } 208 | }); 209 | 210 | } 211 | 212 | 213 | @SuppressLint("NonConstantResourceId") 214 | @Override 215 | public boolean onOptionsItemSelected(@NonNull MenuItem item) { 216 | int itemId = item.getItemId(); 217 | switch (itemId) { 218 | case R.id.about: 219 | try { 220 | showAbout(); 221 | } catch (Exception e) { 222 | e.printStackTrace(); 223 | } 224 | break; 225 | case R.id.exit: 226 | this.finish(); 227 | break; 228 | 229 | } 230 | 231 | return super.onOptionsItemSelected(item); 232 | } 233 | 234 | @Override 235 | protected void onResume() { 236 | if(config!=null){ 237 | try { 238 | checks = config.readPref(); 239 | } catch (Exception e) { 240 | e.printStackTrace(); 241 | } 242 | } 243 | super.onResume(); 244 | } 245 | 246 | void initView() throws Exception { 247 | config = new XConfig(MainActivity.this.getApplication(), XConfig.getConfigName(XConfig.isHookBox)); 248 | checks = config.readPref(); 249 | boolean[] checkItems = new boolean[config.getOptionLength()]; 250 | LinearLayout root = findViewById(R.id.linearlayout); 251 | CheckBox[] checkBoxs = new CheckBox[config.getOptionLength()]; 252 | Button[] buttons = new Button[config.getOptionLength()]; 253 | if (checks.getBoolean(config.isFirst)) { 254 | showAbout(); 255 | } 256 | try { 257 | Iterator keys = checks.keys(); 258 | int i = 0; 259 | while (keys.hasNext()) { 260 | String title = keys.next(); 261 | if (title.equals(config.isFirst)) { 262 | continue; 263 | } 264 | LinearLayout tmp = new LinearLayout(this); 265 | LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); 266 | tmp.setLayoutParams(layoutParams); 267 | tmp.setOrientation(LinearLayout.HORIZONTAL); 268 | LinearLayout.LayoutParams m_layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); 269 | checkBoxs[i] = new CheckBox(this); 270 | buttons[i] = new Button(this); 271 | buttons[i].setText("设置"); 272 | buttons[i].setTag(i); 273 | buttons[i].setLayoutParams(m_layoutParams); 274 | buttons[i].setOnClickListener(button_click); 275 | checkBoxs[i].setText(title); 276 | checkBoxs[i].setLayoutParams(m_layoutParams); 277 | checkItems[i] = checks.getBoolean(title); 278 | checkBoxs[i].setChecked(checkItems[i]); 279 | checkBoxs[i].setTag(i); 280 | checkBoxs[i].setOnCheckedChangeListener(checkbox_click); 281 | tmp.addView(checkBoxs[i]); 282 | tmp.addView(buttons[i]); 283 | root.addView(tmp); 284 | Log.i("test", title + "=" + checks.getBoolean(title)); 285 | i++; 286 | } 287 | } catch (Exception e) { 288 | e.printStackTrace(); 289 | } 290 | } 291 | 292 | } -------------------------------------------------------------------------------- /app/src/main/java/com/specher/superhookbox/hook/BaseHook.java: -------------------------------------------------------------------------------- 1 | package com.specher.superhookbox.hook; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 7 | 8 | public class BaseHook { 9 | 10 | 11 | public void hook(Context context, final XC_LoadPackage.LoadPackageParam loadPackageParam){ 12 | 13 | } 14 | 15 | 16 | 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/specher/superhookbox/hook/Hook.java: -------------------------------------------------------------------------------- 1 | package com.specher.superhookbox.hook; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import com.specher.superhookbox.Utils; 7 | import com.specher.superhookbox.XConfig; 8 | 9 | import org.json.JSONObject; 10 | 11 | import de.robv.android.xposed.IXposedHookLoadPackage; 12 | import de.robv.android.xposed.XC_MethodHook; 13 | import de.robv.android.xposed.XSharedPreferences; 14 | import de.robv.android.xposed.XposedBridge; 15 | import de.robv.android.xposed.XposedHelpers; 16 | import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam; 17 | 18 | public class Hook implements IXposedHookLoadPackage { 19 | private XConfig config; 20 | private JSONObject pref; 21 | private Context context; 22 | 23 | public void handleLoadPackage(final LoadPackageParam loadPackageParam) throws Throwable { 24 | String packageName = loadPackageParam.packageName; 25 | String processName = loadPackageParam.processName; 26 | if (isTelegramPackage(packageName)) { 27 | hookApplicationAttach(loadPackageParam, XConfig.isTelegram, new Telegram()); 28 | } 29 | if (processName.equals("com.ss.android.ugc.aweme")) { 30 | hookApplicationAttach(loadPackageParam, XConfig.isTikTok, new Tiktok()); 31 | } 32 | if (packageName.equals("com.miui.securitycenter")) { 33 | hookApplicationAttach(loadPackageParam, XConfig.isMiMacro, new MiMacro()); 34 | // context = (Context) XposedHelpers.callMethod(XposedHelpers.callStaticMethod(XposedHelpers.findClass("android.app.ActivityThread", null), "currentActivityThread"), "getSystemContext"); 35 | 36 | } 37 | if (isNubiaPackage(packageName)) { 38 | hookApplicationAttach(loadPackageParam, null, new Nubia()); 39 | } 40 | if (packageName.equals("com.tencent.mm")) { 41 | hookApplicationAttach(loadPackageParam, null, new WeChat()); 42 | } 43 | if (packageName.equals("com.quark.browser")) { 44 | hookApplicationAttach(loadPackageParam, null, new Quark()); 45 | } 46 | } 47 | 48 | private boolean isTelegramPackage(String packageName) { 49 | return packageName.equals("org.telegram.messenger") || packageName.equals("org.telegram.messenger.web") || 50 | packageName.equals("org.telegram.plus") || packageName.equals("nekox.messenger") || 51 | packageName.equals("org.telegram.messengers") || packageName.equals("org.telegram.messenger.beta") || 52 | packageName.equals("tw.nekomimi.nekogram"); 53 | } 54 | 55 | 56 | private boolean isNubiaPackage(String packageName) { 57 | return packageName.equals("cn.nubia.gamelauncher") || packageName.equals("cn.nubia.gamehelpmodule") || 58 | packageName.equals("cn.nubia.gameassist"); 59 | } 60 | 61 | private void hookApplicationAttach(final LoadPackageParam loadPackageParam, String configKey, Object hookInstanceSupplier) { 62 | XposedHelpers.findAndHookMethod(Application.class, "attach", Context.class, new XC_MethodHook() { 63 | @Override 64 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 65 | super.afterHookedMethod(param); 66 | if (context == null) { 67 | context = (Context) param.args[0]; 68 | if (config == null) { 69 | config = new XConfig(context, XConfig.getConfigName(XConfig.isHookBox)); 70 | pref = config.readPref(); 71 | if (configKey==null || pref.getBoolean(configKey)) { 72 | XposedHelpers.callMethod(hookInstanceSupplier,"hook",context, loadPackageParam); 73 | } 74 | } 75 | } 76 | } 77 | }); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/com/specher/superhookbox/hook/MiMacro.java: -------------------------------------------------------------------------------- 1 | package com.specher.superhookbox.hook; 2 | 3 | 4 | import android.annotation.SuppressLint; 5 | import android.content.Context; 6 | import android.os.Build; 7 | import android.view.WindowManager; 8 | 9 | import androidx.annotation.RequiresApi; 10 | 11 | import com.specher.superhookbox.Utils; 12 | import com.specher.superhookbox.XConfig; 13 | 14 | import org.json.JSONObject; 15 | import org.luckypray.dexkit.DexKitBridge; 16 | import org.luckypray.dexkit.query.FindClass; 17 | import org.luckypray.dexkit.query.FindMethod; 18 | import org.luckypray.dexkit.query.matchers.ClassMatcher; 19 | import org.luckypray.dexkit.query.matchers.FieldMatcher; 20 | import org.luckypray.dexkit.query.matchers.FieldsMatcher; 21 | import org.luckypray.dexkit.query.matchers.MethodMatcher; 22 | import org.luckypray.dexkit.query.matchers.MethodsMatcher; 23 | import org.luckypray.dexkit.result.ClassData; 24 | import org.luckypray.dexkit.result.ClassDataList; 25 | import org.luckypray.dexkit.result.MethodData; 26 | import org.luckypray.dexkit.result.MethodDataList; 27 | 28 | import java.lang.reflect.Modifier; 29 | 30 | import de.robv.android.xposed.XC_MethodHook; 31 | import de.robv.android.xposed.XC_MethodReplacement; 32 | import de.robv.android.xposed.XposedBridge; 33 | import de.robv.android.xposed.XposedHelpers; 34 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 35 | 36 | public class MiMacro { 37 | private XConfig config; 38 | private JSONObject pref; 39 | //private String TargetClassName; 40 | //小米手机管家.apk 搜索关键字定位TargetClassName 41 | // static { 42 | // a.add("com.tencent.tmgp.sgame"); 43 | // c.add("com.tencent.tmgp.pubgmhd"); 44 | // c.add("com.tencent.tmgp.cf"); 45 | // c.add("com.tencent.tmgp.cod"); 46 | // c.add("com.tencent.tmgp.codty"); 47 | // c.add("com.tencent.af"); 48 | // c.add("com.netease.hyxd.mi"); 49 | // c.add("com.netease.mrzh.mi"); 50 | // c.add("com.netease.hyxd"); 51 | // c.add("com.netease.mrzh"); 52 | // } 53 | //或者定位到com.miui.gamebooster.model.ActiveNewModel的isSupportFunction方法里调用 54 | // public static boolean g(Context context, String str, boolean z10) { 55 | // return !(x.c() && x.b(context)) && e(z10) && !t0.h(str) && b2.x(context); 56 | // } 57 | 58 | static { 59 | System.loadLibrary("dexkit"); 60 | } 61 | 62 | public void hook(Context context, final XC_LoadPackage.LoadPackageParam loadPackageParam) throws Exception { 63 | Utils.log("MiMacro loaded"); 64 | config = new XConfig(context, XConfig.getConfigName(XConfig.isMiMacro)); 65 | pref = config.readPref(); 66 | //TargetClassName="s7.n0";//8.1.6-230915.0.3 public static boolean g(String str) 67 | //TargetClassName="y7.t0";//9.0.3-240603.0.1 public static boolean h(String str) 68 | //XposedHelpers.findAndHookMethod(TargetClassName, loadPackageParam.classLoader,"g",String.class, XC_MethodReplacement.returnConstant(false)); 69 | // if(versionCode>=40000614){ 70 | // TargetClassName="com.miui.gamebooster.v.i0";//6.1.4-220509.0.2 71 | // } 72 | // else if (versionCode>=40000605){ 73 | // TargetClassName="com.miui.gamebooster.v.i0";//6.0.5-220217.0.2 74 | // }else if(versionCode>=30000563){// 75 | // TargetClassName="com.miui.gamebooster.v.h0";//5.6.3-211109.0.2 76 | // }else if(versionCode>=30000546){ 77 | // TargetClassName="com.miui.gamebooster.s.e0";//5.4.6-210805.0.3 78 | // }else if(versionCode>=30000544){ 79 | // TargetClassName="com.miui.gamebooster.t.e0";//5.4.4-210722.0.3 80 | // } 81 | 82 | if(pref.getBoolean(config.macroPatch)) { 83 | Utils.log("xiaomi.macro loaded."); 84 | String apkPath = loadPackageParam.appInfo.sourceDir; 85 | 86 | try (DexKitBridge bridge = DexKitBridge.create(apkPath)) { 87 | //findMiMacroClassTest(bridge); 88 | ClassData classData = findMiMacroClass(bridge); 89 | Class clazz = classData.getInstance(loadPackageParam.classLoader); 90 | MethodDataList methodDataList = findMimacroMethod(classData); 91 | 92 | for (MethodData methodData : methodDataList) { 93 | Utils.log("小米连招判断类:"+methodData.getClassName()+"方法名:"+methodData.getMethodName()); 94 | XposedBridge.hookAllMethods(clazz, methodData.getMethodName(), XC_MethodReplacement.returnConstant(false)); 95 | } 96 | } catch (Exception e) { 97 | throw new RuntimeException(e); 98 | } 99 | 100 | // //防录屏,没有效果,还在研究中。。。可能需要Hook系统框架? 101 | // Class layoutParamsClass = XposedHelpers.findClass("android.view.WindowManager$LayoutParams", loadPackageParam.classLoader); 102 | // XposedBridge.hookAllConstructors(layoutParamsClass, new XC_MethodHook() { 103 | // @Override 104 | // protected void afterHookedMethod(MethodHookParam param) throws Throwable { 105 | // super.afterHookedMethod(param); 106 | // int flags = XposedHelpers.getIntField( param.thisObject,"flags"); 107 | // Utils.log( "Original flags: " + flags); 108 | // flags |= 4392; 109 | // // 修改 LayoutParams 中的 flags 110 | // XposedHelpers.setIntField(param.thisObject,"flags",flags); 111 | // Utils.log( "Modified flags: " + flags); 112 | // } 113 | // }); 114 | 115 | } 116 | 117 | } 118 | 119 | private MethodDataList findMimacroMethod(ClassData classData) { 120 | return classData.findMethod(FindMethod.create() 121 | .matcher(MethodMatcher.create() 122 | .returnType(boolean.class) 123 | .paramCount(1) 124 | ) 125 | ); 126 | } 127 | 128 | private ClassData findMiMacroClass(DexKitBridge bridge) { 129 | ClassData classData = bridge.findClass(FindClass.create() 130 | // 指定搜索的包名范围 131 | .matcher(ClassMatcher.create() 132 | // FieldsMatcher 针对类中包含字段的匹配器 133 | .fields(FieldsMatcher.create() 134 | // 添加对于字段的匹配器 135 | .add(FieldMatcher.create() 136 | // 指定字段的修饰符 137 | .modifiers(Modifier.PRIVATE) 138 | // 指定字段的类型 139 | .type("java.util.List") 140 | ) 141 | ) 142 | // MethodsMatcher 针对类中包含方法的匹配器 143 | .methods(MethodsMatcher.create() 144 | // 指定类中方法的数量,最少不少于1个,最多不超过10个 145 | .count(10, 20) 146 | 147 | ) 148 | // 类中所有方法使用的字符串 149 | .usingStrings("com.tencent.tmgp.sgame", "com.tencent.tmgp.pubgmhd","pref_gb_unsupport_macro_apps","com.xiaomi.macro") 150 | .superClass("java.lang.Object") 151 | ) 152 | ).singleOrThrow(() -> new IllegalStateException("返回结果不唯一")); 153 | return classData; 154 | } 155 | 156 | 157 | // private void findMiMacroClassTest(DexKitBridge bridge) { 158 | // ClassDataList classDataList = bridge.findClass(FindClass.create() 159 | // // 指定搜索的包名范围 160 | // .matcher(ClassMatcher.create() 161 | // // FieldsMatcher 针对类中包含字段的匹配器 162 | // .fields(FieldsMatcher.create() 163 | // // 添加对于字段的匹配器 164 | // .add(FieldMatcher.create() 165 | // // 指定字段的修饰符 166 | // .modifiers(Modifier.PRIVATE) 167 | // // 指定字段的类型 168 | // .type("java.util.List") 169 | // ) 170 | // ) 171 | // // MethodsMatcher 针对类中包含方法的匹配器 172 | // .methods(MethodsMatcher.create() 173 | // // 指定类中方法的数量,最少不少于1个,最多不超过10个 174 | // .count(10, 20) 175 | // 176 | // ) 177 | // // 类中所有方法使用的字符串 178 | // .usingStrings("com.tencent.tmgp.sgame", "com.tencent.tmgp.pubgmhd","pref_gb_unsupport_macro_apps","com.xiaomi.macro") 179 | // .superClass("java.lang.Object") 180 | // ) 181 | // ); 182 | // 183 | // if(classDataList.isEmpty()){ 184 | // Utils.log("没有找到小米连招类。"); 185 | // } 186 | // 187 | // for(ClassData classData : classDataList){ 188 | // Utils.log("小米找到连招类:"+classData.getName()); 189 | // } 190 | // } 191 | } 192 | -------------------------------------------------------------------------------- /app/src/main/java/com/specher/superhookbox/hook/Nubia.java: -------------------------------------------------------------------------------- 1 | package com.specher.superhookbox.hook; 2 | 3 | import android.content.Context; 4 | import android.os.BaseBundle; 5 | import android.text.InputFilter; 6 | import android.view.View; 7 | import android.widget.EditText; 8 | import android.widget.SeekBar; 9 | 10 | import com.specher.superhookbox.Utils; 11 | import com.specher.superhookbox.XConfig; 12 | 13 | import org.json.JSONObject; 14 | 15 | import de.robv.android.xposed.XC_MethodHook; 16 | import de.robv.android.xposed.XposedHelpers; 17 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 18 | 19 | public class Nubia { 20 | private XConfig config; 21 | private JSONObject pref; 22 | 23 | 24 | public void hook(Context context, final XC_LoadPackage.LoadPackageParam loadPackageParam) throws Exception { 25 | Utils.log("Nubia loaded"); 26 | 27 | //理论上通杀 28 | XposedHelpers.findAndHookMethod(BaseBundle.class,"getBoolean", String.class, boolean.class, new XC_MethodHook() { 29 | @Override 30 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 31 | if( param.args[0].toString().equals( "isMacroEnable") || param.args[0].toString().equals( "isPackageEnable") || param.args[0].toString().equals( "is_need_show_linkview") ){ 32 | Utils.log("Nubia 修改自动连招启用成功。"); 33 | param.setResult(true); 34 | } 35 | Utils.log(param.args[0].toString()); 36 | super.afterHookedMethod(param); 37 | } 38 | }); 39 | 40 | //理论上通杀 41 | XposedHelpers.findAndHookMethod(String.class, "contains", CharSequence.class, new XC_MethodHook() { 42 | @Override 43 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 44 | String p = (String) param.args[0]; 45 | if(p.equals("com.tencent.tmgp.sgame")){ 46 | Utils.log("Nubia 修改检测王者荣耀包名。"); 47 | param.setResult(false); 48 | } 49 | super.afterHookedMethod(param); 50 | } 51 | }); 52 | 53 | ///未使用通杀的方式,可能根据版本不同需要更新ID的值 54 | // layout名称:playing_scene_expand_layout.xml 55 | // ID名称:edt_loop_count、seekbar_loop_delay 56 | XposedHelpers.findAndHookMethod(View.class, "findViewById", int.class, new XC_MethodHook() { 57 | @Override 58 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 59 | int id = (int) param.args[0]; 60 | if(id == 2131230813){ 61 | EditText mEdtLoopCount = (EditText) param.getResult(); 62 | mEdtLoopCount.setFilters(new InputFilter[]{new InputFilter.LengthFilter(6)}); 63 | Utils.log("Nubia 修改最大循环次数成功。"); 64 | }else if (id ==2131230908){ 65 | SeekBar seekBar=(SeekBar) param.getResult(); 66 | seekBar.setMax(3600); 67 | Utils.log("Nubia 修改最大间隔时间成功。"); 68 | } 69 | super.afterHookedMethod(param); 70 | } 71 | }); 72 | 73 | //理论上修改了contains方法后可不修改此方法,但实测无效,不知道为什么 74 | Class PackageUtils = XposedHelpers.findClassIfExists("cn.nubia.gamehelper.utils.PackageUtils",loadPackageParam.classLoader); 75 | if(PackageUtils !=null){ 76 | XposedHelpers.findAndHookMethod(PackageUtils,"isBlackPackageName",String.class,new XC_MethodHook() { 77 | @Override 78 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 79 | super.afterHookedMethod(param); 80 | Utils.log("Nubia 修改isBlackPackageName成功"); 81 | param.setResult(false); 82 | 83 | } 84 | }); 85 | } 86 | 87 | //实测不需要修改 88 | // Class DbHelper= XposedHelpers.findClassIfExists("cn.nubia.gamehelper.db.DbHelper",loadPackageParam.classLoader); 89 | // if(DbHelper !=null){ 90 | // XposedHelpers.findAndHookMethod(DbHelper, "isPackageCanUseMacro",String.class ,new XC_MethodHook() { 91 | // @Override 92 | // protected void afterHookedMethod(MethodHookParam param) throws Throwable { 93 | // super.afterHookedMethod(param); 94 | // Utils.log("Nubia 修改游戏macroCanUse启用成功。"); 95 | // param.setResult(true); 96 | // 97 | // } 98 | // }); 99 | // } 100 | 101 | //实测不需要修改 102 | // Class mUtils = XposedHelpers.findClassIfExists("cn.nubia.gameassist.utils.Utils",loadPackageParam.classLoader); 103 | // if(mUtils !=null){ 104 | // XposedHelpers.findAndHookMethod(mUtils,"supportBroadcastAndElves",String.class,new XC_MethodHook() { 105 | // @Override 106 | // protected void afterHookedMethod(MethodHookParam param) throws Throwable { 107 | // super.afterHookedMethod(param); 108 | // Utils.log("Nubia 修改supportBroadcastAndElves成功"); 109 | // param.setResult(true); 110 | // } 111 | // }); 112 | // } 113 | 114 | 115 | } 116 | 117 | 118 | } 119 | -------------------------------------------------------------------------------- /app/src/main/java/com/specher/superhookbox/hook/Quark.java: -------------------------------------------------------------------------------- 1 | package com.specher.superhookbox.hook; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.annotation.Nullable; 8 | 9 | import com.specher.superhookbox.Utils; 10 | import com.specher.superhookbox.XConfig; 11 | 12 | import org.json.JSONObject; 13 | import org.luckypray.dexkit.DexKitBridge; 14 | import org.luckypray.dexkit.query.FindClass; 15 | import org.luckypray.dexkit.query.FindMethod; 16 | import org.luckypray.dexkit.query.enums.MatchType; 17 | import org.luckypray.dexkit.query.enums.StringMatchType; 18 | import org.luckypray.dexkit.query.matchers.AnnotationElementMatcher; 19 | import org.luckypray.dexkit.query.matchers.AnnotationMatcher; 20 | import org.luckypray.dexkit.query.matchers.AnnotationsMatcher; 21 | import org.luckypray.dexkit.query.matchers.ClassMatcher; 22 | import org.luckypray.dexkit.query.matchers.FieldMatcher; 23 | import org.luckypray.dexkit.query.matchers.FieldsMatcher; 24 | import org.luckypray.dexkit.query.matchers.MethodMatcher; 25 | import org.luckypray.dexkit.query.matchers.MethodsMatcher; 26 | import org.luckypray.dexkit.result.ClassData; 27 | import org.luckypray.dexkit.result.MethodData; 28 | import org.luckypray.dexkit.result.MethodDataList; 29 | 30 | import java.lang.reflect.Modifier; 31 | import java.util.Collection; 32 | import java.util.HashSet; 33 | import java.util.Iterator; 34 | import java.util.List; 35 | 36 | import de.robv.android.xposed.XC_MethodHook; 37 | import de.robv.android.xposed.XposedBridge; 38 | import de.robv.android.xposed.XposedHelpers; 39 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 40 | 41 | public class Quark extends BaseHook{ 42 | private XConfig config; 43 | private JSONObject pref; 44 | 45 | static { 46 | System.loadLibrary("dexkit"); 47 | } 48 | 49 | @Override 50 | public void hook(Context context, XC_LoadPackage.LoadPackageParam loadPackageParam) { 51 | super.hook(context, loadPackageParam); 52 | Utils.log("Quark Lsp loaded"); 53 | String apkPath = loadPackageParam.appInfo.sourceDir; 54 | try (DexKitBridge bridge = DexKitBridge.create(apkPath)) { 55 | ClassData classData = findScanMemberClass(bridge); 56 | Class clazz = classData.getInstance(loadPackageParam.classLoader); 57 | MethodDataList methodDataList = findScanMemberMethod(classData); 58 | for (MethodData methodData:methodDataList){ 59 | XposedHelpers.findAndHookMethod(clazz,methodData.getMethodName(), new XC_MethodHook() { 60 | @Override 61 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 62 | param.setResult(true); 63 | Utils.log("夸克已修改扫描会员。"); 64 | super.afterHookedMethod(param); 65 | } 66 | }); 67 | } 68 | 69 | 70 | Class NewCertificateEditWindowManager = XposedHelpers.findClass("com.ucpro.feature.study.main." + 71 | "certificate.newServe.NewCertificateEditWindowManager",loadPackageParam.classLoader); 72 | String exportPhotoMethodName = findExportPhotoMethod(bridge,NewCertificateEditWindowManager).get(0).getMethodName(); 73 | XposedBridge.hookAllMethods(NewCertificateEditWindowManager,exportPhotoMethodName, new XC_MethodHook() { 74 | @Override 75 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 76 | Class RightState= XposedHelpers.findClassIfExists("com.ucpro.feature.study.edit.pay." + 77 | "ExportSvipPayManager$RightState", loadPackageParam.classLoader); 78 | Object[] enumConstants = RightState.getEnumConstants(); 79 | Object RightStatusData = param.args[2]; 80 | XposedHelpers.setObjectField(RightStatusData,"checkState",enumConstants[0]);//RightState.OK 81 | XposedHelpers.setObjectField(RightStatusData,"freeCount",10); 82 | param.args[2] = RightStatusData; 83 | Utils.log("夸克证件照导出次数已修改。"); 84 | } 85 | }); 86 | 87 | } catch (ClassNotFoundException e) { 88 | throw new RuntimeException(e); 89 | } 90 | } 91 | 92 | private ClassData findScanMemberClass(DexKitBridge bridge) { 93 | ClassData classData = bridge.findClass(FindClass.create() 94 | // 指定搜索的包名范围 95 | .searchPackages("com.ucpro.feature.study.main.member") 96 | .matcher(ClassMatcher.create() 97 | // FieldsMatcher 针对类中包含字段的匹配器 98 | .fields(FieldsMatcher.create() 99 | // 添加对于字段的匹配器 100 | .add(FieldMatcher.create() 101 | // 指定字段的修饰符 102 | .modifiers(Modifier.PRIVATE ) 103 | // 指定字段的类型 104 | .type("com.ucpro.feature.study.main.member.ScanMemberInfo") 105 | // 指定字段的名称 106 | .name("a") 107 | ) 108 | // 添加指定字段的类型的字段匹配器 109 | .addForType("android.content.SharedPreferences") 110 | ) 111 | // MethodsMatcher 针对类中包含方法的匹配器 112 | .methods(MethodsMatcher.create() 113 | // 指定类中方法的数量,最少不少于1个,最多不超过10个 114 | .count(10, 25) 115 | ) 116 | // 类中所有方法使用的字符串 117 | .usingStrings("VIP", "camera_member_info", "camera_member_req_fin") 118 | ) 119 | ).singleOrThrow(() -> new IllegalStateException("返回结果不唯一")); 120 | // 打印找到的类 121 | Utils.log("夸克找到扫描会员类:"+classData.getName()); 122 | return classData; 123 | // 获取对应的类实例 124 | // Class clazz = classData.getInstance(loadPackageParam.classLoader); 125 | } 126 | 127 | private MethodDataList findScanMemberMethod(ClassData scanMemberClass) { 128 | 129 | return scanMemberClass.findMethod(FindMethod.create() 130 | .matcher(MethodMatcher.create() 131 | .returnType(boolean.class) 132 | .usingStrings("VIP") 133 | .paramCount(0) 134 | ) 135 | ); 136 | } 137 | private MethodDataList findExportPhotoMethod(DexKitBridge bridge,Class NewCertificateEditWindowManager){ 138 | 139 | return bridge.getClassData(NewCertificateEditWindowManager).findMethod( 140 | FindMethod.create() 141 | .matcher( 142 | MethodMatcher.create() 143 | .returnType("void") 144 | .paramCount(3) 145 | .usingStrings("鉴权成功") 146 | ) 147 | ); 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /app/src/main/java/com/specher/superhookbox/hook/Telegram.java: -------------------------------------------------------------------------------- 1 | package com.specher.superhookbox.hook; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | 6 | import com.specher.superhookbox.Utils; 7 | import com.specher.superhookbox.XConfig; 8 | 9 | import org.json.JSONObject; 10 | 11 | import java.io.File; 12 | import java.util.ArrayList; 13 | 14 | import de.robv.android.xposed.XC_MethodHook; 15 | import de.robv.android.xposed.XC_MethodReplacement; 16 | import de.robv.android.xposed.XposedBridge; 17 | import de.robv.android.xposed.XposedHelpers; 18 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 19 | 20 | public class Telegram { 21 | private XConfig config; 22 | private JSONObject pref; 23 | 24 | public void hook(Context context, final XC_LoadPackage.LoadPackageParam loadPackageParam) throws Exception { 25 | Utils.log("Telegram loaded"); 26 | config = new XConfig(context, XConfig.getConfigName(XConfig.isTelegram)); 27 | pref = config.readPref(); 28 | 29 | //刷新配置 30 | XposedHelpers.findAndHookMethod(Activity.class, "onResume", new XC_MethodHook() { 31 | @Override 32 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 33 | pref = config.readPref(); 34 | super.afterHookedMethod(param); 35 | } 36 | }); 37 | 38 | //阻止撤回 39 | Class MessagesStorage = XposedHelpers.findClass("org.telegram.messenger.MessagesStorage", loadPackageParam.classLoader); 40 | XposedBridge.hookAllMethods(MessagesStorage, "markMessagesAsDeleted", new XC_MethodReplacement() { 41 | @Override 42 | protected Object replaceHookedMethod(MethodHookParam param) throws Throwable { 43 | if (pref.getBoolean(config.unRecalled)) { 44 | if (param.args[0] instanceof ArrayList) { 45 | // ArrayList r25 = (ArrayList) param.args[0]; 46 | // if (r25.size() > 0) { 47 | // Integer r4 = (Integer) r25.get(r25.size() - 1); 48 | // Utils.log("tghook:阻止撤回" + r4); 49 | // } 50 | } 51 | 52 | } else { 53 | XposedBridge.invokeOriginalMethod(param.method, param.thisObject, param.args); 54 | } 55 | return null; 56 | 57 | } 58 | 59 | 60 | }); 61 | 62 | //阻止自毁 63 | Class MessagesController = XposedHelpers.findClass("org.telegram.messenger.MessagesController", loadPackageParam.classLoader); 64 | XposedBridge.hookAllMethods(MessagesController, "getNewDeleteTask", new XC_MethodReplacement() { 65 | @Override 66 | protected Object replaceHookedMethod(MethodHookParam param) throws Throwable { 67 | if (pref.getBoolean(config.unDelete)) { 68 | Utils.log("tghook:阻止自毁"); 69 | }else{ 70 | XposedBridge.invokeOriginalMethod(param.method, param.thisObject, param.args); 71 | } 72 | return null; 73 | } 74 | }); 75 | 76 | 77 | Class MessageObject = XposedHelpers.findClass("org.telegram.messenger.MessageObject", loadPackageParam.classLoader); 78 | 79 | 80 | //让自毁图片正常显示 81 | XposedBridge.hookAllMethods(MessageObject, "isSecretMedia", new XC_MethodHook() { 82 | @Override 83 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 84 | if (pref.getBoolean(config.unDelete)) { 85 | param.setResult(false); 86 | } 87 | super.beforeHookedMethod(param); 88 | } 89 | }); 90 | XposedBridge.hookAllMethods(MessageObject, "needDrawBluredPreview", new XC_MethodHook() { 91 | @Override 92 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 93 | if (pref.getBoolean(config.unDelete)) { 94 | param.setResult(false); 95 | } 96 | super.beforeHookedMethod(param); 97 | } 98 | }); 99 | XposedBridge.hookAllMethods(MessageObject, "isSecretPhotoOrVideo", new XC_MethodHook() { 100 | @Override 101 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 102 | if (pref.getBoolean(config.unDelete)) { 103 | param.setResult(false); 104 | 105 | } 106 | super.beforeHookedMethod(param); 107 | } 108 | }); 109 | XposedBridge.hookAllMethods(MessageObject, "isSecretPhotoOrVideo", new XC_MethodHook() { 110 | @Override 111 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 112 | if (pref.getBoolean(config.unDelete)) { 113 | param.setResult(false); 114 | 115 | } 116 | super.beforeHookedMethod(param); 117 | } 118 | }); 119 | XposedBridge.hookAllMethods(MessageObject, "shouldEncryptPhotoOrVideo", new XC_MethodHook() { 120 | @Override 121 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 122 | if (pref.getBoolean(config.unDelete)) { 123 | param.setResult(false); 124 | 125 | } 126 | super.beforeHookedMethod(param); 127 | } 128 | }); 129 | XposedBridge.hookAllMethods(MessageObject, "needDrawShareButton", new XC_MethodHook() { 130 | @Override 131 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 132 | if (pref.getBoolean(config.unDelete)) { 133 | param.setResult(true); 134 | 135 | } 136 | super.beforeHookedMethod(param); 137 | } 138 | }); 139 | 140 | 141 | 142 | 143 | 144 | Class UserConfig = XposedHelpers.findClass("org.telegram.messenger.UserConfig", loadPackageParam.classLoader); 145 | XposedBridge.hookAllMethods(UserConfig, "isPremium", new XC_MethodHook() { 146 | @Override 147 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 148 | if (pref.getBoolean(config.isPremium)) { 149 | param.setResult(true); 150 | 151 | } 152 | super.beforeHookedMethod(param); 153 | } 154 | }); 155 | 156 | 157 | 158 | 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /app/src/main/java/com/specher/superhookbox/hook/Tiktok.java: -------------------------------------------------------------------------------- 1 | package com.specher.superhookbox.hook; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.app.Activity; 5 | import android.content.Context; 6 | import android.os.Bundle; 7 | import android.view.View; 8 | import android.widget.FrameLayout; 9 | import android.widget.Toast; 10 | 11 | import com.specher.superhookbox.Utils; 12 | import com.specher.superhookbox.XConfig; 13 | 14 | import org.json.JSONException; 15 | import org.json.JSONObject; 16 | 17 | import java.lang.reflect.Method; 18 | import java.util.List; 19 | 20 | import de.robv.android.xposed.XC_MethodHook; 21 | import de.robv.android.xposed.XC_MethodReplacement; 22 | import de.robv.android.xposed.XposedBridge; 23 | import de.robv.android.xposed.XposedHelpers; 24 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 25 | 26 | public class Tiktok { 27 | public Activity mActivity; 28 | public JSONObject checks; 29 | public XConfig config; 30 | private Class hookClass_LongPressLayout; 31 | private Class hookClass_VideoViewHolder; 32 | private Class hookClass_MainFragment; 33 | private Class hookClass_VideoModle; 34 | private Class hookClass_BaseListFragmentPanel; 35 | private Class hookClass_FeedApi; 36 | private Class hookClass_Adaptation; 37 | private Class hookClass_CommentColorViewModel; 38 | private Class hookClass_CommentListFragment; 39 | private String paramBottomBar; 40 | private String paramStatusBar; 41 | private String methodCommentDark; 42 | 43 | 44 | private boolean isCommentShow = false; 45 | private boolean isHide = false; 46 | private String lastPlaytime = "0"; 47 | private long lastPlay = -1; 48 | private String lastJumpAid = "0"; 49 | public View llRightMenu; 50 | public View llAwemeIntro; 51 | public View mMusicCoverLayout; 52 | private String downloadAddr; 53 | private boolean isLite; 54 | 55 | 56 | public void hook(final Context context, final XC_LoadPackage.LoadPackageParam loadPackageParam) throws Exception { 57 | 58 | final int versionCode = Utils.getPackageVersionCode(loadPackageParam); 59 | Utils.log("version:" + versionCode); 60 | 61 | hookClass_LongPressLayout = XposedHelpers.findClassIfExists("com.ss.android.ugc.aweme.feed.ui.LongPressLayout$2", loadPackageParam.classLoader); 62 | config = new XConfig(context, XConfig.getConfigName(XConfig.isTikTok)); 63 | checks = config.readPref(); 64 | XposedHelpers.findAndHookMethod("com.ss.android.ugc.aweme.main.MainActivity", loadPackageParam.classLoader, "onCreate", Bundle.class, new XC_MethodHook() { 65 | public void afterHookedMethod(MethodHookParam param) throws Throwable { 66 | super.afterHookedMethod(param); 67 | if (mActivity != null) { 68 | mActivity = (Activity) param.thisObject; 69 | return;//防止退出MainActivity之后的重复hook 70 | } 71 | mActivity = (Activity) param.thisObject; 72 | if (hookClass_LongPressLayout == null) { 73 | Toast.makeText(mActivity, "抖X插件:不支持当前版本:" + versionCode, Toast.LENGTH_LONG).show(); 74 | } else { 75 | Toast.makeText(mActivity, "抖X插件:已加载成功。", Toast.LENGTH_SHORT).show(); 76 | 77 | //长按Hook 78 | XposedHelpers.findAndHookMethod(hookClass_LongPressLayout, "run", new XC_MethodReplacement() { 79 | @SuppressLint("ResourceType") 80 | @Override 81 | protected Object replaceHookedMethod(MethodHookParam param) throws Throwable { 82 | Utils.log("触发LongPress"); 83 | if (checks.getBoolean(config.fullVideoPlay)) { 84 | 85 | Object mCurFragment = XposedHelpers.callMethod(mActivity, "getCurFragment"); 86 | Object MainPageFragment; 87 | 88 | 89 | 90 | //隐藏切换 91 | if (!isHide) { 92 | //隐藏通知栏 93 | if (checks.getBoolean(config.hideStatusBar)) { 94 | //XposedHelpers.callMethod(mActivity, "hideStatusBar"); 95 | mActivity.getWindow().setFlags(1024, 1024); 96 | } 97 | 98 | isHide = true; 99 | } else { 100 | 101 | mActivity.getWindow().clearFlags(1024); 102 | //XposedHelpers.callMethod(mActivity, "showStatusBar"); 103 | isHide = false; 104 | } 105 | } else { 106 | XposedBridge.invokeOriginalMethod(param.method, param.thisObject, param.args); 107 | } 108 | return null; 109 | } 110 | }); 111 | 112 | 113 | } 114 | } 115 | }); 116 | 117 | XposedHelpers.findAndHookMethod("com.ss.android.ugc.aweme.main.MainActivity", loadPackageParam.classLoader, "onResume", new XC_MethodHook() { 118 | @Override 119 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 120 | //刷新配置 121 | if (config != null) { 122 | checks = config.readPref(); 123 | } 124 | super.afterHookedMethod(param); 125 | } 126 | }); 127 | 128 | //去开屏广告 129 | if (checks.getBoolean(config.isJumpSplashAd)) { 130 | Class hookClass_SplashAdActivity; 131 | hookClass_SplashAdActivity = XposedHelpers.findClassIfExists("com.ss.android.ugc.aweme.splash.SplashAdActivity", loadPackageParam.classLoader); 132 | if(hookClass_SplashAdActivity!=null) { 133 | XposedBridge.hookAllMethods(hookClass_SplashAdActivity, "onCreate", new XC_MethodHook() { 134 | @Override 135 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 136 | ((Activity) param.thisObject).finish(); 137 | Utils.log("跳过开屏广告一个"); 138 | super.beforeHookedMethod(param); 139 | } 140 | }); 141 | } 142 | Class hookClass_CommercializeSplashAdActivity = XposedHelpers.findClassIfExists("com.bytedance.ies.ugc.aweme.commercialize.splash.show.SplashAdActivity", loadPackageParam.classLoader); 143 | XposedBridge.hookAllMethods(hookClass_CommercializeSplashAdActivity, "onCreate", new XC_MethodHook() { 144 | @Override 145 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 146 | ((Activity) param.thisObject).finish(); 147 | Utils.log("跳过开屏广告一个"); 148 | super.beforeHookedMethod(param); 149 | } 150 | }); 151 | 152 | 153 | } 154 | 155 | 156 | } 157 | 158 | 159 | } -------------------------------------------------------------------------------- /app/src/main/java/com/specher/superhookbox/hook/WeChat.java: -------------------------------------------------------------------------------- 1 | package com.specher.superhookbox.hook; 2 | 3 | 4 | import android.content.ClipData; 5 | import android.content.ClipboardManager; 6 | import android.content.Context; 7 | import android.os.Bundle; 8 | import android.os.Parcelable; 9 | import android.widget.Toast; 10 | 11 | import com.specher.superhookbox.Utils; 12 | import com.specher.superhookbox.XConfig; 13 | 14 | import org.json.JSONObject; 15 | import org.luckypray.dexkit.DexKitBridge; 16 | import org.luckypray.dexkit.query.FindClass; 17 | import org.luckypray.dexkit.query.FindMethod; 18 | import org.luckypray.dexkit.query.matchers.ClassMatcher; 19 | import org.luckypray.dexkit.query.matchers.FieldMatcher; 20 | import org.luckypray.dexkit.query.matchers.FieldsMatcher; 21 | import org.luckypray.dexkit.query.matchers.MethodMatcher; 22 | import org.luckypray.dexkit.query.matchers.MethodsMatcher; 23 | import org.luckypray.dexkit.result.ClassData; 24 | import org.luckypray.dexkit.result.ClassDataList; 25 | import org.luckypray.dexkit.result.MethodData; 26 | import org.luckypray.dexkit.result.MethodDataList; 27 | 28 | import java.lang.reflect.Field; 29 | import java.lang.reflect.Modifier; 30 | import java.util.ArrayList; 31 | import java.util.Arrays; 32 | 33 | import de.robv.android.xposed.XC_MethodHook; 34 | import de.robv.android.xposed.XC_MethodReplacement; 35 | import de.robv.android.xposed.XposedBridge; 36 | import de.robv.android.xposed.XposedHelpers; 37 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 38 | 39 | public class WeChat { 40 | private XConfig config; 41 | private JSONObject pref; 42 | private Context context; 43 | 44 | 45 | static { 46 | System.loadLibrary("dexkit"); 47 | } 48 | 49 | public void hook(Context context, final XC_LoadPackage.LoadPackageParam loadPackageParam) throws Exception { 50 | Utils.log("WeChat Hook loaded"); 51 | this.context = context; 52 | String apkPath = loadPackageParam.appInfo.sourceDir; 53 | DexKitBridge bridge = DexKitBridge.create(apkPath); 54 | //hookLog(loadPackageParam.classLoader); 55 | //hookAppBrand(loadPackageParam.classLoader); 56 | hookCamera(loadPackageParam,bridge); 57 | } 58 | 59 | 60 | /** 61 | * 微信扫码结果解析 62 | * Hook方法体: 63 | 64 | public void a(long j, Bundle bundle) { 65 | Bundle bundle2 = bundle; 66 | BaseScanUI baseScanUI = this.a; 67 | String str = "MicroMsg.ScanUI"; 68 | if (baseScanUI.U) { 69 | if (!(baseScanUI.u == null || bundle2 == null)) { 70 | l2.j(str, "scan code cost time: %d", new Object[]{Long.valueOf(System.currentTimeMillis() - baseScanUI.C)}); 71 | ArrayList parcelableArrayList = bundle2.getParcelableArrayList("result_qbar_result_list"); 72 | if (parcelableArrayList != null) { 73 | if (parcelableArrayList.size() > 0) { 74 | int i = bundle2.getInt("result_code_point_count", 0); 75 | long j2 = bundle2.getLong("decode_success_cost_time", 0); 76 | m2.n(baseScanUI.D, true, baseScanUI.y0 ? 3 : 1, i); 77 | i.a(1, null); 78 | baseScanUI.O6(); 79 | baseScanUI.M6(true, i > 1); 80 | baseScanUI.S6(false); 81 | int i2 = baseScanUI.D; 82 | i2 i2Var = new i2(parcelableArrayList, j2); 83 | m2.i = i2Var; 84 | try { 85 | String e = m2.e(i2); 86 | i2Var.c = e != null ? Long.parseLong(e) : System.currentTimeMillis(); 87 | i2 i2Var2 = m2.i; 88 | if (i2Var2 != null) { 89 | String d = m2.d(i2); 90 | i2Var2.d = d != null ? Long.parseLong(d) : System.currentTimeMillis(); 91 | } 92 | i2Var2 = m2.i; 93 | if (i2Var2 != null) { 94 | i2Var2.e = Long.parseLong(m2.b); 95 | } 96 | i2Var2 = m2.i; 97 | if (i2Var2 != null) { 98 | i2Var2.f = System.currentTimeMillis(); 99 | } 100 | } catch (Exception unused) { 101 | } 102 | boolean z = baseScanUI.g.g; 103 | WxQBarResult wxQBarResult = (WxQBarResult) parcelableArrayList.get(0); 104 | if (wxQBarResult == null) { 105 | l2.j(str, "firstQBarResult is null", null); 106 | return; 107 | } 108 | if (BaseScanUI.w6(baseScanUI, wxQBarResult, parcelableArrayList.size() <= 1)) { 109 | l2.q(str, "scan code has deal with", null); 110 | return; 111 | } 112 | bundle2.putInt("qbar_string_scan_source", 0); 113 | if (i <= 0 || baseScanUI.f == null) { 114 | boolean z2 = true; 115 | baseScanUI.S6(z2); 116 | if (!BaseScanUI.w6(baseScanUI, wxQBarResult, z2)) { 117 | BaseScanUI.x6(baseScanUI, j, bundle2, wxQBarResult); 118 | } 119 | } else { 120 | ScanDecodeFrameData scanDecodeFrameData = (ScanDecodeFrameData) bundle2.getParcelable("decode_success_frame_data"); 121 | if (scanDecodeFrameData != null) { 122 | baseScanUI.f.setDecodeSuccessFrameData(scanDecodeFrameData); 123 | } 124 | baseScanUI.d1 = i > 1; 125 | if (i > 1) { 126 | baseScanUI.q.a(false); 127 | baseScanUI.q.b(true, null); 128 | baseScanUI.V6(false); 129 | } 130 | baseScanUI.T = true; 131 | n2 n2Var = r0; 132 | ScanUIRectView scanUIRectView = baseScanUI.f; 133 | 1 1 = new 1(this, parcelableArrayList, i, j, bundle); 134 | scanUIRectView.setSuccessMarkClickListener(n2Var); 135 | baseScanUI.z6(2); 136 | baseScanUI.W6(false, false); 137 | BaseScanUI.v6(baseScanUI); 138 | baseScanUI.f.getClass(); 139 | t1 t1Var = t1.a; 140 | baseScanUI.f.s(parcelableArrayList, new 2(this, i, parcelableArrayList, wxQBarResult, j, bundle), z, true); 141 | } 142 | } 143 | } 144 | l2.q(str, "alvinluo onScanSuccess qbarResult invalid", null); 145 | } 146 | return; 147 | } 148 | l2.q(str, "alvinluo onScanSuccess can not process code result currentMode: %d", new Object[]{Integer.valueOf(baseScanUI.D)}); 149 | } 150 | * @param loadPackageParam 151 | */ 152 | public void hookCamera(XC_LoadPackage.LoadPackageParam loadPackageParam,DexKitBridge bridge){ 153 | try { 154 | //findClassTest(bridge); 155 | ClassData classData = findScanCallBackClass(bridge); 156 | Class ScanCallBack = classData.getInstance(loadPackageParam.classLoader); 157 | XposedBridge.hookAllMethods(ScanCallBack, "a", new XC_MethodHook() { 158 | @Override 159 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 160 | Bundle bundle = (Bundle) param.args[1]; 161 | ArrayList parcelableArrayList = bundle.getParcelableArrayList("result_qbar_result_list"); 162 | assert parcelableArrayList != null; 163 | Object WxQbarResult = parcelableArrayList.get(0); 164 | String codeType = (String) XposedHelpers.getObjectField(WxQbarResult,"e"); 165 | String codeStr = (String) XposedHelpers.getObjectField(WxQbarResult,"f"); 166 | Utils.log("getScanProductInfoList: " +"codeType:"+codeType+" codeStr:"+codeStr); 167 | Toast.makeText(context, "二维码已复制codeType:"+codeType+" codeStr:"+codeStr, Toast.LENGTH_SHORT).show(); 168 | ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); 169 | // 创建一个ClipData对象来保存文本 170 | ClipData clipData = ClipData.newPlainText("simple text", "codeType:"+codeType+" codeStr:"+codeStr); 171 | // 将ClipData对象放到剪贴板 172 | clipboardManager.setPrimaryClip(clipData); 173 | // try { 174 | // // 格式化当前日期时间为秒数 175 | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.CHINA); // 使用适合你的格式的模板 176 | // String fileName = sdf.format(new Date()) + ".jpg"; 177 | // 178 | // // 创建文件对象 179 | // File file = new File(context.getFilesDir(), fileName); 180 | // 181 | // // 使用try-with-resources语句来自动关闭FileOutputStream 182 | // try (FileOutputStream fos = new FileOutputStream(file)) { 183 | // fos.write(data); // 假设data是包含图片数据的字节数组 184 | // // fos.flush(); // 通常flush()在close()时会自动执行,但在这里显式调用也没有问题 185 | // Utils.log("扫码文件保存成功: " + file.getAbsolutePath()); 186 | // } catch (IOException e) { 187 | // Utils.log("保存文件时发生错误: " + e.toString()); 188 | // } 189 | // } catch (Exception e) { 190 | // // 这里的异常可能是由mkdirs()等方法抛出的,而不是FileOutputStream 191 | // Utils.log("其他异常: " + e.toString()); 192 | // } 193 | super.afterHookedMethod(param); 194 | } 195 | }); 196 | 197 | } catch (Exception e) { 198 | throw new RuntimeException(e); 199 | } 200 | 201 | 202 | 203 | 204 | 205 | // try{ 206 | // 207 | // Class ScanUIRectView= loadPackageParam.classLoader.loadClass("com.tencent.mm.plugin.scanner.ui.BaseScanUI$7"); 208 | // 209 | // 210 | // }catch (Exception e){ 211 | // Utils.log(e.toString()); 212 | // } 213 | } 214 | 215 | 216 | private ClassData findScanCallBackClass(DexKitBridge bridge) { 217 | ClassData classData = bridge.findClass(FindClass.create() 218 | // 指定搜索的包名范围 219 | .searchPackages("com.tencent.mm.plugin.scanner.ui") 220 | .matcher(ClassMatcher.create() 221 | // 类中所有方法使用的字符串 222 | .usingStrings("decode_success_cost_time") 223 | ) 224 | ).singleOrThrow(() -> new IllegalStateException("返回结果不唯一")); 225 | // 打印找到的类 226 | Utils.log("微信找到类:"+classData.getName()); 227 | return classData; 228 | // 获取对应的类实例 229 | // Class clazz = classData.getInstance(loadPackageParam.classLoader); 230 | } 231 | 232 | 233 | 234 | 235 | /** 236 | * 微信小程序Hook 237 | * @param classLoader 238 | */ 239 | public void hookAppBrand(ClassLoader classLoader) { 240 | try { 241 | Class h3 = classLoader.loadClass("com.tencent.mm.plugin.appbrand.utils.h3"); 242 | XposedBridge.hookAllMethods(h3, "b", new XC_MethodHook() {//j也hook一下 243 | @Override 244 | protected void afterHookedMethod(MethodHookParam param) { 245 | Object q8 = param.args[0]; 246 | String appid = (String) XposedHelpers.callMethod(q8,"getAppId"); 247 | String key = (String) param.args[2]; 248 | String[] strArr = (String[]) param.args[3]; 249 | Utils.log("hookAppBrand appid:"+appid+ " key:"+key); 250 | 251 | } 252 | }); 253 | 254 | 255 | Class AppBrandJsBridgeBinding = classLoader.loadClass("com.tencent.mm.appbrand.commonjni.AppBrandJsBridgeBinding"); 256 | 257 | XposedBridge.hookAllMethods(AppBrandJsBridgeBinding, "subscribeHandler", new XC_MethodHook() { 258 | @Override 259 | protected void afterHookedMethod(MethodHookParam param) { 260 | 261 | String key = (String) param.args[0]; 262 | String value = (String) param.args[1]; 263 | String value1 = (String) param.args[3]; 264 | Utils.log("hookAppBrand key:"+key+ " value:"+value +"|"+value1 +"调用栈:"+ Arrays.toString(new Throwable().getStackTrace())); 265 | 266 | } 267 | }); 268 | 269 | 270 | 271 | Class jsapi = classLoader.loadClass("com.tencent.mm.plugin.appbrand.jsapi.td"); 272 | XposedBridge.hookAllMethods(jsapi, "a", new XC_MethodHook() { 273 | @Override 274 | protected void afterHookedMethod(MethodHookParam param) throws Throwable { 275 | super.afterHookedMethod(param); 276 | String a= (String) param.args[1]; 277 | String b= (String) param.args[2]; 278 | Utils.log("hookAppBrandteg "+a+" | "+b ); 279 | 280 | } 281 | }); 282 | 283 | } 284 | catch (Exception e){ 285 | Utils.log("WeChat Hook failed."+e.toString()); 286 | } 287 | 288 | 289 | 290 | } 291 | 292 | 293 | 294 | public void hookLog(ClassLoader classLoader) throws Exception{ 295 | XC_MethodHook logCallback = new XC_MethodHook() { 296 | @Override 297 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable { 298 | boolean log = false; 299 | Throwable ex = new Throwable(); 300 | StackTraceElement[] elements = ex.getStackTrace(); 301 | // for (StackTraceElement element : elements){ 302 | // if (element.getClassName().contains("com.tencent.mm.plugin.appbrand")){ 303 | // log = true; 304 | // break; 305 | // } 306 | // } 307 | // if (!log){ 308 | // return; 309 | // } 310 | int level = 0; 311 | String name = param.method.getName(); 312 | String arg0 = (String) param.args[0]; 313 | String arg1 = (String) param.args[1]; 314 | Object[] arg2 = (Object[]) param.args[2]; 315 | String format = arg2 == null ? arg1 : String.format(arg1, arg2); 316 | Utils.log( arg0+" "+ format + "stack:"+ Arrays.toString(elements)); 317 | 318 | } 319 | }; 320 | 321 | 322 | Class logClass = classLoader.loadClass("com.tencent.mm.sdk.platformtools.l2"); 323 | XposedHelpers.findAndHookMethod(logClass, "m", String.class, String.class, Object[].class, logCallback); 324 | XposedHelpers.findAndHookMethod(logClass, "o", String.class, String.class, Object[].class, logCallback); 325 | XposedHelpers.findAndHookMethod(logClass, "j", String.class, String.class, Object[].class, logCallback); 326 | XposedHelpers.findAndHookMethod(logClass, "f", String.class, String.class, Object[].class, logCallback); 327 | XposedHelpers.findAndHookMethod(logClass, "e", String.class, String.class, Object[].class, logCallback); 328 | XposedHelpers.findAndHookMethod(logClass, "q", String.class, String.class, Object[].class, logCallback); 329 | 330 | } 331 | 332 | 333 | 334 | 335 | 336 | private ClassData findSubCoreRemittanceClass(DexKitBridge bridge) { 337 | ClassData classData = bridge.findClass(FindClass.create() 338 | .matcher(ClassMatcher.create() 339 | // 类中所有方法使用的字符串 340 | .usingStrings("JsApiOpenC2CTransferMsgViewEvent","SubCoreRemittance") 341 | ) 342 | ).singleOrThrow(() -> new IllegalStateException("返回结果不唯一")); 343 | // 打印找到的类 344 | Utils.log("微信找到类:"+classData.getName()); 345 | return classData; 346 | } 347 | 348 | private MethodData findJsApiOpenC2CTransferMsgViewEventMethod(DexKitBridge bridge,Class SubCoreRemittanceClass){ 349 | 350 | return bridge.getClassData(SubCoreRemittanceClass).findMethod( 351 | FindMethod.create() 352 | .matcher( 353 | MethodMatcher.create() 354 | .returnType(boolean.class) 355 | .paramCount(2) 356 | .usingStrings("JsApiOpenC2CTransferMsgViewEvent") 357 | ) 358 | ).singleOrThrow(() -> new IllegalStateException("findJsApiOpenC2CTransferMsgViewEventMethod返回结果不唯一")); 359 | } 360 | 361 | private void findClassTest(DexKitBridge bridge) { 362 | ClassDataList classDataList = bridge.findClass(FindClass.create() 363 | 364 | .matcher(ClassMatcher.create() 365 | // 类中所有方法使用的字符串 366 | .usingStrings("JsApiOpenC2CTransferMsgViewEvent") 367 | ) 368 | ); 369 | 370 | if(classDataList.isEmpty()){ 371 | Utils.log("没有找到类。"); 372 | } 373 | 374 | for(ClassData classData : classDataList){ 375 | Utils.log("找到类:"+classData.getName()); 376 | } 377 | } 378 | 379 | 380 | 381 | } 382 | 383 | 384 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Specher/SuperHookBox/f9d23185e326b5ee106fd18c3415519fe3a0c410/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Specher/SuperHookBox/f9d23185e326b5ee106fd18c3415519fe3a0c410/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Specher/SuperHookBox/f9d23185e326b5ee106fd18c3415519fe3a0c410/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Specher/SuperHookBox/f9d23185e326b5ee106fd18c3415519fe3a0c410/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Specher/SuperHookBox/f9d23185e326b5ee106fd18c3415519fe3a0c410/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Specher/SuperHookBox/f9d23185e326b5ee106fd18c3415519fe3a0c410/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Specher/SuperHookBox/f9d23185e326b5ee106fd18c3415519fe3a0c410/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Specher/SuperHookBox/f9d23185e326b5ee106fd18c3415519fe3a0c410/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Specher/SuperHookBox/f9d23185e326b5ee106fd18c3415519fe3a0c410/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Specher/SuperHookBox/f9d23185e326b5ee106fd18c3415519fe3a0c410/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.telegram.messenger 5 | com.miui.securitycenter 6 | com.ss.android.ugc.aweme 7 | cn.nubia.gameassist 8 | cn.nubia.gamelauncher 9 | cn.nubia.gamehelpmodule 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #2962FF 4 | #2962FF 5 | #03DAC5 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | HookBox 3 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/xml/file.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | google() 5 | mavenCentral() 6 | maven { url "https://api.xposed.info/" } 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:8.7.3' 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | google() 19 | mavenCentral() 20 | maven { url "https://api.xposed.info/" } 21 | 22 | } 23 | } 24 | 25 | tasks.register('clean', Delete) { 26 | delete rootProject.buildDir 27 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | android.nonTransitiveRClass=false 21 | android.nonFinalResIds=false 22 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Specher/SuperHookBox/f9d23185e326b5ee106fd18c3415519fe3a0c410/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright ? 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions ?$var?, ?${var}?, ?${var:-default}?, ?${var+SET}?, 36 | # ?${var#prefix}?, ?${var%suffix}?, and ?$( cmd )?; 37 | # * compound commands having a testable exit status, especially ?case?; 38 | # * various built-in commands including ?command?, ?set?, and ?ulimit?. 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Use "xargs" to parse quoted args. 209 | # 210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 211 | # 212 | # In Bash we could simply go: 213 | # 214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 215 | # set -- "${ARGS[@]}" "$@" 216 | # 217 | # but POSIX shell has neither arrays nor command substitution, so instead we 218 | # post-process each arg (as a line of input to sed) to backslash-escape any 219 | # character that might be a shell metacharacter, then use eval to reverse 220 | # that process (while maintaining the separation between arguments), and wrap 221 | # the whole thing up as a single "set" statement. 222 | # 223 | # This will of course break if any of these variables contains a newline or 224 | # an unmatched quote. 225 | # 226 | 227 | eval "set -- $( 228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 229 | xargs -n1 | 230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 231 | tr '\n' ' ' 232 | )" '"$@"' 233 | 234 | exec "$JAVACMD" "$@" 235 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | rootProject.name = "SuperHookBox" 3 | --------------------------------------------------------------------------------