├── .gitignore ├── LICENSE ├── README.md ├── app ├── build.gradle ├── libs │ └── XposedBridgeApi-82.jar ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── xposed_init │ ├── ic_launcher-web.png │ ├── java │ └── me │ │ └── firesun │ │ └── wechat │ │ └── enhancement │ │ ├── Main.java │ │ ├── PreferencesUtils.java │ │ ├── RangePreference.java │ │ ├── SettingsActivity.java │ │ ├── plugin │ │ ├── AntiRevoke.java │ │ ├── AntiSnsDelete.java │ │ ├── AutoLogin.java │ │ ├── HideModule.java │ │ ├── IPlugin.java │ │ ├── Limits.java │ │ └── LuckMoney.java │ │ └── util │ │ ├── ConfigReceiver.java │ │ ├── HookParams.java │ │ ├── ReflectionUtil.java │ │ ├── SearchClasses.java │ │ ├── Tag.java │ │ └── XmlToJson.java │ └── res │ ├── layout │ ├── activity_settings.xml │ └── preference_range.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── values │ ├── colors.xml │ ├── strings.xml │ └── style.xml │ └── xml │ └── pref_setting.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── image ├── screenshot1.jpg ├── screenshot2.jpg └── screenshot3.jpg └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # Intellij 36 | *.iml 37 | .idea/workspace.xml 38 | .idea/tasks.xml 39 | .idea/gradle.xml 40 | .idea/dictionaries 41 | .idea/libraries 42 | 43 | # Keystore files 44 | *.jks 45 | 46 | # External native build folder generated in Android Studio 2.2 and later 47 | .externalNativeBuild 48 | 49 | # Google Services (e.g. APIs or Firebase) 50 | google-services.json 51 | 52 | # Freeline 53 | freeline.py 54 | freeline/ 55 | freeline_project_description.json 56 | 57 | app/keystore/* 58 | -------------------------------------------------------------------------------- /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 | # WechatEnhancement 2 | 需要Xposed,同时支持太极与[VirtualXposed](https://github.com/android-hacker/VirtualXposed) 。仅供学习交流,禁止用于其他用途,学习后请及时删除,禁止任何公司或个人发布与传播,同时也不接受任何捐赠。 3 | 4 | ## 支持的微信版本 5 | - 理论上支持微信全版本,自适应方式采用微信巫师的自动搜索方式,所以理论上即使微信升级也可继续支持 6 | - 已测试通过的微信版本:6.6.0,6.7.3,7.0.0,8.0.2 7 | 8 | ## 支持功能 9 | - 接收红包 10 | - 接收转账 **(恢复聊天记录时务必关闭此功能)** 11 | - 消息防撤回 12 | - 朋友圈防删除 13 | - 电脑端微信自动登录 14 | - 突破发送图片9张限制 15 | 16 | ## 效果预览 17 | 18 | 19 | 20 | ## 致谢 21 | 本项目为以下三个项目的融合,使用Java重(chao)写(xi)了微信巫师的自动搜索hook类的功能,并应用在抢红包和自动接收转账上,使得以上功能都能自动适配微信,在此十分感谢veryyoung,Gh0u1L5,wuxiaosu 22 | 23 | [WechatLuckyMoney](https://github.com/veryyoung/WechatLuckyMoney) 24 | 25 | [WechatMagician](https://github.com/Gh0u1L5/WechatMagician) 26 | 27 | [XposedWechatHelper](https://github.com/wuxiaosu/XposedWechatHelper) 28 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | 5 | signingConfigs { 6 | debug { 7 | storeFile file("keystore/debug.keystore") 8 | storePassword "firesun" 9 | keyAlias "firesun" 10 | keyPassword "firesun" 11 | } 12 | release { 13 | storeFile file("keystore/release.keystore") 14 | storePassword "firesun" 15 | keyAlias "firesun" 16 | keyPassword "firesun" 17 | } 18 | } 19 | 20 | compileSdkVersion 23 21 | buildToolsVersion "27.0.3" 22 | defaultConfig { 23 | applicationId "me.firesun.wechat.enhancement" 24 | minSdkVersion 17 25 | targetSdkVersion 23 26 | versionCode 48 27 | versionName "1.9.3" 28 | } 29 | 30 | buildTypes { 31 | release { 32 | signingConfig signingConfigs.release 33 | minifyEnabled true 34 | shrinkResources false 35 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 36 | } 37 | } 38 | 39 | } 40 | 41 | dependencies { 42 | compileOnly files('libs/XposedBridgeApi-82.jar') 43 | implementation 'com.android.support:appcompat-v7:23.4.0' 44 | implementation 'net.dongliu:apk-parser:2.4.2' 45 | implementation 'com.google.code.gson:gson:2.8.2' 46 | } 47 | 48 | -------------------------------------------------------------------------------- /app/libs/XposedBridgeApi-82.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firesunCN/WechatEnhancement/d6e75accfa3bbd1564ecb1ee32f53dcaa7b4732f/app/libs/XposedBridgeApi-82.jar -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Bin\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | -keep class me.firesun.wechat.enhancement.* { *; } 20 | -dontwarn okio.** 21 | -dontwarn net.dongliu.apk.parser.** 22 | -dontwarn org.bouncycastle.** 23 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 38 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /app/src/main/assets/xposed_init: -------------------------------------------------------------------------------- 1 | me.firesun.wechat.enhancement.Main -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firesunCN/WechatEnhancement/d6e75accfa3bbd1564ecb1ee32f53dcaa7b4732f/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/Main.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement; 2 | 3 | import android.content.Context; 4 | import android.content.ContextWrapper; 5 | import android.content.pm.PackageInfo; 6 | import android.content.pm.PackageManager; 7 | 8 | import de.robv.android.xposed.IXposedHookLoadPackage; 9 | import de.robv.android.xposed.XC_MethodHook; 10 | import de.robv.android.xposed.XposedHelpers; 11 | import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam; 12 | import me.firesun.wechat.enhancement.plugin.AntiRevoke; 13 | import me.firesun.wechat.enhancement.plugin.AntiSnsDelete; 14 | import me.firesun.wechat.enhancement.plugin.AutoLogin; 15 | import me.firesun.wechat.enhancement.plugin.HideModule; 16 | import me.firesun.wechat.enhancement.plugin.IPlugin; 17 | import me.firesun.wechat.enhancement.plugin.Limits; 18 | import me.firesun.wechat.enhancement.plugin.LuckMoney; 19 | import me.firesun.wechat.enhancement.util.HookParams; 20 | import me.firesun.wechat.enhancement.util.SearchClasses; 21 | 22 | import static de.robv.android.xposed.XposedBridge.log; 23 | 24 | 25 | public class Main implements IXposedHookLoadPackage { 26 | 27 | private static IPlugin[] plugins = { 28 | new AntiRevoke(), 29 | new AntiSnsDelete(), 30 | new AutoLogin(), 31 | new HideModule(), 32 | new LuckMoney(), 33 | new Limits(), 34 | }; 35 | 36 | @Override 37 | public void handleLoadPackage(final LoadPackageParam lpparam) { 38 | if (lpparam.packageName.equals(HookParams.WECHAT_PACKAGE_NAME)) { 39 | try { 40 | XposedHelpers.findAndHookMethod(ContextWrapper.class, "attachBaseContext", Context.class, new XC_MethodHook() { 41 | @Override 42 | protected void afterHookedMethod(XC_MethodHook.MethodHookParam param) throws Throwable { 43 | super.afterHookedMethod(param); 44 | Context context = (Context) param.args[0]; 45 | String processName = lpparam.processName; 46 | //Only hook important process 47 | if (!processName.equals(HookParams.WECHAT_PACKAGE_NAME) && 48 | !processName.equals(HookParams.WECHAT_PACKAGE_NAME + ":tools") 49 | ) { 50 | return; 51 | } 52 | String versionName = getVersionName(context, HookParams.WECHAT_PACKAGE_NAME); 53 | log("Found wechat version:" + versionName); 54 | if (!HookParams.hasInstance()) { 55 | SearchClasses.init(context, lpparam, versionName); 56 | loadPlugins(lpparam); 57 | } 58 | } 59 | }); 60 | } catch (Error | Exception e) { 61 | } 62 | } 63 | } 64 | 65 | private String getVersionName(Context context, String packageName) { 66 | try { 67 | PackageManager packageManager = context.getPackageManager(); 68 | PackageInfo packInfo = packageManager.getPackageInfo(packageName, 0); 69 | return packInfo.versionName; 70 | } catch (PackageManager.NameNotFoundException e) { 71 | } 72 | return ""; 73 | } 74 | 75 | 76 | private void loadPlugins(LoadPackageParam lpparam) { 77 | for (IPlugin plugin : plugins) { 78 | try { 79 | plugin.hook(lpparam); 80 | } catch (Error | Exception e) { 81 | log("loadPlugins error" + e); 82 | } 83 | } 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/PreferencesUtils.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement; 2 | 3 | 4 | import de.robv.android.xposed.XSharedPreferences; 5 | 6 | public class PreferencesUtils { 7 | 8 | private static XSharedPreferences instance = null; 9 | 10 | private static XSharedPreferences getInstance() { 11 | if (instance == null) { 12 | instance = new XSharedPreferences(PreferencesUtils.class.getPackage().getName()); 13 | instance.makeWorldReadable(); 14 | } else { 15 | instance.reload(); 16 | } 17 | return instance; 18 | } 19 | 20 | public static boolean open() { 21 | return getInstance().getBoolean("open", false); 22 | } 23 | 24 | public static boolean notSelf() { 25 | return getInstance().getBoolean("not_self", false); 26 | } 27 | 28 | public static boolean notWhisper() { 29 | return getInstance().getBoolean("not_whisper", false); 30 | } 31 | 32 | public static String notContains() { 33 | return getInstance().getString("not_contains", "").replace(",", ","); 34 | } 35 | 36 | public static boolean delay() { 37 | return getInstance().getBoolean("delay", false); 38 | } 39 | 40 | public static int delayMin() { 41 | return getInstance().getInt("delay_min", 0); 42 | } 43 | 44 | public static int delayMax() { 45 | return getInstance().getInt("delay_max", 0); 46 | } 47 | 48 | public static boolean receiveTransfer() { 49 | return getInstance().getBoolean("receive_transfer", true); 50 | } 51 | 52 | public static boolean quickOpen() { 53 | return getInstance().getBoolean("quick_open", true); 54 | } 55 | 56 | public static boolean showWechatId() { 57 | return getInstance().getBoolean("show_wechat_id", false); 58 | } 59 | 60 | public static String blackList() { 61 | return getInstance().getString("black_list", "").replace(",", ","); 62 | } 63 | 64 | public static boolean isAntiRevoke() { 65 | return getInstance().getBoolean("is_anti_revoke", false); 66 | } 67 | 68 | public static boolean isAntiSnsDelete() { 69 | return getInstance().getBoolean("is_anti_sns_delete", false); 70 | } 71 | 72 | public static boolean isAutoLogin() { 73 | return getInstance().getBoolean("is_auto_login", false); 74 | } 75 | 76 | public static boolean isBreakLimit() { 77 | return getInstance().getBoolean("is_break_limit", false); 78 | } 79 | 80 | } 81 | 82 | 83 | -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/RangePreference.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement; 2 | 3 | 4 | import android.content.Context; 5 | import android.content.SharedPreferences; 6 | import android.preference.DialogPreference; 7 | import android.util.AttributeSet; 8 | import android.view.View; 9 | import android.widget.TextView; 10 | 11 | public class RangePreference extends DialogPreference { 12 | 13 | private TextView startEditText, endEditText; 14 | 15 | private String startKey, endKey; 16 | 17 | public RangePreference(Context context, AttributeSet attrs) { 18 | super(context, attrs); 19 | setDialogLayoutResource(R.layout.preference_range); 20 | 21 | 22 | for (int i = 0; i < attrs.getAttributeCount(); i++) { 23 | String attr = attrs.getAttributeName(i); 24 | if (attr.equalsIgnoreCase("start")) { 25 | startKey = attrs.getAttributeValue(i); 26 | } else if (attr.equalsIgnoreCase("end")) { 27 | endKey = attrs.getAttributeValue(i); 28 | } 29 | } 30 | } 31 | 32 | @Override 33 | protected void onBindDialogView(View view) { 34 | super.onBindDialogView(view); 35 | 36 | startEditText = (TextView) view.findViewById(R.id.min_value); 37 | endEditText = (TextView) view.findViewById(R.id.max_value); 38 | 39 | SharedPreferences pref = getSharedPreferences(); 40 | int startValue = pref.getInt(startKey, 0); 41 | int endValue = pref.getInt(endKey, 0); 42 | startEditText.setText(String.valueOf(startValue)); 43 | endEditText.setText(String.valueOf(endValue)); 44 | } 45 | 46 | @Override 47 | protected void onDialogClosed(boolean positiveResult) { 48 | if (positiveResult) { 49 | SharedPreferences.Editor editor = getEditor(); 50 | editor.putInt(startKey, Integer.parseInt(startEditText.getText().toString())); 51 | editor.putInt(endKey, Integer.parseInt(endEditText.getText().toString())); 52 | editor.commit(); 53 | } 54 | super.onDialogClosed(positiveResult); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement; 2 | 3 | 4 | import android.annotation.TargetApi; 5 | import android.app.Application; 6 | import android.app.FragmentManager; 7 | import android.app.ProgressDialog; 8 | import android.content.ComponentName; 9 | import android.content.Context; 10 | import android.content.Intent; 11 | import android.content.SharedPreferences; 12 | import android.content.pm.PackageInfo; 13 | import android.content.pm.PackageManager; 14 | import android.net.Uri; 15 | import android.os.Build; 16 | import android.os.Bundle; 17 | import android.os.Handler; 18 | import android.os.Looper; 19 | import android.preference.Preference; 20 | import android.preference.Preference.OnPreferenceClickListener; 21 | import android.preference.PreferenceFragment; 22 | import android.support.v7.app.AppCompatActivity; 23 | import android.widget.Toast; 24 | 25 | import com.google.gson.Gson; 26 | 27 | import java.lang.reflect.Method; 28 | 29 | import dalvik.system.PathClassLoader; 30 | import me.firesun.wechat.enhancement.util.HookParams; 31 | import me.firesun.wechat.enhancement.util.SearchClasses; 32 | 33 | 34 | public class SettingsActivity extends AppCompatActivity { 35 | 36 | private SettingsFragment mSettingsFragment; 37 | 38 | @Override 39 | protected void onCreate(Bundle savedInstanceState) { 40 | super.onCreate(savedInstanceState); 41 | setContentView(R.layout.activity_settings); 42 | if (savedInstanceState == null) { 43 | mSettingsFragment = new SettingsFragment(); 44 | replaceFragment(R.id.settings_container, mSettingsFragment); 45 | } 46 | 47 | } 48 | 49 | @TargetApi(Build.VERSION_CODES.HONEYCOMB) 50 | public void replaceFragment(int viewId, android.app.Fragment fragment) { 51 | FragmentManager fragmentManager = getFragmentManager(); 52 | fragmentManager.beginTransaction().replace(viewId, fragment).commit(); 53 | } 54 | 55 | /** 56 | * A placeholder fragment containing a settings view. 57 | */ 58 | public static class SettingsFragment extends PreferenceFragment { 59 | @Override 60 | public void onCreate(final Bundle savedInstanceState) { 61 | super.onCreate(savedInstanceState); 62 | 63 | getPreferenceManager().setSharedPreferencesMode(MODE_WORLD_READABLE); 64 | addPreferencesFromResource(R.xml.pref_setting); 65 | 66 | Preference reset = findPreference("author"); 67 | reset.setOnPreferenceClickListener(new OnPreferenceClickListener() { 68 | @Override 69 | public boolean onPreferenceClick(Preference pref) { 70 | Intent intent = new Intent(); 71 | intent.setAction("android.intent.action.VIEW"); 72 | intent.setData(Uri.parse("https://github.com/firesunCN")); 73 | startActivity(intent); 74 | return true; 75 | } 76 | }); 77 | 78 | Preference show_icon = findPreference("show_icon"); 79 | show_icon.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { 80 | @Override 81 | public boolean onPreferenceChange(Preference preference, Object isChecked) { 82 | PackageManager packageManager = getActivity().getPackageManager(); 83 | int status = (boolean) isChecked ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED; 84 | packageManager.setComponentEnabledSetting(new ComponentName(getActivity(), "me.firesun.wechat.enhancement.SettingsActivity_Alias"), status, PackageManager.DONT_KILL_APP); 85 | return true; 86 | } 87 | }); 88 | 89 | Preference repair = findPreference("repair"); 90 | repair.setOnPreferenceClickListener(new OnPreferenceClickListener() { 91 | @Override 92 | public boolean onPreferenceClick(Preference pref) { 93 | Context context = getApplication(); 94 | if (context != null) { 95 | SharedPreferences.Editor editor = context.getSharedPreferences(HookParams.WECHAT_ENHANCEMENT_CONFIG_NAME, Context.MODE_WORLD_READABLE).edit(); 96 | editor.clear(); 97 | editor.commit(); 98 | Toast toast = Toast.makeText(context, getString(R.string.repair_done), Toast.LENGTH_SHORT); 99 | toast.show(); 100 | } 101 | return true; 102 | } 103 | }); 104 | 105 | Preference generate = findPreference("generate"); 106 | generate.setOnPreferenceClickListener(new OnPreferenceClickListener() { 107 | @Override 108 | public boolean onPreferenceClick(Preference pref) { 109 | final Context context = getApplication(); 110 | if (context == null) { 111 | return false; 112 | } 113 | final PackageManager packageManager = context.getPackageManager(); 114 | if (packageManager == null) { 115 | return false; 116 | } 117 | 118 | final ProgressDialog dialog = new ProgressDialog(getActivity()); 119 | dialog.setCancelable(false); 120 | dialog.setMessage(getResources().getString(R.string.generating)); 121 | dialog.show(); 122 | 123 | new Thread(new Runnable() { 124 | @Override 125 | public void run() { 126 | boolean success = false; 127 | try { 128 | PackageInfo packageInfo = packageManager.getPackageInfo(HookParams.WECHAT_PACKAGE_NAME, 0); 129 | String wechatApk = packageInfo.applicationInfo.sourceDir; 130 | PathClassLoader wxClassLoader = new PathClassLoader(wechatApk, ClassLoader.getSystemClassLoader()); 131 | SearchClasses.generateConfig(wechatApk, wxClassLoader, packageInfo.versionName); 132 | 133 | String config = new Gson().toJson(HookParams.getInstance()); 134 | SharedPreferences.Editor editor = context.getSharedPreferences(HookParams.WECHAT_ENHANCEMENT_CONFIG_NAME, Context.MODE_WORLD_READABLE).edit(); 135 | editor.clear(); 136 | editor.putString("params", config); 137 | editor.commit(); 138 | 139 | success = true; 140 | 141 | } catch (Throwable e) { 142 | e.printStackTrace(); 143 | } 144 | 145 | final String msg = getResources().getString(success ? R.string.generate_success : R.string.generate_failed); 146 | new Handler(Looper.getMainLooper()).post(new Runnable() { 147 | @Override 148 | public void run() { 149 | dialog.dismiss(); 150 | Toast.makeText(getApplication(), msg, Toast.LENGTH_SHORT).show(); 151 | } 152 | }); 153 | } 154 | }, "generate-config").start(); 155 | 156 | return true; 157 | } 158 | }); 159 | } 160 | 161 | private Application getApplication() { 162 | try { 163 | final Class activityThreadClass = 164 | Class.forName("android.app.ActivityThread"); 165 | final Method method = activityThreadClass.getMethod("currentApplication"); 166 | return (Application) method.invoke(null, (Object[]) null); 167 | } catch (Exception e) { 168 | } 169 | return null; 170 | } 171 | 172 | } 173 | 174 | } 175 | -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/plugin/AntiRevoke.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement.plugin; 2 | 3 | import android.content.ContentValues; 4 | 5 | 6 | import java.io.File; 7 | import java.util.Arrays; 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | 11 | import de.robv.android.xposed.XC_MethodHook; 12 | import de.robv.android.xposed.XposedHelpers; 13 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 14 | import me.firesun.wechat.enhancement.PreferencesUtils; 15 | import me.firesun.wechat.enhancement.util.HookParams; 16 | 17 | 18 | public class AntiRevoke implements IPlugin { 19 | private static Map msgCacheMap = new HashMap<>(); 20 | private static Object storageInsertClazz; 21 | 22 | @Override 23 | public void hook(XC_LoadPackage.LoadPackageParam lpparam) { 24 | XposedHelpers.findAndHookMethod(HookParams.getInstance().SQLiteDatabaseClassName, lpparam.classLoader, HookParams.getInstance().SQLiteDatabaseUpdateMethod, String.class, ContentValues.class, String.class, String[].class, int.class, new XC_MethodHook() { 25 | @Override 26 | protected void beforeHookedMethod(MethodHookParam param) { 27 | try { 28 | if (!PreferencesUtils.isAntiRevoke()) { 29 | return; 30 | } 31 | 32 | if (param.args[0].equals("message")) { 33 | ContentValues contentValues = ((ContentValues) param.args[1]); 34 | 35 | if (contentValues.getAsInteger("type") == 10000 && 36 | !contentValues.getAsString("content").equals("你撤回了一条消息") && 37 | !contentValues.getAsString("content").equals("You've recalled a message") && 38 | !contentValues.getAsString("content").startsWith("> 7) > 0) { 134 | byte[] res = {(byte) (msgSize & 0x7F | 0x80), (byte) (msgSize >> 7)}; 135 | return res; 136 | } else { 137 | byte[] res = {(byte) msgSize}; 138 | return res; 139 | } 140 | } 141 | 142 | private byte[] concatAll(byte[] first, byte[]... rest) { 143 | int totalLength = first.length; 144 | for (byte[] array : rest) { 145 | totalLength += array.length; 146 | } 147 | byte[] result = Arrays.copyOf(first, totalLength); 148 | int offset = first.length; 149 | for (byte[] array : rest) { 150 | System.arraycopy(array, 0, result, offset, array.length); 151 | offset += array.length; 152 | } 153 | return result; 154 | } 155 | 156 | 157 | } 158 | -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/plugin/AutoLogin.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement.plugin; 2 | 3 | 4 | import android.app.Activity; 5 | import android.widget.Button; 6 | 7 | import java.lang.reflect.Field; 8 | 9 | import de.robv.android.xposed.XC_MethodHook; 10 | import de.robv.android.xposed.XposedHelpers; 11 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 12 | import me.firesun.wechat.enhancement.PreferencesUtils; 13 | import me.firesun.wechat.enhancement.util.HookParams; 14 | 15 | 16 | public class AutoLogin implements IPlugin { 17 | @Override 18 | public void hook(XC_LoadPackage.LoadPackageParam lpparam) { 19 | XposedHelpers.findAndHookMethod(android.app.Activity.class, "onStart", new XC_MethodHook() { 20 | @Override 21 | protected void beforeHookedMethod(MethodHookParam param) { 22 | try { 23 | if (!PreferencesUtils.isAutoLogin()) 24 | return; 25 | if (!(param.thisObject instanceof Activity)) { 26 | return; 27 | } 28 | Activity activity = (Activity) param.thisObject; 29 | if (activity.getClass().getName().equals(HookParams.getInstance().WebWXLoginUIClassName)) { 30 | Class clazz = activity.getClass(); 31 | Field field = XposedHelpers.findFirstFieldByExactType(clazz, Button.class); 32 | Button button = (Button) field.get(activity); 33 | if (button != null) { 34 | button.performClick(); 35 | } 36 | } 37 | 38 | } catch (Error | Exception e) { 39 | } 40 | } 41 | }); 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/plugin/HideModule.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement.plugin; 2 | 3 | import android.app.ActivityManager; 4 | import android.content.pm.ApplicationInfo; 5 | import android.content.pm.PackageInfo; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | import de.robv.android.xposed.XC_MethodHook; 11 | import de.robv.android.xposed.XposedHelpers; 12 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 13 | import me.firesun.wechat.enhancement.util.HookParams; 14 | 15 | 16 | public class HideModule implements IPlugin { 17 | @Override 18 | public void hook(XC_LoadPackage.LoadPackageParam lpparam) { 19 | XposedHelpers.findAndHookMethod("android.app.ApplicationPackageManager", lpparam.classLoader, "getInstalledApplications", int.class, new XC_MethodHook() { 20 | @Override 21 | protected void afterHookedMethod(MethodHookParam param) { 22 | try { 23 | List applicationList = (List) param.getResult(); 24 | List resultApplicationList = new ArrayList<>(); 25 | for (ApplicationInfo applicationInfo : applicationList) { 26 | String packageName = applicationInfo.packageName; 27 | if (!(packageName.contains("me.firesun") || packageName.contains("me.weishu") || packageName.contains("xposed"))) { 28 | resultApplicationList.add(applicationInfo); 29 | } 30 | } 31 | param.setResult(resultApplicationList); 32 | } catch (Error | Exception e) { 33 | } 34 | 35 | } 36 | }); 37 | 38 | XposedHelpers.findAndHookMethod("android.app.ApplicationPackageManager", lpparam.classLoader, "getInstalledPackages", int.class, new XC_MethodHook() { 39 | @Override 40 | protected void afterHookedMethod(MethodHookParam param) { 41 | try { 42 | List packageInfoList = (List) param.getResult(); 43 | List resultpackageInfoList = new ArrayList<>(); 44 | 45 | for (PackageInfo packageInfo : packageInfoList) { 46 | String packageName = packageInfo.packageName; 47 | if (!(packageName.contains("firesun") || packageName.contains("xposed"))) { 48 | resultpackageInfoList.add(packageInfo); 49 | } 50 | } 51 | param.setResult(resultpackageInfoList); 52 | } catch (Error | Exception e) { 53 | } 54 | } 55 | }); 56 | 57 | XposedHelpers.findAndHookMethod("android.app.ApplicationPackageManager", lpparam.classLoader, "getPackageInfo", String.class, int.class, new XC_MethodHook() { 58 | @Override 59 | protected void beforeHookedMethod(MethodHookParam param) { 60 | try { 61 | String packageName = (String) param.args[0]; 62 | if (packageName.contains("firesun") || packageName.contains("xposed")) { 63 | param.args[0] = HookParams.WECHAT_PACKAGE_NAME; 64 | } 65 | } catch (Error | Exception e) { 66 | } 67 | } 68 | }); 69 | 70 | XposedHelpers.findAndHookMethod("android.app.ApplicationPackageManager", lpparam.classLoader, "getApplicationInfo", String.class, int.class, new XC_MethodHook() { 71 | @Override 72 | protected void beforeHookedMethod(MethodHookParam param) { 73 | try { 74 | String packageName = (String) param.args[0]; 75 | if (packageName.contains("firesun") || packageName.contains("xposed")) { 76 | param.args[0] = HookParams.WECHAT_PACKAGE_NAME; 77 | } 78 | } catch (Error | Exception e) { 79 | } 80 | } 81 | }); 82 | 83 | XposedHelpers.findAndHookMethod("android.app.ActivityManager", lpparam.classLoader, "getRunningServices", int.class, new XC_MethodHook() { 84 | @Override 85 | protected void afterHookedMethod(MethodHookParam param) { 86 | try { 87 | List serviceInfoList = (List) param.getResult(); 88 | List resultList = new ArrayList<>(); 89 | 90 | for (ActivityManager.RunningServiceInfo runningServiceInfo : serviceInfoList) { 91 | String serviceName = runningServiceInfo.process; 92 | if (!(serviceName.contains("firesun") || serviceName.contains("xposed"))) { 93 | resultList.add(runningServiceInfo); 94 | } 95 | } 96 | param.setResult(resultList); 97 | } catch (Error | Exception e) { 98 | } 99 | } 100 | }); 101 | 102 | XposedHelpers.findAndHookMethod("android.app.ActivityManager", lpparam.classLoader, "getRunningTasks", int.class, new XC_MethodHook() { 103 | @Override 104 | protected void afterHookedMethod(MethodHookParam param) { 105 | try { 106 | List serviceInfoList = (List) param.getResult(); 107 | List resultList = new ArrayList<>(); 108 | 109 | for (ActivityManager.RunningTaskInfo runningTaskInfo : serviceInfoList) { 110 | String taskName = runningTaskInfo.baseActivity.flattenToString(); 111 | if (!(taskName.contains("firesun") || taskName.contains("xposed"))) { 112 | resultList.add(runningTaskInfo); 113 | } 114 | } 115 | param.setResult(resultList); 116 | } catch (Error | Exception e) { 117 | } 118 | } 119 | }); 120 | 121 | XposedHelpers.findAndHookMethod("android.app.ActivityManager", lpparam.classLoader, "getRunningAppProcesses", new XC_MethodHook() { 122 | @Override 123 | protected void afterHookedMethod(MethodHookParam param) { 124 | try { 125 | List runningAppProcessInfos = (List) param.getResult(); 126 | List resultList = new ArrayList<>(); 127 | 128 | for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : runningAppProcessInfos) { 129 | String processName = runningAppProcessInfo.processName; 130 | if (!(processName.contains("firesun") || processName.contains("xposed"))) { 131 | resultList.add(runningAppProcessInfo); 132 | } 133 | } 134 | param.setResult(resultList); 135 | } catch (Error | Exception e) { 136 | } 137 | } 138 | }); 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/plugin/IPlugin.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement.plugin; 2 | 3 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 4 | 5 | public interface IPlugin { 6 | public void hook(XC_LoadPackage.LoadPackageParam lpparam); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/plugin/Limits.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement.plugin; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.graphics.Color; 7 | import android.view.Menu; 8 | import android.view.MenuItem; 9 | import android.widget.CheckBox; 10 | import android.widget.CompoundButton; 11 | import android.widget.HeaderViewListAdapter; 12 | import android.widget.LinearLayout; 13 | import android.widget.LinearLayout.LayoutParams; 14 | import android.widget.ListAdapter; 15 | import android.widget.ListView; 16 | import android.widget.TextView; 17 | 18 | import java.lang.reflect.Field; 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import de.robv.android.xposed.XC_MethodHook; 23 | import de.robv.android.xposed.XposedHelpers; 24 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 25 | import me.firesun.wechat.enhancement.PreferencesUtils; 26 | import me.firesun.wechat.enhancement.util.HookParams; 27 | 28 | import static de.robv.android.xposed.XposedBridge.log; 29 | 30 | 31 | public class Limits implements IPlugin { 32 | @Override 33 | public void hook(XC_LoadPackage.LoadPackageParam lpparam) { 34 | 35 | XposedHelpers.findAndHookMethod(android.app.Activity.class, "onCreate", android.os.Bundle.class, new XC_MethodHook() { 36 | @Override 37 | protected void beforeHookedMethod(MethodHookParam param) { 38 | try { 39 | if (!PreferencesUtils.isBreakLimit()) 40 | return; 41 | Activity activity = (Activity) param.thisObject; 42 | String className = activity.getClass().getName(); 43 | if (className.equals(HookParams.getInstance().AlbumPreviewUIClassName)) { 44 | Intent intent = activity.getIntent(); 45 | if (intent == null) { 46 | return; 47 | } 48 | int oldLimit = intent.getIntExtra("max_select_count", 9); 49 | int newLimit = 1000; 50 | if (oldLimit <= 9) { 51 | intent.putExtra("max_select_count", oldLimit + newLimit - 9); 52 | } 53 | } 54 | 55 | if (className.equals(HookParams.getInstance().SelectContactUIClassName)) { 56 | Intent intent = activity.getIntent(); 57 | if (intent == null) { 58 | return; 59 | } 60 | 61 | if (intent.getIntExtra("max_limit_num", -1) == 9) { 62 | intent.putExtra("max_limit_num", Integer.MAX_VALUE); 63 | } 64 | } 65 | 66 | } catch (Error | Exception e) { 67 | log("error:" + e); 68 | } 69 | } 70 | }); 71 | 72 | XposedHelpers.findAndHookMethod(HookParams.getInstance().MMActivityClassName, lpparam.classLoader, "onCreateOptionsMenu", Menu.class, new XC_MethodHook() { 73 | @Override 74 | protected void afterHookedMethod(MethodHookParam param) { 75 | 76 | try { 77 | if (!PreferencesUtils.isBreakLimit()) 78 | return; 79 | 80 | 81 | final Activity activity = (Activity) param.thisObject; 82 | Menu menu = (Menu) param.args[0]; 83 | if (!activity.getClass().getName().equals(HookParams.getInstance().SelectContactUIClassName)) { 84 | return; 85 | } 86 | 87 | Intent intent = activity.getIntent(); 88 | if (intent == null) 89 | return; 90 | boolean checked = intent.getBooleanExtra("select_all_checked", false); 91 | 92 | MenuItem selectAll = menu.add(0, 2, 0, ""); 93 | selectAll.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); 94 | TextView btnText = new TextView(activity); 95 | btnText.setTextColor(Color.WHITE); 96 | btnText.setText("全选"); 97 | 98 | LayoutParams layoutParams = new LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, 99 | LinearLayout.LayoutParams.WRAP_CONTENT); 100 | Context context = btnText.getContext(); 101 | float scale = context.getResources().getDisplayMetrics().density; 102 | layoutParams.setMarginEnd((int) ((float) 4 * scale + 0.5F)); 103 | btnText.setLayoutParams(layoutParams); 104 | 105 | CheckBox btnCheckbox = new CheckBox(activity); 106 | btnCheckbox.setChecked(checked); 107 | btnCheckbox.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener() { 108 | @Override 109 | public void onCheckedChanged(CompoundButton buttonView, 110 | boolean isChecked) { 111 | onSelectContactUISelectAll(activity, isChecked); 112 | } 113 | 114 | }); 115 | 116 | layoutParams = new LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, 117 | LinearLayout.LayoutParams.WRAP_CONTENT); 118 | 119 | context = btnCheckbox.getContext(); 120 | scale = context.getResources().getDisplayMetrics().density; 121 | layoutParams.setMarginEnd((int) ((float) 6 * scale + 0.5F)); 122 | btnCheckbox.setLayoutParams(layoutParams); 123 | 124 | 125 | LinearLayout actionView = new LinearLayout(activity); 126 | actionView.addView(btnText); 127 | actionView.addView(btnCheckbox); 128 | actionView.setOrientation(LinearLayout.HORIZONTAL); 129 | selectAll.setActionView(actionView); 130 | } catch (Error | Exception e) { 131 | } 132 | } 133 | }); 134 | 135 | XposedHelpers.findAndHookMethod(HookParams.getInstance().SelectContactUIClassName, lpparam.classLoader, "onActivityResult", int.class, int.class, Intent.class, new XC_MethodHook() { 136 | @Override 137 | protected void beforeHookedMethod(MethodHookParam param) { 138 | try { 139 | if (!PreferencesUtils.isBreakLimit()) 140 | return; 141 | int requestCode = (int) param.args[0]; 142 | int resultCode = (int) param.args[1]; 143 | Intent data = (Intent) param.args[2]; 144 | 145 | if (requestCode == 5) { 146 | Activity activity = (Activity) param.thisObject; 147 | activity.setResult(resultCode, data); 148 | activity.finish(); 149 | param.setResult(null); 150 | } 151 | } catch (Error | Exception e) { 152 | } 153 | } 154 | }); 155 | 156 | XposedHelpers.findAndHookMethod(HookParams.getInstance().SelectConversationUIClassName, lpparam.classLoader, HookParams.getInstance().SelectConversationUICheckLimitMethod, boolean.class, new XC_MethodHook() { 157 | @Override 158 | protected void beforeHookedMethod(XC_MethodHook.MethodHookParam param) { 159 | try { 160 | if (!PreferencesUtils.isBreakLimit()) 161 | return; 162 | param.setResult(false); 163 | } catch (Error | Exception e) { 164 | 165 | } 166 | 167 | 168 | } 169 | }); 170 | } 171 | 172 | private final void onSelectContactUISelectAll(Activity activity, boolean isChecked) { 173 | try { 174 | Intent intent = activity.getIntent(); 175 | if (intent == null) { 176 | return; 177 | } 178 | intent.putExtra("select_all_checked", isChecked); 179 | intent.putExtra("already_select_contact", ""); 180 | if (isChecked) { 181 | ListView listView = (ListView) XposedHelpers.findFirstFieldByExactType(activity.getClass(), ListView.class).get(activity); 182 | if (listView == null) { 183 | return; 184 | } 185 | 186 | ListAdapter adapter = listView.getAdapter(); 187 | if (adapter == null) { 188 | return; 189 | } 190 | 191 | adapter = ((HeaderViewListAdapter) adapter).getWrappedAdapter(); 192 | 193 | Field contactField = null; 194 | Field usernameField = null; 195 | List userList = new ArrayList(); 196 | 197 | for (int i = 0; i < adapter.getCount(); ++i) { 198 | Object item = adapter.getItem(i); 199 | if (contactField == null) { 200 | Field[] fileds = item.getClass().getFields(); 201 | 202 | for (int j = 0; j < fileds.length; j++) { 203 | Field field = fileds[j]; 204 | field.getType().getName(); 205 | if (field.getType().getName().equals(HookParams.getInstance().ContactInfoClassName)) { 206 | contactField = field; 207 | break; 208 | } 209 | } 210 | 211 | if (contactField == null) { 212 | continue; 213 | } 214 | } 215 | 216 | Object contact = contactField.get(item); 217 | if (contact != null) { 218 | if (usernameField == null) { 219 | Field[] fields = contact.getClass().getFields(); 220 | 221 | for (int j = 0; j < fields.length; j++) { 222 | Field field = fields[j]; 223 | if (field.getName().equals("field_username")) { 224 | usernameField = field; 225 | } 226 | } 227 | 228 | if (usernameField == null) { 229 | continue; 230 | } 231 | } 232 | 233 | Object username = usernameField.get(contact); 234 | if (username != null) { 235 | userList.add((String) username); 236 | } 237 | } 238 | } 239 | intent.putExtra("already_select_contact", stringJoin(",", userList)); 240 | } 241 | activity.startActivityForResult(intent, 5); 242 | } catch (Error | Exception e) { 243 | } 244 | 245 | } 246 | 247 | private static String stringJoin(String join, List strAry) { 248 | StringBuffer sb = new StringBuffer(); 249 | for (int i = 0; i < strAry.size(); i++) { 250 | if (i == (strAry.size() - 1)) { 251 | sb.append(strAry.get(i)); 252 | } else { 253 | sb.append(strAry.get(i)).append(join); 254 | } 255 | } 256 | 257 | return new String(sb); 258 | } 259 | } 260 | -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/plugin/LuckMoney.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement.plugin; 2 | 3 | import android.app.Activity; 4 | import android.content.ClipboardManager; 5 | import android.content.ContentValues; 6 | import android.content.Context; 7 | import android.content.pm.PackageManager; 8 | import android.net.Uri; 9 | import android.os.Bundle; 10 | import android.text.TextUtils; 11 | import android.widget.Button; 12 | import android.widget.Toast; 13 | 14 | import org.json.JSONException; 15 | import org.json.JSONObject; 16 | import org.xmlpull.v1.XmlPullParserException; 17 | 18 | import java.io.IOException; 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import de.robv.android.xposed.XC_MethodHook; 23 | import de.robv.android.xposed.XposedHelpers; 24 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 25 | import me.firesun.wechat.enhancement.PreferencesUtils; 26 | import me.firesun.wechat.enhancement.util.HookParams; 27 | import me.firesun.wechat.enhancement.util.XmlToJson; 28 | 29 | import static android.text.TextUtils.isEmpty; 30 | import static android.widget.Toast.LENGTH_LONG; 31 | import static de.robv.android.xposed.XposedHelpers.callMethod; 32 | import static de.robv.android.xposed.XposedHelpers.callStaticMethod; 33 | import static de.robv.android.xposed.XposedHelpers.findFirstFieldByExactType; 34 | import static de.robv.android.xposed.XposedHelpers.newInstance; 35 | import static me.firesun.wechat.enhancement.util.SearchClasses.getVersionNum; 36 | 37 | 38 | public class LuckMoney implements IPlugin { 39 | private static Object requestCaller; 40 | private static List luckyMoneyMessages = new ArrayList<>(); 41 | 42 | @Override 43 | public void hook(final XC_LoadPackage.LoadPackageParam lpparam) { 44 | XposedHelpers.findAndHookMethod(HookParams.getInstance().SQLiteDatabaseClassName, lpparam.classLoader, HookParams.getInstance().SQLiteDatabaseInsertMethod, String.class, String.class, ContentValues.class, new XC_MethodHook() { 45 | @Override 46 | protected void afterHookedMethod(MethodHookParam param) { 47 | try { 48 | ContentValues contentValues = (ContentValues) param.args[2]; 49 | String tableName = (String) param.args[0]; 50 | if (TextUtils.isEmpty(tableName) || !tableName.equals("message")) { 51 | return; 52 | } 53 | Integer type = contentValues.getAsInteger("type"); 54 | if (null == type) { 55 | return; 56 | } 57 | if (type == 436207665 || type == 469762097) { 58 | handleLuckyMoney(contentValues, lpparam); 59 | } else if (type == 419430449) { 60 | handleTransfer(contentValues, lpparam); 61 | } 62 | } catch (Error | Exception e) { 63 | } 64 | } 65 | }); 66 | 67 | XposedHelpers.findAndHookMethod(HookParams.getInstance().ReceiveLuckyMoneyRequestClassName, lpparam.classLoader, HookParams.getInstance().ReceiveLuckyMoneyRequestMethod, int.class, String.class, JSONObject.class, new XC_MethodHook() { 68 | @Override 69 | protected void beforeHookedMethod(MethodHookParam param) { 70 | try { 71 | if (!HookParams.getInstance().hasTimingIdentifier) { 72 | return; 73 | } 74 | 75 | if (luckyMoneyMessages.size() <= 0) { 76 | return; 77 | } 78 | 79 | String timingIdentifier = ((JSONObject) (param.args[2])).getString("timingIdentifier"); 80 | if (isEmpty(timingIdentifier)) { 81 | return; 82 | } 83 | LuckyMoneyMessage luckyMoneyMessage = luckyMoneyMessages.get(0); 84 | 85 | Class luckyMoneyRequestClass = XposedHelpers.findClass(HookParams.getInstance().LuckyMoneyRequestClassName, lpparam.classLoader); 86 | Object luckyMoneyRequest = newInstance(luckyMoneyRequestClass, 87 | luckyMoneyMessage.getMsgType(), luckyMoneyMessage.getChannelId(), luckyMoneyMessage.getSendId(), luckyMoneyMessage.getNativeUrlString(), "", "", luckyMoneyMessage.getTalker(), "v1.0", timingIdentifier); 88 | callMethod(requestCaller, HookParams.getInstance().RequestCallerMethod, luckyMoneyRequest, getDelayTime()); 89 | luckyMoneyMessages.remove(0); 90 | 91 | } catch (Error | Exception e) { 92 | } 93 | } 94 | }); 95 | 96 | Class receiveUIParamNameClass = XposedHelpers.findClass(HookParams.getInstance().ReceiveUIParamNameClassName, lpparam.classLoader); 97 | XposedHelpers.findAndHookMethod(HookParams.getInstance().LuckyMoneyReceiveUIClassName, lpparam.classLoader, HookParams.getInstance().ReceiveUIMethod, int.class, int.class, String.class, receiveUIParamNameClass, new XC_MethodHook() { 98 | @Override 99 | protected void afterHookedMethod(MethodHookParam param) { 100 | try { 101 | if (PreferencesUtils.quickOpen()) { 102 | Button button = (Button) findFirstFieldByExactType(param.thisObject.getClass(), Button.class).get(param.thisObject); 103 | if (button.isShown() && button.isClickable()) { 104 | button.performClick(); 105 | } 106 | } 107 | } catch (Error | Exception e) { 108 | } 109 | } 110 | }); 111 | 112 | XposedHelpers.findAndHookMethod(HookParams.getInstance().ContactInfoUIClassName, lpparam.classLoader, "onCreate", Bundle.class, new XC_MethodHook() { 113 | @Override 114 | protected void afterHookedMethod(MethodHookParam param) { 115 | try { 116 | if (PreferencesUtils.showWechatId()) { 117 | Activity activity = (Activity) param.thisObject; 118 | ClipboardManager cmb = (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE); 119 | String wechatId = activity.getIntent().getStringExtra("Contact_User"); 120 | cmb.setText(wechatId); 121 | Toast.makeText(activity, "微信ID:" + wechatId + "已复制到剪切板", LENGTH_LONG).show(); 122 | } 123 | } catch (Error | Exception e) { 124 | } 125 | } 126 | }); 127 | 128 | XposedHelpers.findAndHookMethod(HookParams.getInstance().ChatroomInfoUIClassName, lpparam.classLoader, "onCreate", Bundle.class, new XC_MethodHook() { 129 | @Override 130 | protected void afterHookedMethod(MethodHookParam param) { 131 | try { 132 | if (PreferencesUtils.showWechatId()) { 133 | Activity activity = (Activity) param.thisObject; 134 | String wechatId = activity.getIntent().getStringExtra("RoomInfo_Id"); 135 | ClipboardManager cmb = (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE); 136 | cmb.setText(wechatId); 137 | Toast.makeText(activity, "微信ID:" + wechatId + "已复制到剪切板", LENGTH_LONG).show(); 138 | } 139 | } catch (Error | Exception e) { 140 | } 141 | } 142 | }); 143 | 144 | } 145 | 146 | private void handleLuckyMoney(ContentValues contentValues, XC_LoadPackage.LoadPackageParam lpparam) throws JSONException { 147 | if (!PreferencesUtils.open()) { 148 | return; 149 | } 150 | 151 | int status = contentValues.getAsInteger("status"); 152 | if (status == 4) { 153 | return; 154 | } 155 | 156 | String talker = contentValues.getAsString("talker"); 157 | 158 | String blackList = PreferencesUtils.blackList(); 159 | if (!isEmpty(blackList)) { 160 | for (String wechatId : blackList.split(",")) { 161 | if (talker.equals(wechatId.trim())) { 162 | return; 163 | } 164 | } 165 | } 166 | 167 | int isSend = contentValues.getAsInteger("isSend"); 168 | if (PreferencesUtils.notSelf() && isSend != 0) { 169 | return; 170 | } 171 | 172 | if (PreferencesUtils.notWhisper() && !isGroupTalk(talker)) { 173 | return; 174 | } 175 | 176 | if (!isGroupTalk(talker) && isSend != 0) { 177 | return; 178 | } 179 | 180 | String content = contentValues.getAsString("content"); 181 | if (!content.startsWith("= getVersionNum("8.0.0")) 209 | callMethod(requestCaller, HookParams.getInstance().RequestCallerMethod, newInstance(receiveLuckyMoneyRequestClass, channelId, sendId, nativeUrlString, 0, "v1.0", ""), 0); 210 | else 211 | callMethod(requestCaller, HookParams.getInstance().RequestCallerMethod, newInstance(receiveLuckyMoneyRequestClass, channelId, sendId, nativeUrlString, 0, "v1.0"), 0); 212 | luckyMoneyMessages.add(new LuckyMoneyMessage(msgType, channelId, sendId, nativeUrlString, talker)); 213 | return; 214 | } 215 | 216 | Class luckyMoneyRequestClass = XposedHelpers.findClass(HookParams.getInstance().LuckyMoneyRequestClassName, lpparam.classLoader); 217 | Object luckyMoneyRequest = newInstance(luckyMoneyRequestClass, 218 | msgType, channelId, sendId, nativeUrlString, "", "", talker, "v1.0"); 219 | 220 | callMethod(requestCaller, HookParams.getInstance().RequestCallerMethod, luckyMoneyRequest, getDelayTime()); 221 | } 222 | 223 | private void handleTransfer(ContentValues contentValues, XC_LoadPackage.LoadPackageParam lpparam) throws JSONException { 224 | if (!PreferencesUtils.receiveTransfer()) { 225 | return; 226 | } 227 | JSONObject wcpayinfo = new XmlToJson.Builder(contentValues.getAsString("content")).build() 228 | .getJSONObject("msg").getJSONObject("appmsg").getJSONObject("wcpayinfo"); 229 | 230 | int paysubtype = wcpayinfo.getInt("paysubtype"); 231 | if (paysubtype != 1) { 232 | return; 233 | } 234 | 235 | String transactionId = wcpayinfo.getString("transcationid"); 236 | String transferId = wcpayinfo.getString("transferid"); 237 | int invalidtime = wcpayinfo.getInt("invalidtime"); 238 | 239 | if (null == requestCaller) { 240 | Class networkRequestClass = XposedHelpers.findClass(HookParams.getInstance().NetworkRequestClassName, lpparam.classLoader); 241 | requestCaller = callStaticMethod(networkRequestClass, HookParams.getInstance().GetNetworkByModelMethod); 242 | } 243 | 244 | String talker = contentValues.getAsString("talker"); 245 | 246 | Class getTransferRequestClass = XposedHelpers.findClass(HookParams.getInstance().GetTransferRequestClassName, lpparam.classLoader); 247 | callMethod(requestCaller, HookParams.getInstance().RequestCallerMethod, newInstance(getTransferRequestClass, transactionId, transferId, 0, "confirm", talker, invalidtime), 0); 248 | } 249 | 250 | 251 | private int getDelayTime() { 252 | int delayTime = 0; 253 | if (PreferencesUtils.delay()) { 254 | delayTime = getRandom(PreferencesUtils.delayMin(), PreferencesUtils.delayMax()); 255 | } 256 | return delayTime; 257 | } 258 | 259 | private boolean isGroupTalk(String talker) { 260 | return talker.endsWith("@chatroom"); 261 | } 262 | 263 | 264 | private int getRandom(int min, int max) { 265 | return min + (int) (Math.random() * (max - min + 1)); 266 | } 267 | 268 | 269 | } 270 | 271 | class LuckyMoneyMessage { 272 | 273 | private int msgType; 274 | 275 | private int channelId; 276 | 277 | private String sendId; 278 | 279 | private String nativeUrlString; 280 | 281 | private String talker; 282 | 283 | public LuckyMoneyMessage(int msgType, int channelId, String sendId, String nativeUrlString, String talker) { 284 | this.msgType = msgType; 285 | this.channelId = channelId; 286 | this.sendId = sendId; 287 | this.nativeUrlString = nativeUrlString; 288 | this.talker = talker; 289 | } 290 | 291 | public int getMsgType() { 292 | return msgType; 293 | } 294 | 295 | public int getChannelId() { 296 | return channelId; 297 | } 298 | 299 | public String getSendId() { 300 | return sendId; 301 | } 302 | 303 | public String getNativeUrlString() { 304 | return nativeUrlString; 305 | } 306 | 307 | public String getTalker() { 308 | return talker; 309 | } 310 | 311 | } -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/util/ConfigReceiver.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement.util; 2 | 3 | 4 | import android.content.BroadcastReceiver; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.content.SharedPreferences; 8 | import android.os.Bundle; 9 | 10 | 11 | public class ConfigReceiver extends BroadcastReceiver { 12 | 13 | @Override 14 | public void onReceive(Context context, Intent intent) { 15 | try { 16 | String action = intent.getAction(); 17 | Bundle extras = intent.getExtras(); 18 | boolean hasExtras = extras != null; 19 | if (HookParams.SAVE_WECHAT_ENHANCEMENT_CONFIG.equals(action)) { 20 | if (hasExtras) { 21 | SharedPreferences.Editor editor = context.getSharedPreferences(HookParams.WECHAT_ENHANCEMENT_CONFIG_NAME, Context.MODE_WORLD_READABLE).edit(); 22 | editor.clear(); 23 | editor.putString("params", extras.getString("params")); 24 | editor.commit(); 25 | } 26 | } 27 | } catch (Error | Exception e) { 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/util/HookParams.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement.util; 2 | 3 | public class HookParams { 4 | public static final String SAVE_WECHAT_ENHANCEMENT_CONFIG = "wechat.intent.action.SAVE_WECHAT_ENHANCEMENT_CONFIG"; 5 | public static final String WECHAT_ENHANCEMENT_CONFIG_NAME = "wechat_enhancement_config"; 6 | public static final String WECHAT_PACKAGE_NAME = "com.tencent.mm"; 7 | public static final int VERSION_CODE = 47; //大版本变动时候才需要修改 8 | 9 | public String SQLiteDatabaseClassName = "com.tencent.wcdb.database.SQLiteDatabase"; 10 | public String SQLiteDatabaseUpdateMethod = "updateWithOnConflict"; 11 | public String SQLiteDatabaseInsertMethod = "insert"; 12 | public String SQLiteDatabaseDeleteMethod = "delete"; 13 | public String ContactInfoUIClassName = "com.tencent.mm.plugin.profile.ui.ContactInfoUI"; 14 | 15 | public String ContactInfoClassName; 16 | public String ChatroomInfoUIClassName = "com.tencent.mm.plugin.chatroom.ui.ChatroomInfoUI"; 17 | public String WebWXLoginUIClassName = "com.tencent.mm.plugin.webwx.ui.ExtDeviceWXLoginUI"; 18 | public String AlbumPreviewUIClassName = "com.tencent.mm.plugin.gallery.ui.AlbumPreviewUI"; 19 | public String SelectContactUIClassName = "com.tencent.mm.ui.contact.SelectContactUI"; 20 | public String MMActivityClassName = "com.tencent.mm.ui.MMActivity"; 21 | public String SelectConversationUIClassName = "com.tencent.mm.ui.transmit.SelectConversationUI"; 22 | public String SelectConversationUICheckLimitMethod; 23 | public String LuckyMoneyReceiveUIClassName = "com.tencent.mm.plugin.luckymoney.ui.LuckyMoneyReceiveUI"; 24 | public String XMLParserClassName; 25 | public String XMLParserMethod; 26 | public String MsgInfoClassName; 27 | public String MsgInfoStorageClassName; 28 | public String MsgInfoStorageInsertMethod; 29 | public String ReceiveUIParamNameClassName; 30 | public String ReceiveUIMethod; 31 | public String NetworkRequestClassName; 32 | public String RequestCallerClassName; 33 | public String RequestCallerMethod; 34 | public String GetNetworkByModelMethod; 35 | public String ReceiveLuckyMoneyRequestClassName; 36 | public String ReceiveLuckyMoneyRequestMethod; 37 | public String LuckyMoneyRequestClassName; 38 | public String GetTransferRequestClassName; 39 | public boolean hasTimingIdentifier = true; 40 | public String versionName; 41 | public int versionCode; 42 | 43 | private static HookParams instance = null; 44 | 45 | private HookParams() { 46 | } 47 | 48 | public static HookParams getInstance() { 49 | if (instance == null) 50 | instance = new HookParams(); 51 | return instance; 52 | } 53 | 54 | public static void setInstance(HookParams i) { 55 | instance = i; 56 | } 57 | 58 | public static boolean hasInstance() { 59 | return instance != null; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/util/ReflectionUtil.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement.util; 2 | 3 | 4 | import android.util.Log; 5 | 6 | import net.dongliu.apk.parser.bean.DexClass; 7 | 8 | import java.lang.reflect.Field; 9 | import java.lang.reflect.Method; 10 | import java.util.ArrayList; 11 | import java.util.Arrays; 12 | import java.util.HashMap; 13 | import java.util.LinkedList; 14 | import java.util.List; 15 | import java.util.Map; 16 | 17 | import de.robv.android.xposed.XposedBridge; 18 | 19 | public final class ReflectionUtil { 20 | 21 | private static final Map classesCache = new HashMap(); 22 | 23 | private static boolean xposedExist; 24 | 25 | static { 26 | try { 27 | Class.forName("de.robv.android.xposed.XposedBridge"); 28 | xposedExist = true; 29 | } catch (ClassNotFoundException e) { 30 | xposedExist = false; 31 | } 32 | } 33 | 34 | public static void log(String msg) { 35 | if (msg == null) { 36 | return; 37 | } 38 | 39 | if (xposedExist) { 40 | XposedBridge.log(msg); 41 | } else { 42 | Log.i("Xposed", "[WechatEnhancement] " + msg); 43 | } 44 | } 45 | 46 | public static Method findMethodsByExactParameters(Class clazz, Class returnType, Class... parameterTypes) { 47 | if (clazz == null) { 48 | return null; 49 | } 50 | 51 | // List list = Arrays.asList(XposedHelpers.findMethodsByExactParameters(clazz, returnType, (Class[]) Arrays.copyOf(parameterTypes, parameterTypes.length))); 52 | List list = Arrays.asList(findMethodsByExactParametersInner(clazz, returnType, (Class[]) Arrays.copyOf(parameterTypes, parameterTypes.length))); 53 | if (list.isEmpty()) 54 | return null; 55 | else if (list.size() > 1) { 56 | log("find too many methods"); 57 | for (int i = 0; i < list.size(); i++) { 58 | log("methods" + i + ": " + list.get(i)); 59 | } 60 | } 61 | 62 | return list.get(0); 63 | } 64 | 65 | public static final String getClassName(DexClass clazz) { 66 | String str = clazz.getClassType().replace('/', '.'); 67 | return str.substring(1, str.length() - 1); 68 | } 69 | 70 | public static Classes findClassesFromPackage(ClassLoader loader, List classes, String packageName, int depth) { 71 | if (classesCache.containsKey(packageName + depth)) { 72 | return (Classes) classesCache.get(packageName + depth); 73 | } 74 | 75 | List classNameList = new ArrayList(); 76 | for (int i = 0; i < classes.size(); i++) { 77 | String clazz = classes.get(i); 78 | String currentPackage = clazz.substring(0, clazz.lastIndexOf(".")); 79 | for (int j = 0; j < depth; j++) { 80 | int pos = currentPackage.lastIndexOf("."); 81 | if (pos < 0) 82 | break; 83 | currentPackage = currentPackage.substring(0, currentPackage.lastIndexOf(".")); 84 | } 85 | if (currentPackage.equals(packageName)) { 86 | classNameList.add(clazz); 87 | } 88 | } 89 | List classList = new ArrayList(); 90 | for (int i = 0; i < classNameList.size(); i++) { 91 | String className = classNameList.get(i); 92 | Class c = findClassIfExists(className, loader); 93 | if (c != null) { 94 | classList.add(c); 95 | } 96 | } 97 | Classes cs = new Classes(classList); 98 | classesCache.put(packageName + depth, cs); 99 | return cs; 100 | } 101 | 102 | private static Map methodCache = new HashMap<>(); 103 | 104 | private static String getParametersString(Class... clazzes) { 105 | StringBuilder sb = new StringBuilder("("); 106 | boolean first = true; 107 | for (Class clazz : clazzes) { 108 | if (first) 109 | first = false; 110 | else 111 | sb.append(","); 112 | 113 | if (clazz != null) 114 | sb.append(clazz.getCanonicalName()); 115 | else 116 | sb.append("null"); 117 | } 118 | sb.append(")"); 119 | return sb.toString(); 120 | } 121 | 122 | public static Method findMethodExact(Class clazz, String methodName, Class... parameterTypes) { 123 | String fullMethodName = clazz.getName() + '#' + methodName + getParametersString(parameterTypes) + "#exact"; 124 | 125 | if (methodCache.containsKey(fullMethodName)) { 126 | Method method = methodCache.get(fullMethodName); 127 | if (method == null) 128 | throw new NoSuchMethodError(fullMethodName); 129 | return method; 130 | } 131 | 132 | try { 133 | Method method = clazz.getDeclaredMethod(methodName, parameterTypes); 134 | method.setAccessible(true); 135 | methodCache.put(fullMethodName, method); 136 | return method; 137 | } catch (NoSuchMethodException e) { 138 | methodCache.put(fullMethodName, null); 139 | throw new NoSuchMethodError(fullMethodName); 140 | } 141 | } 142 | 143 | public static Method[] findMethodsByExactParametersInner(Class clazz, Class returnType, Class... parameterTypes) { 144 | List result = new LinkedList<>(); 145 | for (Method method : clazz.getDeclaredMethods()) { 146 | if (returnType != null && returnType != method.getReturnType()) 147 | continue; 148 | 149 | Class[] methodParameterTypes = method.getParameterTypes(); 150 | if (parameterTypes.length != methodParameterTypes.length) 151 | continue; 152 | 153 | boolean match = true; 154 | for (int i = 0; i < parameterTypes.length; i++) { 155 | if (parameterTypes[i] != methodParameterTypes[i]) { 156 | match = false; 157 | break; 158 | } 159 | } 160 | 161 | if (!match) 162 | continue; 163 | 164 | method.setAccessible(true); 165 | result.add(method); 166 | } 167 | return result.toArray(new Method[result.size()]); 168 | } 169 | 170 | public static final Method findMethodExactIfExists(Class clazz, String methodName, Class... parameterTypes) { 171 | Method method = null; 172 | try { 173 | method = findMethodExact(clazz, methodName, (Class[]) Arrays.copyOf(parameterTypes, parameterTypes.length)); 174 | } catch (Error | Exception e) { 175 | } 176 | return method; 177 | } 178 | 179 | public static final Class findClassIfExists(String className, ClassLoader classLoader) { 180 | Class c = null; 181 | try { 182 | c = Class.forName(className, false, classLoader); 183 | } catch (Error | Exception e) { 184 | } 185 | return c; 186 | } 187 | 188 | public static final Field findFieldIfExists(Class clazz, String fieldName) { 189 | if (clazz == null) { 190 | return null; 191 | } 192 | Field field = null; 193 | try { 194 | field = clazz.getField(fieldName); 195 | } catch (Error | Exception e) { 196 | } 197 | return field; 198 | } 199 | 200 | public static final List findFieldsWithType(Class clazz, String typeName) { 201 | List list = new ArrayList(); 202 | if (clazz == null) { 203 | return list; 204 | } 205 | Field[] fields = clazz.getDeclaredFields(); 206 | if (fields != null) { 207 | for (int i = 0; i < fields.length; i++) { 208 | Field field = fields[i]; 209 | Class fieldType = field.getType(); 210 | if (fieldType.getName().equals(typeName)) { 211 | list.add(field); 212 | } 213 | } 214 | } 215 | return list; 216 | } 217 | 218 | public static final class Classes { 219 | private final List classes; 220 | 221 | public Classes(List list) { 222 | this.classes = (List) list; 223 | } 224 | 225 | public final Classes filterByNoMethod(Class cls, Class... clsArr) { 226 | List arrayList = new ArrayList(); 227 | for (Object next : this.classes) { 228 | if (ReflectionUtil.findMethodsByExactParameters((Class) next, cls, (Class[]) Arrays.copyOf(clsArr, clsArr.length)) == null) { 229 | arrayList.add(next); 230 | } 231 | } 232 | return new Classes(arrayList); 233 | } 234 | 235 | public final Classes filterByMethod(Class cls, Class... clsArr) { 236 | List arrayList = new ArrayList(); 237 | for (Object next : this.classes) { 238 | if (ReflectionUtil.findMethodsByExactParameters((Class) next, cls, (Class[]) Arrays.copyOf(clsArr, clsArr.length)) != null) { 239 | arrayList.add(next); 240 | } 241 | } 242 | 243 | return new Classes(arrayList); 244 | } 245 | 246 | public final Classes filterByNoField(String fieldType) { 247 | List arrayList = new ArrayList(); 248 | for (Object next : this.classes) { 249 | if (ReflectionUtil.findFieldsWithType((Class) next, fieldType).isEmpty()) { 250 | arrayList.add(next); 251 | } 252 | } 253 | 254 | return new Classes(arrayList); 255 | } 256 | 257 | public final Classes filterByField(String fieldType) { 258 | List arrayList = new ArrayList(); 259 | for (Object next : this.classes) { 260 | if (!ReflectionUtil.findFieldsWithType((Class) next, fieldType).isEmpty()) { 261 | 262 | arrayList.add(next); 263 | } 264 | } 265 | 266 | return new Classes(arrayList); 267 | } 268 | 269 | public final Classes filterByField(String fieldName, String fieldType) { 270 | List arrayList = new ArrayList(); 271 | for (Object next : this.classes) { 272 | Field field = ReflectionUtil.findFieldIfExists((Class) next, fieldName); 273 | 274 | if (field != null && field.getType().getCanonicalName().equals(fieldType)) { 275 | arrayList.add(next); 276 | } 277 | } 278 | 279 | 280 | return new Classes(arrayList); 281 | } 282 | 283 | public final Classes filterByMethod(Class returnType, String methodName, Class... parameterTypes) { 284 | List arrayList = new ArrayList(); 285 | for (Object next : this.classes) { 286 | Method method = ReflectionUtil.findMethodExactIfExists((Class) next, methodName, (Class[]) Arrays.copyOf(parameterTypes, parameterTypes.length)); 287 | if (method != null && method.getReturnType().getName().equals(returnType.getName())) { 288 | arrayList.add(next); 289 | } 290 | } 291 | 292 | return new Classes(arrayList); 293 | } 294 | 295 | public final Classes filterByMethod(String methodName, Class... parameterTypes) { 296 | List arrayList = new ArrayList(); 297 | for (Object next : this.classes) { 298 | Method method = ReflectionUtil.findMethodExactIfExists((Class) next, methodName, (Class[]) Arrays.copyOf(parameterTypes, parameterTypes.length)); 299 | if (method != null) { 300 | arrayList.add(next); 301 | } 302 | } 303 | 304 | return new Classes(arrayList); 305 | } 306 | 307 | public final Class firstOrNull() { 308 | if (this.classes.isEmpty()) 309 | return null; 310 | else if (this.classes.size() > 1) { 311 | log("find too many classes"); 312 | for (int i = 0; i < this.classes.size(); i++) { 313 | log("class" + i + ": " + this.classes.get(i)); 314 | } 315 | } 316 | return this.classes.get(0); 317 | } 318 | } 319 | } 320 | -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/util/SearchClasses.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement.util; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | import com.google.gson.Gson; 7 | import net.dongliu.apk.parser.ApkFile; 8 | import net.dongliu.apk.parser.bean.DexClass; 9 | import org.json.JSONObject; 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | import de.robv.android.xposed.XSharedPreferences; 13 | import de.robv.android.xposed.XposedHelpers; 14 | import de.robv.android.xposed.callbacks.XC_LoadPackage; 15 | import me.firesun.wechat.enhancement.Main; 16 | import static me.firesun.wechat.enhancement.util.ReflectionUtil.log; 17 | 18 | public class SearchClasses { 19 | private static List wxClasses = new ArrayList<>(); 20 | private static XSharedPreferences preferencesInstance = null; 21 | 22 | public static void init(Context context, XC_LoadPackage.LoadPackageParam lparam, String versionName) { 23 | 24 | if (loadConfig(lparam, versionName)) 25 | return; 26 | 27 | log("failed to load config, start finding..."); 28 | 29 | generateConfig(lparam.appInfo.sourceDir, lparam.classLoader, versionName); 30 | 31 | saveConfig(context); 32 | } 33 | 34 | public static void generateConfig(String wechatApk, ClassLoader classLoader, String versionName) { 35 | 36 | HookParams hp = HookParams.getInstance(); 37 | hp.versionName = versionName; 38 | hp.versionCode = HookParams.VERSION_CODE; 39 | int versionNum = getVersionNum(versionName); 40 | if (versionNum >= getVersionNum("6.5.6") && versionNum <= getVersionNum("6.5.23")) 41 | hp.LuckyMoneyReceiveUIClassName = "com.tencent.mm.plugin.luckymoney.ui.En_fba4b94f"; 42 | if (versionNum < getVersionNum("6.5.8")) 43 | hp.SQLiteDatabaseClassName = "com.tencent.mmdb.database.SQLiteDatabase"; 44 | if (versionNum < getVersionNum("6.5.4")) 45 | hp.hasTimingIdentifier = false; 46 | if (versionNum >= getVersionNum("7.0.0")) 47 | hp.LuckyMoneyReceiveUIClassName = "com.tencent.mm.plugin.luckymoney.ui.LuckyMoneyNotHookReceiveUI"; 48 | if (versionNum >= getVersionNum("7.0.0")) 49 | hp.ChatroomInfoUIClassName = "com.tencent.mm.chatroom.ui.ChatroomInfoUI"; 50 | 51 | ApkFile apkFile = null; 52 | try { 53 | apkFile = new ApkFile(wechatApk); 54 | DexClass[] dexClasses = apkFile.getDexClasses(); 55 | 56 | wxClasses.clear(); 57 | 58 | for (DexClass dexClass : dexClasses) { 59 | wxClasses.add(ReflectionUtil.getClassName(dexClass)); 60 | } 61 | } catch (Error | Exception e) { 62 | log("Open ApkFile Failed!"); 63 | } finally { 64 | try { 65 | apkFile.close(); 66 | } catch (Exception e) { 67 | log("Close ApkFile Failed!"); 68 | } 69 | } 70 | 71 | //LuckMoney 72 | try { 73 | Class ReceiveUIParamNameClass = ReflectionUtil.findClassesFromPackage(classLoader, wxClasses, "com.tencent.mm", 1) 74 | .filterByMethod(String.class, "getInfo") 75 | .filterByMethod(int.class, "getType") 76 | .filterByMethod(void.class, "reset") 77 | .firstOrNull(); 78 | hp.ReceiveUIParamNameClassName = ReceiveUIParamNameClass.getName(); 79 | 80 | Class RequestCallerClass = ReflectionUtil.findClassesFromPackage(classLoader, wxClasses, "com.tencent.mm", 1) 81 | .filterByField("foreground", "boolean") 82 | .filterByMethod(void.class, int.class, String.class, int.class, boolean.class) 83 | .filterByMethod(void.class, "cancel", int.class) 84 | .filterByMethod(void.class, "reset") 85 | .firstOrNull(); 86 | hp.RequestCallerClassName = RequestCallerClass.getName(); 87 | 88 | hp.RequestCallerMethod = ReflectionUtil.findMethodsByExactParameters(RequestCallerClass, 89 | void.class, RequestCallerClass, int.class) 90 | .getName(); 91 | 92 | Class NetworkRequestClass = ReflectionUtil.findClassesFromPackage(classLoader, wxClasses, "com.tencent.mm", 1) 93 | .filterByMethod("getSysCmdMsgExtension") 94 | .filterByMethod(RequestCallerClass) 95 | .firstOrNull(); 96 | hp.NetworkRequestClassName = NetworkRequestClass.getName(); 97 | 98 | hp.GetNetworkByModelMethod = ReflectionUtil.findMethodsByExactParameters(NetworkRequestClass, 99 | RequestCallerClass) 100 | .getName(); 101 | 102 | Class ReceiveLuckyMoneyRequestClass = ReflectionUtil.findClassesFromPackage(classLoader, wxClasses, "com.tencent.mm.plugin.luckymoney", 1) 103 | .filterByField("msgType", "int") 104 | .filterByMethod(void.class, int.class, String.class, JSONObject.class) 105 | .firstOrNull(); 106 | hp.ReceiveLuckyMoneyRequestClassName = ReceiveLuckyMoneyRequestClass.getName(); 107 | 108 | hp.ReceiveLuckyMoneyRequestMethod = ReflectionUtil.findMethodsByExactParameters(ReceiveLuckyMoneyRequestClass, 109 | void.class, int.class, String.class, JSONObject.class) 110 | .getName(); 111 | 112 | hp.LuckyMoneyRequestClassName = ReflectionUtil.findClassesFromPackage(classLoader, wxClasses, "com.tencent.mm.plugin.luckymoney", 1) 113 | .filterByField("talker", "java.lang.String") 114 | .filterByMethod(void.class, int.class, String.class, JSONObject.class) 115 | .filterByMethod(int.class, "getType") 116 | .filterByNoMethod(boolean.class) 117 | .firstOrNull() 118 | .getName(); 119 | 120 | hp.GetTransferRequestClassName = ReflectionUtil.findClassesFromPackage(classLoader, wxClasses, "com.tencent.mm.plugin.remittance", 1) 121 | .filterByField("java.lang.String") 122 | .filterByNoField("int") 123 | 124 | .filterByMethod(void.class, int.class, String.class, JSONObject.class) 125 | .filterByMethod(String.class, "getUri") 126 | .firstOrNull() 127 | .getName(); 128 | 129 | Class LuckyMoneyReceiveUIClass = ReflectionUtil.findClassIfExists(hp.LuckyMoneyReceiveUIClassName, classLoader); 130 | hp.ReceiveUIMethod = ReflectionUtil.findMethodsByExactParameters(LuckyMoneyReceiveUIClass, 131 | boolean.class, int.class, int.class, String.class, ReceiveUIParamNameClass) 132 | .getName(); 133 | 134 | } catch (Error | Exception e) { 135 | log("Search LuckMoney Classes Failed!"); 136 | } 137 | 138 | //AntiRevoke 139 | try { 140 | ReflectionUtil.Classes storageClasses = ReflectionUtil.findClassesFromPackage(classLoader, wxClasses, "com.tencent.mm.storage", 0); 141 | Class MsgInfoClass = storageClasses 142 | .filterByMethod(void.class, "unsetOmittedFailResend") 143 | .firstOrNull(); 144 | hp.MsgInfoClassName = MsgInfoClass.getName(); 145 | if (versionNum < getVersionNum("6.5.8")) { 146 | Class MsgInfoStorageClass = storageClasses 147 | .filterByMethod(long.class, MsgInfoClass) 148 | .firstOrNull(); 149 | hp.MsgInfoStorageClassName = MsgInfoStorageClass.getName(); 150 | hp.MsgInfoStorageInsertMethod = ReflectionUtil.findMethodsByExactParameters(MsgInfoStorageClass, long.class, MsgInfoClass) 151 | .getName(); 152 | } else { 153 | Class MsgInfoStorageClass = storageClasses 154 | .filterByMethod(long.class, MsgInfoClass, boolean.class) 155 | .firstOrNull(); 156 | hp.MsgInfoStorageClassName = MsgInfoStorageClass.getName(); 157 | hp.MsgInfoStorageInsertMethod = ReflectionUtil.findMethodsByExactParameters(MsgInfoStorageClass, long.class, MsgInfoClass, boolean.class) 158 | .getName(); 159 | } 160 | } catch (Error | Exception e) { 161 | log("Search AntiRevoke Classes Failed!"); 162 | } 163 | 164 | 165 | //Photo Limits 166 | try { 167 | Class SelectConversationUIClass = XposedHelpers.findClass(hp.SelectConversationUIClassName, classLoader); 168 | hp.SelectConversationUICheckLimitMethod = ReflectionUtil.findMethodsByExactParameters(SelectConversationUIClass, 169 | boolean.class, boolean.class) 170 | .getName(); 171 | 172 | hp.ContactInfoClassName = ReflectionUtil.findClassesFromPackage(classLoader, wxClasses, "com.tencent.mm.storage", 0) 173 | .filterByMethod(String.class, "getCityCode") 174 | .filterByMethod(String.class, "getCountryCode") 175 | .firstOrNull() 176 | .getName(); 177 | 178 | } catch (Error | Exception e) { 179 | log("Search Photo Limits Classes Failed!"); 180 | } 181 | } 182 | 183 | public static int getVersionNum(String version) { 184 | String[] v = version.split("\\."); 185 | if (v.length == 3) 186 | return Integer.valueOf(v[0]) * 100 * 100 + Integer.valueOf(v[1]) * 100 + Integer.valueOf(v[2]); 187 | else 188 | return 0; 189 | } 190 | 191 | private static boolean loadConfig(XC_LoadPackage.LoadPackageParam lpparam, String curVersionName) { 192 | try { 193 | SharedPreferences pref = getPreferencesInstance(); 194 | HookParams hp = new Gson().fromJson(pref.getString("params", ""), HookParams.class); 195 | 196 | if (hp == null 197 | || !hp.versionName.equals(curVersionName) 198 | || hp.versionCode != HookParams.VERSION_CODE) { 199 | return false; 200 | } 201 | 202 | HookParams.setInstance(hp); 203 | log("load config successful"); 204 | return true; 205 | } catch (Error | Exception e) { 206 | log("load config failed!"); 207 | } 208 | return false; 209 | } 210 | 211 | private static void saveConfig(Context context) { 212 | try { 213 | Intent saveConfigIntent = new Intent(); 214 | saveConfigIntent.setAction(HookParams.SAVE_WECHAT_ENHANCEMENT_CONFIG); 215 | saveConfigIntent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); 216 | saveConfigIntent.putExtra("params", new Gson().toJson(HookParams.getInstance())); 217 | context.sendBroadcast(saveConfigIntent); 218 | log("saving config..."); 219 | } catch (Error | Exception e) { 220 | log("saving config failed!"); 221 | } 222 | } 223 | 224 | private static XSharedPreferences getPreferencesInstance() { 225 | if (preferencesInstance == null) { 226 | preferencesInstance = new XSharedPreferences(Main.class.getPackage().getName(), HookParams.WECHAT_ENHANCEMENT_CONFIG_NAME); 227 | preferencesInstance.makeWorldReadable(); 228 | } else { 229 | preferencesInstance.reload(); 230 | } 231 | return preferencesInstance; 232 | } 233 | 234 | } 235 | -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/util/Tag.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement.util; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | 6 | public class Tag { 7 | 8 | private String mPath; 9 | private String mName; 10 | private ArrayList mChildren = new ArrayList<>(); 11 | private String mContent; 12 | 13 | Tag(String path, String name) { 14 | mPath = path; 15 | mName = name; 16 | } 17 | 18 | void addChild(Tag tag) { 19 | mChildren.add(tag); 20 | } 21 | 22 | String getName() { 23 | return mName; 24 | } 25 | 26 | String getContent() { 27 | return mContent; 28 | } 29 | 30 | void setContent(String content) { 31 | boolean hasContent = false; 32 | if (content != null) { 33 | for (int i = 0; i < content.length(); ++i) { 34 | char c = content.charAt(i); 35 | if ((c != ' ') && (c != '\n')) { 36 | hasContent = true; 37 | break; 38 | } 39 | } 40 | } 41 | if (hasContent) { 42 | mContent = content; 43 | } 44 | } 45 | 46 | ArrayList getChildren() { 47 | return mChildren; 48 | } 49 | 50 | boolean hasChildren() { 51 | return (mChildren.size() > 0); 52 | } 53 | 54 | int getChildrenCount() { 55 | return mChildren.size(); 56 | } 57 | 58 | Tag getChild(int index) { 59 | if ((index >= 0) && (index < mChildren.size())) { 60 | return mChildren.get(index); 61 | } 62 | return null; 63 | } 64 | 65 | HashMap> getGroupedElements() { 66 | HashMap> groups = new HashMap<>(); 67 | for (Tag child : mChildren) { 68 | String key = child.getName(); 69 | ArrayList group = groups.get(key); 70 | if (group == null) { 71 | group = new ArrayList<>(); 72 | groups.put(key, group); 73 | } 74 | group.add(child); 75 | } 76 | return groups; 77 | } 78 | 79 | String getPath() { 80 | return mPath; 81 | } 82 | 83 | @Override 84 | public String toString() { 85 | return "Tag: " + mName + ", " + mChildren.size() + " children, Content: " + mContent; 86 | } 87 | } -------------------------------------------------------------------------------- /app/src/main/java/me/firesun/wechat/enhancement/util/XmlToJson.java: -------------------------------------------------------------------------------- 1 | package me.firesun.wechat.enhancement.util; 2 | 3 | import android.support.annotation.NonNull; 4 | import android.support.annotation.Nullable; 5 | import android.util.Log; 6 | 7 | import org.json.JSONArray; 8 | import org.json.JSONException; 9 | import org.json.JSONObject; 10 | import org.xmlpull.v1.XmlPullParser; 11 | import org.xmlpull.v1.XmlPullParserException; 12 | import org.xmlpull.v1.XmlPullParserFactory; 13 | 14 | import java.io.IOException; 15 | import java.io.InputStream; 16 | import java.io.StringReader; 17 | import java.util.ArrayList; 18 | import java.util.HashMap; 19 | import java.util.HashSet; 20 | import java.util.Iterator; 21 | import java.util.regex.Matcher; 22 | 23 | /** 24 | * Converts XML to JSON 25 | */ 26 | 27 | public class XmlToJson { 28 | 29 | private static final String TAG = "XmlToJson"; 30 | private static final String DEFAULT_CONTENT_NAME = "content"; 31 | private static final String DEFAULT_ENCODING = "utf-8"; 32 | private static final String DEFAULT_INDENTATION = " "; 33 | // default values when a Tag is empty 34 | private static final String DEFAULT_EMPTY_STRING = ""; 35 | private static final int DEFAULT_EMPTY_INTEGER = 0; 36 | private static final long DEFAULT_EMPTY_LONG = 0; 37 | private static final double DEFAULT_EMPTY_DOUBLE = 0; 38 | private static final boolean DEFAULT_EMPTY_BOOLEAN = false; 39 | private String mIndentationPattern = DEFAULT_INDENTATION; 40 | private StringReader mStringSource; 41 | private InputStream mInputStreamSource; 42 | private String mInputEncoding; 43 | private HashSet mForceListPaths; 44 | private HashMap mAttributeNameReplacements; 45 | private HashMap mContentNameReplacements; 46 | private HashMap mForceClassForPath; 47 | private HashSet mSkippedAttributes = new HashSet<>(); 48 | private HashSet mSkippedTags = new HashSet<>(); 49 | private JSONObject mJsonObject; // Used for caching the result 50 | private XmlToJson(Builder builder) { 51 | mStringSource = builder.mStringSource; 52 | mInputEncoding = builder.mInputEncoding; 53 | mForceListPaths = builder.mForceListPaths; 54 | mAttributeNameReplacements = builder.mAttributeNameReplacements; 55 | mContentNameReplacements = builder.mContentNameReplacements; 56 | mForceClassForPath = builder.mForceClassForPath; 57 | mSkippedAttributes = builder.mSkippedAttributes; 58 | mSkippedTags = builder.mSkippedTags; 59 | 60 | mJsonObject = convertToJSONObject(); // Build now so that the InputStream can be closed just after 61 | } 62 | 63 | private 64 | @Nullable 65 | JSONObject convertToJSONObject() { 66 | try { 67 | Tag parentTag = new Tag("", "xml"); 68 | 69 | XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); 70 | factory.setNamespaceAware(false); // tags with namespace are taken as-is ("namespace:tagname") 71 | XmlPullParser xpp = factory.newPullParser(); 72 | 73 | setInput(xpp); 74 | 75 | int eventType = xpp.getEventType(); 76 | while (eventType != XmlPullParser.START_DOCUMENT) { 77 | eventType = xpp.next(); 78 | } 79 | readTags(parentTag, xpp); 80 | 81 | unsetInput(); 82 | 83 | return convertTagToJson(parentTag, false); 84 | } catch (XmlPullParserException | IOException e) { 85 | e.printStackTrace(); 86 | return null; 87 | } 88 | } 89 | 90 | private void setInput(XmlPullParser xpp) { 91 | if (mStringSource != null) { 92 | try { 93 | xpp.setInput(mStringSource); 94 | } catch (XmlPullParserException e) { 95 | e.printStackTrace(); 96 | } 97 | } else { 98 | try { 99 | xpp.setInput(mInputStreamSource, mInputEncoding); 100 | } catch (XmlPullParserException e) { 101 | e.printStackTrace(); 102 | } 103 | } 104 | } 105 | 106 | private void unsetInput() { 107 | if (mStringSource != null) { 108 | mStringSource.close(); 109 | } 110 | // else the InputStream has been given by the user, it is not our role to close it 111 | } 112 | 113 | private void readTags(Tag parent, XmlPullParser xpp) { 114 | try { 115 | int eventType; 116 | do { 117 | eventType = xpp.next(); 118 | if (eventType == XmlPullParser.START_TAG) { 119 | String tagName = xpp.getName(); 120 | String path = parent.getPath() + "/" + tagName; 121 | 122 | boolean skipTag = mSkippedTags.contains(path); 123 | 124 | Tag child = new Tag(path, tagName); 125 | if (!skipTag) { 126 | parent.addChild(child); 127 | } 128 | 129 | // Attributes are taken into account as key/values in the child 130 | int attrCount = xpp.getAttributeCount(); 131 | for (int i = 0; i < attrCount; ++i) { 132 | String attrName = xpp.getAttributeName(i); 133 | String attrValue = xpp.getAttributeValue(i); 134 | String attrPath = parent.getPath() + "/" + child.getName() + "/" + attrName; 135 | 136 | // Skip Attributes 137 | if (mSkippedAttributes.contains(attrPath)) { 138 | continue; 139 | } 140 | 141 | attrName = getAttributeNameReplacement(attrPath, attrName); 142 | Tag attribute = new Tag(attrPath, attrName); 143 | attribute.setContent(attrValue); 144 | child.addChild(attribute); 145 | } 146 | 147 | readTags(child, xpp); 148 | } else if (eventType == XmlPullParser.TEXT) { 149 | String text = xpp.getText(); 150 | parent.setContent(text); 151 | } else if (eventType == XmlPullParser.END_TAG) { 152 | return; 153 | } else { 154 | Log.i(TAG, "unknown xml eventType " + eventType); 155 | } 156 | } while (eventType != XmlPullParser.END_DOCUMENT); 157 | } catch (XmlPullParserException | IOException | NullPointerException e) { 158 | e.printStackTrace(); 159 | } 160 | } 161 | 162 | private JSONObject convertTagToJson(Tag tag, boolean isListElement) { 163 | JSONObject json = new JSONObject(); 164 | 165 | // Content is injected as a key/value 166 | if (tag.getContent() != null) { 167 | String path = tag.getPath(); 168 | String name = getContentNameReplacement(path, DEFAULT_CONTENT_NAME); 169 | putContent(path, json, name, tag.getContent()); 170 | } 171 | 172 | try { 173 | 174 | HashMap> groups = tag.getGroupedElements(); // groups by tag names so that we can detect lists or single elements 175 | for (ArrayList group : groups.values()) { 176 | 177 | if (group.size() == 1) { // element, or list of 1 178 | Tag child = group.get(0); 179 | if (isForcedList(child)) { // list of 1 180 | JSONArray list = new JSONArray(); 181 | list.put(convertTagToJson(child, true)); 182 | String childrenNames = child.getName(); 183 | json.put(childrenNames, list); 184 | } else { // stand alone element 185 | if (child.hasChildren()) { 186 | JSONObject jsonChild = convertTagToJson(child, false); 187 | json.put(child.getName(), jsonChild); 188 | } else { 189 | String path = child.getPath(); 190 | putContent(path, json, child.getName(), child.getContent()); 191 | } 192 | } 193 | } else { // list 194 | JSONArray list = new JSONArray(); 195 | for (Tag child : group) { 196 | list.put(convertTagToJson(child, true)); 197 | } 198 | String childrenNames = group.get(0).getName(); 199 | json.put(childrenNames, list); 200 | } 201 | } 202 | return json; 203 | 204 | } catch (JSONException e) { 205 | e.printStackTrace(); 206 | } 207 | return null; 208 | } 209 | 210 | private void putContent(String path, JSONObject json, String tag, String content) { 211 | try { 212 | // checks if the user wants to force a class (Int, Double... for a given path) 213 | Class forcedClass = mForceClassForPath.get(path); 214 | if (forcedClass == null) { // default behaviour, put it as a String 215 | if (content == null) { 216 | content = DEFAULT_EMPTY_STRING; 217 | } 218 | json.put(tag, content); 219 | } else { 220 | if (forcedClass == Integer.class) { 221 | try { 222 | Integer number = Integer.parseInt(content); 223 | json.put(tag, number); 224 | } catch (NumberFormatException exception) { 225 | json.put(tag, DEFAULT_EMPTY_INTEGER); 226 | } 227 | } else if (forcedClass == Long.class) { 228 | try { 229 | Long number = Long.parseLong(content); 230 | json.put(tag, number); 231 | } catch (NumberFormatException exception) { 232 | json.put(tag, DEFAULT_EMPTY_LONG); 233 | } 234 | } else if (forcedClass == Double.class) { 235 | try { 236 | Double number = Double.parseDouble(content); 237 | json.put(tag, number); 238 | } catch (NumberFormatException exception) { 239 | json.put(tag, DEFAULT_EMPTY_DOUBLE); 240 | } 241 | } else if (forcedClass == Boolean.class) { 242 | if (content == null) { 243 | json.put(tag, DEFAULT_EMPTY_BOOLEAN); 244 | } else if (content.equalsIgnoreCase("true")) { 245 | json.put(tag, true); 246 | } else if (content.equalsIgnoreCase("false")) { 247 | json.put(tag, false); 248 | } else { 249 | json.put(tag, DEFAULT_EMPTY_BOOLEAN); 250 | } 251 | } 252 | } 253 | 254 | } catch (JSONException exception) { 255 | // keep continue in case of error 256 | } 257 | } 258 | 259 | private boolean isForcedList(Tag tag) { 260 | String path = tag.getPath(); 261 | return mForceListPaths.contains(path); 262 | } 263 | 264 | private String getAttributeNameReplacement(String path, String defaultValue) { 265 | String result = mAttributeNameReplacements.get(path); 266 | if (result != null) { 267 | return result; 268 | } 269 | return defaultValue; 270 | } 271 | 272 | private String getContentNameReplacement(String path, String defaultValue) { 273 | String result = mContentNameReplacements.get(path); 274 | if (result != null) { 275 | return result; 276 | } 277 | return defaultValue; 278 | } 279 | 280 | @Override 281 | public String toString() { 282 | if (mJsonObject != null) { 283 | return mJsonObject.toString(); 284 | } 285 | return null; 286 | } 287 | 288 | /** 289 | * Format the Json with indentation and line breaks. 290 | * Uses the last intendation pattern used, or the default one (3 spaces) 291 | * 292 | * @return the Builder 293 | */ 294 | public String toFormattedString() { 295 | if (mJsonObject != null) { 296 | String indent = ""; 297 | StringBuilder builder = new StringBuilder(); 298 | builder.append("{\n"); 299 | format(mJsonObject, builder, indent); 300 | builder.append("}\n"); 301 | return builder.toString(); 302 | } 303 | return null; 304 | } 305 | 306 | private void format(JSONObject jsonObject, StringBuilder builder, String indent) { 307 | Iterator keys = jsonObject.keys(); 308 | while (keys.hasNext()) { 309 | String key = keys.next(); 310 | builder.append(indent); 311 | builder.append(mIndentationPattern); 312 | builder.append("\""); 313 | builder.append(key); 314 | builder.append("\": "); 315 | Object value = jsonObject.opt(key); 316 | if (value instanceof JSONObject) { 317 | JSONObject child = (JSONObject) value; 318 | builder.append(indent); 319 | builder.append("{\n"); 320 | format(child, builder, indent + mIndentationPattern); 321 | builder.append(indent); 322 | builder.append(mIndentationPattern); 323 | builder.append("}"); 324 | } else if (value instanceof JSONArray) { 325 | JSONArray array = (JSONArray) value; 326 | formatArray(array, builder, indent + mIndentationPattern); 327 | } else { 328 | formatValue(value, builder); 329 | } 330 | if (keys.hasNext()) { 331 | builder.append(",\n"); 332 | } else { 333 | builder.append("\n"); 334 | } 335 | } 336 | } 337 | 338 | private void formatArray(JSONArray array, StringBuilder builder, String indent) { 339 | builder.append("[\n"); 340 | 341 | for (int i = 0; i < array.length(); ++i) { 342 | Object element = array.opt(i); 343 | if (element instanceof JSONObject) { 344 | JSONObject child = (JSONObject) element; 345 | builder.append(indent); 346 | builder.append(mIndentationPattern); 347 | builder.append("{\n"); 348 | format(child, builder, indent + mIndentationPattern); 349 | builder.append(indent); 350 | builder.append(mIndentationPattern); 351 | builder.append("}"); 352 | } else if (element instanceof JSONArray) { 353 | JSONArray child = (JSONArray) element; 354 | formatArray(child, builder, indent + mIndentationPattern); 355 | } else { 356 | formatValue(element, builder); 357 | } 358 | if (i < array.length() - 1) { 359 | builder.append(","); 360 | } 361 | builder.append("\n"); 362 | } 363 | builder.append(indent); 364 | builder.append("]"); 365 | } 366 | 367 | private void formatValue(Object value, StringBuilder builder) { 368 | if (value instanceof String) { 369 | String string = (String) value; 370 | 371 | // Escape special characters 372 | string = string.replaceAll("\\\\", "\\\\\\\\"); // escape backslash 373 | string = string.replaceAll("\"", Matcher.quoteReplacement("\\\"")); // escape double quotes 374 | string = string.replaceAll("/", "\\\\/"); // escape slash 375 | string = string.replaceAll("\n", "\\\\n").replaceAll("\t", "\\\\t"); // escape \n and \t 376 | 377 | builder.append("\""); 378 | builder.append(string); 379 | builder.append("\""); 380 | } else if (value instanceof Long) { 381 | Long longValue = (Long) value; 382 | builder.append(longValue); 383 | } else if (value instanceof Integer) { 384 | Integer intValue = (Integer) value; 385 | builder.append(intValue); 386 | } else if (value instanceof Boolean) { 387 | Boolean bool = (Boolean) value; 388 | builder.append(bool); 389 | } else if (value instanceof Double) { 390 | Double db = (Double) value; 391 | builder.append(db); 392 | } else { 393 | builder.append(value.toString()); 394 | } 395 | } 396 | 397 | public static class Builder { 398 | 399 | private StringReader mStringSource; 400 | private String mInputEncoding = DEFAULT_ENCODING; 401 | private HashSet mForceListPaths = new HashSet<>(); 402 | private HashMap mAttributeNameReplacements = new HashMap<>(); 403 | private HashMap mContentNameReplacements = new HashMap<>(); 404 | private HashMap mForceClassForPath = new HashMap<>(); // Integer, Long, Double, Boolean 405 | private HashSet mSkippedAttributes = new HashSet<>(); 406 | private HashSet mSkippedTags = new HashSet<>(); 407 | 408 | /** 409 | * Constructor 410 | * 411 | * @param xmlSource XML source 412 | */ 413 | public Builder(@NonNull String xmlSource) { 414 | mStringSource = new StringReader(xmlSource); 415 | } 416 | 417 | /** 418 | * Creates the XmlToJson object 419 | */ 420 | public JSONObject build() { 421 | try { 422 | return new JSONObject(new XmlToJson(this).toString()); 423 | } catch (JSONException e) { 424 | e.printStackTrace(); 425 | return null; 426 | } 427 | } 428 | } 429 | 430 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_settings.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/src/main/res/layout/preference_range.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 20 | 21 | 28 | 29 | 30 | 41 | 42 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firesunCN/WechatEnhancement/d6e75accfa3bbd1564ecb1ee32f53dcaa7b4732f/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firesunCN/WechatEnhancement/d6e75accfa3bbd1564ecb1ee32f53dcaa7b4732f/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firesunCN/WechatEnhancement/d6e75accfa3bbd1564ecb1ee32f53dcaa7b4732f/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firesunCN/WechatEnhancement/d6e75accfa3bbd1564ecb1ee32f53dcaa7b4732f/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firesunCN/WechatEnhancement/d6e75accfa3bbd1564ecb1ee32f53dcaa7b4732f/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #009df1 4 | #0079f1 5 | #0059b0 6 | #238cf4 7 | #FFF 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 微信增强 3 | 抢红包,防撤回,去广告 4 | 抢红包 5 | 自己发的不抢 6 | 延时抢红包 7 | 延时时长 8 | 私聊不抢 9 | 快速拆包 10 | 自动接收转账 11 | 显示微信ID 12 | 延迟0毫秒拆开红包 13 | 设置 14 | 红包设置 15 | 设置 16 | 防撤回设置 17 | 增强功能 18 | 过滤朋友圈广告 19 | 电脑微信自动登录 20 | 突破9张图片限制 21 | 消息防撤回 22 | 朋友圈防删除 23 | 显示图标 24 | 尝试修复插件 25 | 生成本机配置 26 | 修复完成,请重启微信 27 | 关于 28 | 作者 29 | 致谢 30 | 微信捐赠 31 | 支付宝捐赠 32 | 包含关键字不抢 33 | 请输入关键字, 以,分隔 34 | 包含微信ID不抢 35 | 请输入微信ID, 以,分隔 36 | 生成配置成功 37 | 生成配置失败 38 | 正在生成配置… 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/values/style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/xml/pref_setting.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 11 | 12 | 15 | 16 | 17 | 18 | 22 | 23 | 28 | 29 | 34 | 35 | 40 | 41 | 46 | 47 | 53 | 54 | 59 | 60 | 65 | 66 | 67 | 71 | 72 | 76 | 77 | 78 | 79 | 83 | 87 | 88 | 89 | 90 | 94 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 108 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter { url "https://maven.aliyun.com/repository/public" } 6 | maven { url 'https://maven.aliyun.com/repository/google' } 7 | google() 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.1.0' 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 | jcenter() 19 | google() 20 | } 21 | } 22 | 23 | task clean(type: Delete) { 24 | delete rootProject.buildDir 25 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | ## Project-wide Gradle settings. 2 | # 3 | # For more details on how to configure your build environment visit 4 | # http://www.gradle.org/docs/current/userguide/build_environment.html 5 | # 6 | # Specifies the JVM arguments used for the daemon process. 7 | # The setting is particularly useful for tweaking memory settings. 8 | # Default value: -Xmx1024m -XX:MaxPermSize=256m 9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 10 | # 11 | # When configured, Gradle will run in incubating parallel mode. 12 | # This option should only be used with decoupled projects. More details, visit 13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 14 | # org.gradle.parallel=true 15 | #Tue Jul 04 22:35:43 CST 2017 16 | systemProp.https.proxyPort=7777 17 | systemProp.http.proxyHost=127.0.0.1 18 | systemProp.https.proxyHost=127.0.0.1 19 | systemProp.http.proxyPort=7777 20 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firesunCN/WechatEnhancement/d6e75accfa3bbd1564ecb1ee32f53dcaa7b4732f/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-4.8.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /image/screenshot1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firesunCN/WechatEnhancement/d6e75accfa3bbd1564ecb1ee32f53dcaa7b4732f/image/screenshot1.jpg -------------------------------------------------------------------------------- /image/screenshot2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firesunCN/WechatEnhancement/d6e75accfa3bbd1564ecb1ee32f53dcaa7b4732f/image/screenshot2.jpg -------------------------------------------------------------------------------- /image/screenshot3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firesunCN/WechatEnhancement/d6e75accfa3bbd1564ecb1ee32f53dcaa7b4732f/image/screenshot3.jpg -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------