├── .gitignore ├── LICENSE ├── README.md ├── example └── hook.js └── generatehookcode.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | 103 | .DS_Store 104 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 使用说明 2 | ``` 3 | 1. 利用反编译工具apktool对apk进行反编译,生成smali文件 4 | $ apktool d xxx.apk 5 | 6 | 2. 运行本脚本, 生成hook代码,支持输入多个smali文件 7 | $ python generatehookcode.py xxx.smali xxx2.smali yyy.smali > hook.js 8 | 9 | 3. frida指定hook.js,运行app 10 | $ frida -U --no-pause -f packgename -l hook.js > log.txt 11 | ``` 12 | 13 | ### TODO 14 | ``` 15 | 16 | 17 | ``` -------------------------------------------------------------------------------- /example/hook.js: -------------------------------------------------------------------------------- 1 | setImmediate(function () { 2 | Java.perform(function () { 3 | var TaoApiRequestClass = Java.use('android.taobao.apirequest.TaoApiRequest'); 4 | TaoApiRequestClass._addParamTo.overload('java.lang.String', 'java.lang.String', 'java.util.HashMap').implementation = function (arg0, arg1, arg2) { 5 | this._addParamTo(arg0, arg1, arg2); 6 | console.log('TaoApiRequestClass._addParamTo [*] arg0: ' + arg0); 7 | console.log('TaoApiRequestClass._addParamTo [*] arg1: ' + arg1); 8 | console.log('TaoApiRequestClass._addParamTo [*] arg2: ' + arg2); 9 | }; 10 | TaoApiRequestClass.init.overload('android.content.Context').implementation = function (arg0) { 11 | this.init(arg0); 12 | console.log('TaoApiRequestClass.init [*] arg0: ' + arg0); 13 | }; 14 | TaoApiRequestClass.setISign.overload('android.taobao.common.i.ISign').implementation = function (arg0) { 15 | this.setISign(arg0); 16 | console.log('TaoApiRequestClass.setISign [*] arg0: ' + arg0); 17 | }; 18 | TaoApiRequestClass.addDataParam.overload('java.lang.String', 'java.lang.String').implementation = function (arg0, arg1) { 19 | this.addDataParam(arg0, arg1); 20 | console.log('TaoApiRequestClass.addDataParam [*] arg0: ' + arg0); 21 | console.log('TaoApiRequestClass.addDataParam [*] arg1: ' + arg1); 22 | }; 23 | TaoApiRequestClass.addDataParam.overload('java.util.Map').implementation = function (arg0) { 24 | this.addDataParam(arg0); 25 | console.log('TaoApiRequestClass.addDataParam [*] arg0: ' + arg0); 26 | }; 27 | TaoApiRequestClass.addDataParam.overload('[Ljava.lang.Object;').implementation = function (arg0) { 28 | this.addDataParam(arg0); 29 | console.log('TaoApiRequestClass.addDataParam [*] arg0: ' + arg0); 30 | }; 31 | TaoApiRequestClass.addParams.overload('[Ljava.lang.Object;').implementation = function (arg0) { 32 | this.addParams(arg0); 33 | console.log('TaoApiRequestClass.addParams [*] arg0: ' + arg0); 34 | }; 35 | TaoApiRequestClass.addSysParamBigPipe.overload('java.util.HashMap', 'long', 'boolean').implementation = function (arg0, arg1, arg2) { 36 | this.addSysParamBigPipe(arg0, arg1, arg2); 37 | console.log('TaoApiRequestClass.addSysParamBigPipe [*] arg0: ' + arg0); 38 | console.log('TaoApiRequestClass.addSysParamBigPipe [*] arg1: ' + arg1); 39 | console.log('TaoApiRequestClass.addSysParamBigPipe [*] arg2: ' + arg2); 40 | }; 41 | TaoApiRequestClass.doSign.overload('java.lang.String', 'java.util.HashMap').implementation = function (arg0, arg1) { 42 | var ret = this.doSign(arg0, arg1); 43 | console.log('TaoApiRequestClass.doSign [*] arg0: ' + arg0); 44 | console.log('TaoApiRequestClass.doSign [*] arg1: ' + arg1); 45 | console.log('TaoApiRequestClass.doSign [*] ret: ' + ret); 46 | return ret; 47 | }; 48 | TaoApiRequestClass.generalRequestUrl.overload('java.lang.String').implementation = function (arg0) { 49 | var ret = this.generalRequestUrl(arg0); 50 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg0: ' + arg0); 51 | console.log('TaoApiRequestClass.generalRequestUrl [*] ret: ' + ret); 52 | return ret; 53 | }; 54 | TaoApiRequestClass.generalRequestUrl.overload('java.lang.String', 'boolean').implementation = function (arg0, arg1) { 55 | var ret = this.generalRequestUrl(arg0, arg1); 56 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg0: ' + arg0); 57 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg1: ' + arg1); 58 | console.log('TaoApiRequestClass.generalRequestUrl [*] ret: ' + ret); 59 | return ret; 60 | }; 61 | TaoApiRequestClass.generalRequestUrl.overload('java.lang.String', 'boolean', 'boolean', 'long').implementation = function (arg0, arg1, arg2, arg3) { 62 | var ret = this.generalRequestUrl(arg0, arg1, arg2, arg3); 63 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg0: ' + arg0); 64 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg1: ' + arg1); 65 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg2: ' + arg2); 66 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg3: ' + arg3); 67 | console.log('TaoApiRequestClass.generalRequestUrl [*] ret: ' + ret); 68 | return ret; 69 | }; 70 | TaoApiRequestClass.generalRequestUrl.overload('java.lang.String', 'boolean', 'boolean', 'long', 'boolean').implementation = function (arg0, arg1, arg2, arg3, arg4) { 71 | var ret = this.generalRequestUrl(arg0, arg1, arg2, arg3, arg4); 72 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg0: ' + arg0); 73 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg1: ' + arg1); 74 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg2: ' + arg2); 75 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg3: ' + arg3); 76 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg4: ' + arg4); 77 | console.log('TaoApiRequestClass.generalRequestUrl [*] ret: ' + ret); 78 | return ret; 79 | }; 80 | TaoApiRequestClass.generalRequestUrl.overload('java.lang.String', 'boolean', 'boolean', 'long', 'boolean', 'java.lang.String').implementation = function (arg0, arg1, arg2, arg3, arg4, arg5) { 81 | var ret = this.generalRequestUrl(arg0, arg1, arg2, arg3, arg4, arg5); 82 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg0: ' + arg0); 83 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg1: ' + arg1); 84 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg2: ' + arg2); 85 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg3: ' + arg3); 86 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg4: ' + arg4); 87 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg5: ' + arg5); 88 | console.log('TaoApiRequestClass.generalRequestUrl [*] ret: ' + ret); 89 | return ret; 90 | }; 91 | TaoApiRequestClass.generalRequestUrl.overload('boolean', 'java.lang.String').implementation = function (arg0, arg1) { 92 | var ret = this.generalRequestUrl(arg0, arg1); 93 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg0: ' + arg0); 94 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg1: ' + arg1); 95 | console.log('TaoApiRequestClass.generalRequestUrl [*] ret: ' + ret); 96 | return ret; 97 | }; 98 | TaoApiRequestClass.generalRequestUrl.overload('boolean', 'java.lang.String', 'boolean').implementation = function (arg0, arg1, arg2) { 99 | var ret = this.generalRequestUrl(arg0, arg1, arg2); 100 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg0: ' + arg0); 101 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg1: ' + arg1); 102 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg2: ' + arg2); 103 | console.log('TaoApiRequestClass.generalRequestUrl [*] ret: ' + ret); 104 | return ret; 105 | }; 106 | TaoApiRequestClass.generalRequestUrl.overload('boolean', 'java.lang.String', 'boolean', 'java.lang.String').implementation = function (arg0, arg1, arg2, arg3) { 107 | var ret = this.generalRequestUrl(arg0, arg1, arg2, arg3); 108 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg0: ' + arg0); 109 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg1: ' + arg1); 110 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg2: ' + arg2); 111 | console.log('TaoApiRequestClass.generalRequestUrl [*] arg3: ' + arg3); 112 | console.log('TaoApiRequestClass.generalRequestUrl [*] ret: ' + ret); 113 | return ret; 114 | }; 115 | TaoApiRequestClass.processDataParam.overload().implementation = function () { 116 | this.processDataParam(); 117 | }; 118 | TaoApiRequestClass.resetParams.overload().implementation = function () { 119 | this.resetParams(); 120 | }; 121 | 122 | 123 | var TaoApiSignClass = Java.use('android.taobao.util.TaoApiSign'); 124 | TaoApiSignClass.getSign.overload('java.util.Map').implementation = function (arg0) { 125 | var ret = this.getSign(arg0); 126 | console.log('TaoApiSignClass.getSign [*] arg0: ' + arg0); 127 | console.log('TaoApiSignClass.getSign [*] ret: ' + ret); 128 | return ret; 129 | }; 130 | 131 | 132 | var bgmClass = Java.use('bgm'); 133 | bgmClass.getSign.overload('java.util.AbstractMap').implementation = function (arg0) { 134 | var ret = this.getSign(arg0); 135 | console.log('bgmClass.getSign [*] arg0: ' + arg0); 136 | console.log('bgmClass.getSign [*] ret: ' + ret); 137 | return ret; 138 | }; 139 | 140 | 141 | var bgnClass = Java.use('bgn'); 142 | bgnClass.getSign.overload('java.util.AbstractMap').implementation = function (arg0) { 143 | var ret = this.getSign(arg0); 144 | console.log('bgnClass.getSign [*] arg0: ' + arg0); 145 | console.log('bgnClass.getSign [*] ret: ' + ret); 146 | return ret; 147 | }; 148 | 149 | 150 | var SecurityManagerClass = Java.use('android.taobao.apirequest.SecurityManager'); 151 | SecurityManagerClass.getInstance.overload().implementation = function () { 152 | var ret = this.getInstance(); 153 | console.log('SecurityManagerClass.getInstance [*] ret: ' + ret); 154 | return ret; 155 | }; 156 | SecurityManagerClass.getMTopSign.overload('java.util.HashMap', 'java.lang.String').implementation = function (arg0, arg1) { 157 | var ret = this.getMTopSign(arg0, arg1); 158 | console.log('SecurityManagerClass.getMTopSign [*] arg0: ' + arg0); 159 | console.log('SecurityManagerClass.getMTopSign [*] arg1: ' + arg1); 160 | console.log('SecurityManagerClass.getMTopSign [*] ret: ' + ret); 161 | return ret; 162 | }; 163 | SecurityManagerClass.getTopSing.overload('java.util.TreeMap', 'java.lang.String').implementation = function (arg0, arg1) { 164 | var ret = this.getTopSing(arg0, arg1); 165 | console.log('SecurityManagerClass.getTopSing [*] arg0: ' + arg0); 166 | console.log('SecurityManagerClass.getTopSing [*] arg1: ' + arg1); 167 | console.log('SecurityManagerClass.getTopSing [*] ret: ' + ret); 168 | return ret; 169 | }; 170 | SecurityManagerClass.getLoginTopToken.overload('java.lang.String', 'java.lang.String', 'java.lang.String').implementation = function (arg0, arg1, arg2) { 171 | var ret = this.getLoginTopToken(arg0, arg1, arg2); 172 | console.log('SecurityManagerClass.getLoginTopToken [*] arg0: ' + arg0); 173 | console.log('SecurityManagerClass.getLoginTopToken [*] arg1: ' + arg1); 174 | console.log('SecurityManagerClass.getLoginTopToken [*] arg2: ' + arg2); 175 | console.log('SecurityManagerClass.getLoginTopToken [*] ret: ' + ret); 176 | return ret; 177 | }; 178 | SecurityManagerClass.getSign.overload('int', 'java.util.AbstractMap', 'java.lang.String').implementation = function (arg0, arg1, arg2) { 179 | var ret = this.getSign(arg0, arg1, arg2); 180 | console.log('SecurityManagerClass.getSign [*] arg0: ' + arg0); 181 | console.log('SecurityManagerClass.getSign [*] arg1: ' + arg1); 182 | console.log('SecurityManagerClass.getSign [*] arg2: ' + arg2); 183 | console.log('SecurityManagerClass.getSign [*] ret: ' + ret); 184 | return ret; 185 | }; 186 | SecurityManagerClass.init.overload('android.content.ContextWrapper').implementation = function (arg0) { 187 | this.init(arg0); 188 | console.log('SecurityManagerClass.init [*] arg0: ' + arg0); 189 | }; 190 | 191 | 192 | var SecretUtilClass = Java.use('com.taobao.securityjni.SecretUtil'); 193 | SecretUtilClass.AttachImplObject.overload('java.lang.Object').implementation = function (arg0) { 194 | this.AttachImplObject(arg0); 195 | console.log('SecretUtilClass.AttachImplObject [*] arg0: ' + arg0); 196 | }; 197 | SecretUtilClass.getExternalSign.overload('java.util.LinkedHashMap', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1) { 198 | var ret = this.getExternalSign(arg0, arg1); 199 | console.log('SecretUtilClass.getExternalSign [*] arg0: ' + arg0); 200 | console.log('SecretUtilClass.getExternalSign [*] arg1: ' + arg1); 201 | console.log('SecretUtilClass.getExternalSign [*] ret: ' + ret); 202 | return ret; 203 | }; 204 | SecretUtilClass.getLoginTopToken.overload('java.lang.String', 'java.lang.String').implementation = function (arg0, arg1) { 205 | var ret = this.getLoginTopToken(arg0, arg1); 206 | console.log('SecretUtilClass.getLoginTopToken [*] arg0: ' + arg0); 207 | console.log('SecretUtilClass.getLoginTopToken [*] arg1: ' + arg1); 208 | console.log('SecretUtilClass.getLoginTopToken [*] ret: ' + ret); 209 | return ret; 210 | }; 211 | SecretUtilClass.getLoginTopToken.overload('java.lang.String', 'java.lang.String', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1, arg2) { 212 | var ret = this.getLoginTopToken(arg0, arg1, arg2); 213 | console.log('SecretUtilClass.getLoginTopToken [*] arg0: ' + arg0); 214 | console.log('SecretUtilClass.getLoginTopToken [*] arg1: ' + arg1); 215 | console.log('SecretUtilClass.getLoginTopToken [*] arg2: ' + arg2); 216 | console.log('SecretUtilClass.getLoginTopToken [*] ret: ' + ret); 217 | return ret; 218 | }; 219 | SecretUtilClass.getMtopSign.overload('java.util.HashMap', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1) { 220 | var ret = this.getMtopSign(arg0, arg1); 221 | console.log('SecretUtilClass.getMtopSign [*] arg0: ' + arg0); 222 | console.log('SecretUtilClass.getMtopSign [*] arg1: ' + arg1); 223 | console.log('SecretUtilClass.getMtopSign [*] ret: ' + ret); 224 | return ret; 225 | }; 226 | SecretUtilClass.getMtopV4RespSign.overload('java.lang.String', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1) { 227 | var ret = this.getMtopV4RespSign(arg0, arg1); 228 | console.log('SecretUtilClass.getMtopV4RespSign [*] arg0: ' + arg0); 229 | console.log('SecretUtilClass.getMtopV4RespSign [*] arg1: ' + arg1); 230 | console.log('SecretUtilClass.getMtopV4RespSign [*] ret: ' + ret); 231 | return ret; 232 | }; 233 | SecretUtilClass.getMtopV4Sign.overload('java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) { 234 | var ret = this.getMtopV4Sign(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); 235 | console.log('SecretUtilClass.getMtopV4Sign [*] arg0: ' + arg0); 236 | console.log('SecretUtilClass.getMtopV4Sign [*] arg1: ' + arg1); 237 | console.log('SecretUtilClass.getMtopV4Sign [*] arg2: ' + arg2); 238 | console.log('SecretUtilClass.getMtopV4Sign [*] arg3: ' + arg3); 239 | console.log('SecretUtilClass.getMtopV4Sign [*] arg4: ' + arg4); 240 | console.log('SecretUtilClass.getMtopV4Sign [*] arg5: ' + arg5); 241 | console.log('SecretUtilClass.getMtopV4Sign [*] arg6: ' + arg6); 242 | console.log('SecretUtilClass.getMtopV4Sign [*] arg7: ' + arg7); 243 | console.log('SecretUtilClass.getMtopV4Sign [*] arg8: ' + arg8); 244 | console.log('SecretUtilClass.getMtopV4Sign [*] arg9: ' + arg9); 245 | console.log('SecretUtilClass.getMtopV4Sign [*] arg10: ' + arg10); 246 | console.log('SecretUtilClass.getMtopV4Sign [*] ret: ' + ret); 247 | return ret; 248 | }; 249 | SecretUtilClass.getQianNiuSign.overload('[B', '[B').implementation = function (arg0, arg1) { 250 | var ret = this.getQianNiuSign(arg0, arg1); 251 | console.log('SecretUtilClass.getQianNiuSign [*] arg0: ' + arg0); 252 | console.log('SecretUtilClass.getQianNiuSign [*] arg1: ' + arg1); 253 | console.log('SecretUtilClass.getQianNiuSign [*] ret: ' + ret); 254 | return ret; 255 | }; 256 | SecretUtilClass.getSign.overload('java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String').implementation = function (arg0, arg1, arg2, arg3, arg4, arg5) { 257 | var ret = this.getSign(arg0, arg1, arg2, arg3, arg4, arg5); 258 | console.log('SecretUtilClass.getSign [*] arg0: ' + arg0); 259 | console.log('SecretUtilClass.getSign [*] arg1: ' + arg1); 260 | console.log('SecretUtilClass.getSign [*] arg2: ' + arg2); 261 | console.log('SecretUtilClass.getSign [*] arg3: ' + arg3); 262 | console.log('SecretUtilClass.getSign [*] arg4: ' + arg4); 263 | console.log('SecretUtilClass.getSign [*] arg5: ' + arg5); 264 | console.log('SecretUtilClass.getSign [*] ret: ' + ret); 265 | return ret; 266 | }; 267 | SecretUtilClass.getSign.overload('java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String').implementation = function (arg0, arg1, arg2, arg3, arg4, arg5, arg6) { 268 | var ret = this.getSign(arg0, arg1, arg2, arg3, arg4, arg5, arg6); 269 | console.log('SecretUtilClass.getSign [*] arg0: ' + arg0); 270 | console.log('SecretUtilClass.getSign [*] arg1: ' + arg1); 271 | console.log('SecretUtilClass.getSign [*] arg2: ' + arg2); 272 | console.log('SecretUtilClass.getSign [*] arg3: ' + arg3); 273 | console.log('SecretUtilClass.getSign [*] arg4: ' + arg4); 274 | console.log('SecretUtilClass.getSign [*] arg5: ' + arg5); 275 | console.log('SecretUtilClass.getSign [*] arg6: ' + arg6); 276 | console.log('SecretUtilClass.getSign [*] ret: ' + ret); 277 | return ret; 278 | }; 279 | SecretUtilClass.getSign.overload('java.util.HashMap', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1) { 280 | var ret = this.getSign(arg0, arg1); 281 | console.log('SecretUtilClass.getSign [*] arg0: ' + arg0); 282 | console.log('SecretUtilClass.getSign [*] arg1: ' + arg1); 283 | console.log('SecretUtilClass.getSign [*] ret: ' + ret); 284 | return ret; 285 | }; 286 | SecretUtilClass.getTime.overload().implementation = function () { 287 | var ret = this.getTime(); 288 | console.log('SecretUtilClass.getTime [*] ret: ' + ret); 289 | return ret; 290 | }; 291 | SecretUtilClass.getTopSign.overload('java.util.TreeMap').implementation = function (arg0) { 292 | var ret = this.getTopSign(arg0); 293 | console.log('SecretUtilClass.getTopSign [*] arg0: ' + arg0); 294 | console.log('SecretUtilClass.getTopSign [*] ret: ' + ret); 295 | return ret; 296 | }; 297 | SecretUtilClass.getTopSign.overload('java.util.TreeMap', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1) { 298 | var ret = this.getTopSign(arg0, arg1); 299 | console.log('SecretUtilClass.getTopSign [*] arg0: ' + arg0); 300 | console.log('SecretUtilClass.getTopSign [*] arg1: ' + arg1); 301 | console.log('SecretUtilClass.getTopSign [*] ret: ' + ret); 302 | return ret; 303 | }; 304 | 305 | 306 | var CImplSecretUtilClass = Java.use('com.taobao.securityjni.impl.CImplSecretUtil'); 307 | CImplSecretUtilClass.InitGlobalData.overload().implementation = function () { 308 | this.InitGlobalData(); 309 | }; 310 | CImplSecretUtilClass.getExternalSignByte.overload('[B', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1) { 311 | var ret = this.getExternalSignByte(arg0, arg1); 312 | console.log('CImplSecretUtilClass.getExternalSignByte [*] arg0: ' + arg0); 313 | console.log('CImplSecretUtilClass.getExternalSignByte [*] arg1: ' + arg1); 314 | console.log('CImplSecretUtilClass.getExternalSignByte [*] ret: ' + ret); 315 | return ret; 316 | }; 317 | CImplSecretUtilClass.getMtopV4RespByte.overload('[B', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1) { 318 | var ret = this.getMtopV4RespByte(arg0, arg1); 319 | console.log('CImplSecretUtilClass.getMtopV4RespByte [*] arg0: ' + arg0); 320 | console.log('CImplSecretUtilClass.getMtopV4RespByte [*] arg1: ' + arg1); 321 | console.log('CImplSecretUtilClass.getMtopV4RespByte [*] ret: ' + ret); 322 | return ret; 323 | }; 324 | CImplSecretUtilClass.getMtopV4SignByte.overload('[B', '[B', '[B', '[B', '[B', '[B', '[B', '[B', '[B', '[B', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) { 325 | var ret = this.getMtopV4SignByte(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); 326 | console.log('CImplSecretUtilClass.getMtopV4SignByte [*] arg0: ' + arg0); 327 | console.log('CImplSecretUtilClass.getMtopV4SignByte [*] arg1: ' + arg1); 328 | console.log('CImplSecretUtilClass.getMtopV4SignByte [*] arg2: ' + arg2); 329 | console.log('CImplSecretUtilClass.getMtopV4SignByte [*] arg3: ' + arg3); 330 | console.log('CImplSecretUtilClass.getMtopV4SignByte [*] arg4: ' + arg4); 331 | console.log('CImplSecretUtilClass.getMtopV4SignByte [*] arg5: ' + arg5); 332 | console.log('CImplSecretUtilClass.getMtopV4SignByte [*] arg6: ' + arg6); 333 | console.log('CImplSecretUtilClass.getMtopV4SignByte [*] arg7: ' + arg7); 334 | console.log('CImplSecretUtilClass.getMtopV4SignByte [*] arg8: ' + arg8); 335 | console.log('CImplSecretUtilClass.getMtopV4SignByte [*] arg9: ' + arg9); 336 | console.log('CImplSecretUtilClass.getMtopV4SignByte [*] arg10: ' + arg10); 337 | console.log('CImplSecretUtilClass.getMtopV4SignByte [*] ret: ' + ret); 338 | return ret; 339 | }; 340 | CImplSecretUtilClass.getQianNiuSignByte.overload('[B', '[B').implementation = function (arg0, arg1) { 341 | var ret = this.getQianNiuSignByte(arg0, arg1); 342 | console.log('CImplSecretUtilClass.getQianNiuSignByte [*] arg0: ' + arg0); 343 | console.log('CImplSecretUtilClass.getQianNiuSignByte [*] arg1: ' + arg1); 344 | console.log('CImplSecretUtilClass.getQianNiuSignByte [*] ret: ' + ret); 345 | return ret; 346 | }; 347 | CImplSecretUtilClass.getSignNative.overload('[B', '[B', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1, arg2) { 348 | var ret = this.getSignNative(arg0, arg1, arg2); 349 | console.log('CImplSecretUtilClass.getSignNative [*] arg0: ' + arg0); 350 | console.log('CImplSecretUtilClass.getSignNative [*] arg1: ' + arg1); 351 | console.log('CImplSecretUtilClass.getSignNative [*] arg2: ' + arg2); 352 | console.log('CImplSecretUtilClass.getSignNative [*] ret: ' + ret); 353 | return ret; 354 | }; 355 | CImplSecretUtilClass.getTopSignByte.overload('[B', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1) { 356 | var ret = this.getTopSignByte(arg0, arg1); 357 | console.log('CImplSecretUtilClass.getTopSignByte [*] arg0: ' + arg0); 358 | console.log('CImplSecretUtilClass.getTopSignByte [*] arg1: ' + arg1); 359 | console.log('CImplSecretUtilClass.getTopSignByte [*] ret: ' + ret); 360 | return ret; 361 | }; 362 | CImplSecretUtilClass.getTopToken.overload('[B', 'java.lang.String', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1, arg2) { 363 | var ret = this.getTopToken(arg0, arg1, arg2); 364 | console.log('CImplSecretUtilClass.getTopToken [*] arg0: ' + arg0); 365 | console.log('CImplSecretUtilClass.getTopToken [*] arg1: ' + arg1); 366 | console.log('CImplSecretUtilClass.getTopToken [*] arg2: ' + arg2); 367 | console.log('CImplSecretUtilClass.getTopToken [*] ret: ' + ret); 368 | return ret; 369 | }; 370 | CImplSecretUtilClass.getExternalSign.overload('java.util.LinkedHashMap', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1) { 371 | var ret = this.getExternalSign(arg0, arg1); 372 | console.log('CImplSecretUtilClass.getExternalSign [*] arg0: ' + arg0); 373 | console.log('CImplSecretUtilClass.getExternalSign [*] arg1: ' + arg1); 374 | console.log('CImplSecretUtilClass.getExternalSign [*] ret: ' + ret); 375 | return ret; 376 | }; 377 | CImplSecretUtilClass.getLoginTopToken.overload('java.lang.String', 'java.lang.String', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1, arg2) { 378 | var ret = this.getLoginTopToken(arg0, arg1, arg2); 379 | console.log('CImplSecretUtilClass.getLoginTopToken [*] arg0: ' + arg0); 380 | console.log('CImplSecretUtilClass.getLoginTopToken [*] arg1: ' + arg1); 381 | console.log('CImplSecretUtilClass.getLoginTopToken [*] arg2: ' + arg2); 382 | console.log('CImplSecretUtilClass.getLoginTopToken [*] ret: ' + ret); 383 | return ret; 384 | }; 385 | CImplSecretUtilClass.getMtopSign.overload('java.util.HashMap', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1) { 386 | var ret = this.getMtopSign(arg0, arg1); 387 | console.log('CImplSecretUtilClass.getMtopSign [*] arg0: ' + arg0); 388 | console.log('CImplSecretUtilClass.getMtopSign [*] arg1: ' + arg1); 389 | console.log('CImplSecretUtilClass.getMtopSign [*] ret: ' + ret); 390 | return ret; 391 | }; 392 | CImplSecretUtilClass.getMtopV4RespSign.overload('java.lang.String', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1) { 393 | var ret = this.getMtopV4RespSign(arg0, arg1); 394 | console.log('CImplSecretUtilClass.getMtopV4RespSign [*] arg0: ' + arg0); 395 | console.log('CImplSecretUtilClass.getMtopV4RespSign [*] arg1: ' + arg1); 396 | console.log('CImplSecretUtilClass.getMtopV4RespSign [*] ret: ' + ret); 397 | return ret; 398 | }; 399 | CImplSecretUtilClass.getMtopV4Sign.overload('java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'java.lang.String', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) { 400 | var ret = this.getMtopV4Sign(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); 401 | console.log('CImplSecretUtilClass.getMtopV4Sign [*] arg0: ' + arg0); 402 | console.log('CImplSecretUtilClass.getMtopV4Sign [*] arg1: ' + arg1); 403 | console.log('CImplSecretUtilClass.getMtopV4Sign [*] arg2: ' + arg2); 404 | console.log('CImplSecretUtilClass.getMtopV4Sign [*] arg3: ' + arg3); 405 | console.log('CImplSecretUtilClass.getMtopV4Sign [*] arg4: ' + arg4); 406 | console.log('CImplSecretUtilClass.getMtopV4Sign [*] arg5: ' + arg5); 407 | console.log('CImplSecretUtilClass.getMtopV4Sign [*] arg6: ' + arg6); 408 | console.log('CImplSecretUtilClass.getMtopV4Sign [*] arg7: ' + arg7); 409 | console.log('CImplSecretUtilClass.getMtopV4Sign [*] arg8: ' + arg8); 410 | console.log('CImplSecretUtilClass.getMtopV4Sign [*] arg9: ' + arg9); 411 | console.log('CImplSecretUtilClass.getMtopV4Sign [*] arg10: ' + arg10); 412 | console.log('CImplSecretUtilClass.getMtopV4Sign [*] ret: ' + ret); 413 | return ret; 414 | }; 415 | CImplSecretUtilClass.getQianNiuSign.overload('[B', '[B').implementation = function (arg0, arg1) { 416 | var ret = this.getQianNiuSign(arg0, arg1); 417 | console.log('CImplSecretUtilClass.getQianNiuSign [*] arg0: ' + arg0); 418 | console.log('CImplSecretUtilClass.getQianNiuSign [*] arg1: ' + arg1); 419 | console.log('CImplSecretUtilClass.getQianNiuSign [*] ret: ' + ret); 420 | return ret; 421 | }; 422 | CImplSecretUtilClass.getTopSign.overload('java.util.TreeMap', 'com.taobao.securityjni.tools.DataContext').implementation = function (arg0, arg1) { 423 | var ret = this.getTopSign(arg0, arg1); 424 | console.log('CImplSecretUtilClass.getTopSign [*] arg0: ' + arg0); 425 | console.log('CImplSecretUtilClass.getTopSign [*] arg1: ' + arg1); 426 | console.log('CImplSecretUtilClass.getTopSign [*] ret: ' + ret); 427 | return ret; 428 | }; 429 | 430 | 431 | }); 432 | }); 433 | -------------------------------------------------------------------------------- /generatehookcode.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: UTF-8 -*- 3 | import sys 4 | import os 5 | import re 6 | 7 | def getClassName(smaliFilePath): 8 | with open(smaliFilePath, "r") as f: 9 | firstline = f.readline() 10 | group1 = re.search(" L.*?;", firstline).group() 11 | if (group1 != None): 12 | name = group1.strip() 13 | return name 14 | return None 15 | 16 | def getMethods(smaliFilePath): 17 | methods = [] 18 | with open(smaliFilePath, "r") as f: 19 | for line in f.readlines(): 20 | if (line.find(".method ") != -1 and line.find("abstract") == -1): 21 | methods.append(line) 22 | return methods 23 | 24 | def getFunctionName(methodline): 25 | endPos = methodline.find("(") 26 | tmpStr = methodline[0 : endPos] 27 | startPos = tmpStr.rfind(" ") 28 | name = tmpStr[startPos + 1 : ] 29 | return name 30 | 31 | def getArgType(argType = ""): 32 | chType = argType[0] 33 | standardType = ["Z", "B", "C", "S", "I", "J", "F", "D"] 34 | objectType = ["L"] 35 | arrayType = ["["] 36 | if chType in standardType: 37 | return chType 38 | elif chType in objectType: 39 | endPos = argType.find(";") 40 | typeName = argType[0 : endPos + 1] 41 | return typeName 42 | elif chType in arrayType: 43 | endString = argType[1:] 44 | typeName = "[" + getArgType(endString) 45 | return typeName 46 | 47 | return "" 48 | 49 | def parseArgList(argTypes, pos): 50 | ''' 51 | http://docs.oracle.com/javase/6/docs/technotes/guides/jni/spec/types.html#wp276 52 | ''' 53 | argList = [] 54 | while 1: 55 | argTypeString = argTypes[pos:] 56 | if (argTypeString == ""): 57 | break 58 | typeName = getArgType(argTypeString) 59 | if (typeName == ""): 60 | break 61 | argList.append(typeName) 62 | pos += len(typeName) 63 | nn = len(argTypes) 64 | if (pos >= nn): 65 | break 66 | 67 | return argList 68 | 69 | def getArgList(methodline = ""): 70 | argList = [] 71 | startPos = methodline.find("(") 72 | endPos = methodline.find(")") 73 | if ((endPos - startPos) == 1): 74 | return argList 75 | 76 | argString = methodline[startPos + 1 : endPos] 77 | argList = parseArgList(argString, 0) 78 | return argList 79 | 80 | def getReturnType(methodline): 81 | startPos = methodline.find(")") 82 | endPos = methodline.find("\n") 83 | returnValue = methodline[startPos + 1: endPos] 84 | return returnValue 85 | 86 | def genHeadCode(): 87 | header = 'setImmediate(function () {\n\tJava.perform(function () {' 88 | print (header) 89 | def genLastCode(): 90 | end = '\t});\n});' 91 | print(end) 92 | 93 | def genDefClass(className): 94 | pos = className.rfind("/") 95 | if (pos == -1): 96 | pos = className.rfind("L") 97 | semicolonPos = className.find(";") 98 | genClassName = className[pos + 1: semicolonPos] 99 | tmpClassName = className 100 | tmpClassName = tmpClassName.strip() 101 | if (tmpClassName[0] == "L"): 102 | tmpClassName = tmpClassName[1:] 103 | tmpClassName = tmpClassName.replace("/", ".") 104 | tmpClassName = tmpClassName.replace(";", "") 105 | print ("\t\tvar " + genClassName + "Class = Java.use('" + tmpClassName + "');") 106 | return genClassName + "Class" 107 | 108 | 109 | def genHookFunctionCode(genClassName, funName, argList, returnType, isOverload): 110 | argCode = "" 111 | overloadCode = "" 112 | LogCode = "\n" 113 | consoleLogReturnValue = "" 114 | for i in range(0, len(argList)): 115 | argString = argList[i] 116 | argString = argString.strip() 117 | if (argString[0] != "["): 118 | if (argString[0] == "L"): 119 | argString = argString[1:] 120 | #argString = argString.replace("L", "") 121 | argString = argString.replace("/", ".") 122 | argString = argString.replace(";", "") 123 | standardType = {"Z": "boolean", "B": "byte", "C": "char", "S": "short", "I": "int", "J": "long", 124 | "F": "float", "D": "double"} 125 | if argString[0] in standardType: 126 | argString = standardType[argString] 127 | else: 128 | argString = argString.replace("/", ".") 129 | overloadCode += "\"" + argString + "\"" 130 | 131 | aArg = "arg" + str(i) 132 | argCode += aArg 133 | if (i < len(argList) - 1): 134 | argCode += ", " 135 | overloadCode += ", " 136 | LogCode += "\t\t\tconsole.log('%s.%s [*] %s: ' + %s);\n" % (genClassName, funName, aArg, aArg) 137 | 138 | argCode += "" 139 | 140 | if returnType == "V": 141 | callCode = "\n\t\t\tthis.%s(%s);" % (funName, argCode) 142 | returnCode = "" 143 | else: 144 | callCode = "\n\t\t\tvar ret = this.%s(%s);" % (funName, argCode) 145 | consoleLogReturnValue = "\t\t\tconsole.log('%s.%s [*] ret: ' + ret);\n" % (genClassName, funName) 146 | returnCode = "\t\t\treturn ret;\n" 147 | if (overloadCode == "" or isOverload == False): 148 | code = "\t\t%s.%s.implementation = function (%s) { %s %s %s %s\t\t};" % (genClassName, funName, argCode, callCode, LogCode, consoleLogReturnValue, returnCode) 149 | else: 150 | code = "\t\t%s.%s.overload(%s).implementation = function (%s) { %s %s %s %s\t\t};" % (genClassName, funName, overloadCode, argCode, callCode, LogCode, consoleLogReturnValue, returnCode) 151 | print (code) 152 | pass 153 | 154 | def genHookCode(filepath): 155 | smaliPath = os.path.abspath(filepath) 156 | className = getClassName(smaliPath) 157 | genClassName = genDefClass(className) 158 | methods = getMethods(smaliPath) 159 | allFuntionNames = {} 160 | for methodline in methods: 161 | funName = getFunctionName(methodline) 162 | if funName == "" or funName == "": 163 | continue 164 | if funName in allFuntionNames: 165 | count = allFuntionNames[funName] 166 | allFuntionNames[funName] = count + 1 167 | else: 168 | allFuntionNames[funName] = 1 169 | 170 | for methodline in methods: 171 | funName = getFunctionName(methodline) 172 | if funName == "" or funName == "": 173 | continue 174 | argList = getArgList(methodline) 175 | returnType = getReturnType(methodline) 176 | 177 | isOverload = False 178 | if allFuntionNames[funName] >= 2: 179 | isOverload = True 180 | genHookFunctionCode(genClassName, funName, argList, returnType, isOverload) 181 | 182 | def main(): 183 | for i in range(1, len(sys.argv)): 184 | genHookCode(sys.argv[i]) 185 | print ("\n") 186 | 187 | 188 | if __name__ == '__main__': 189 | if (len(sys.argv) > 1): 190 | genHeadCode() 191 | main() 192 | genLastCode() 193 | else: 194 | print("python generatehookcode.py file1 file2 file3 ") --------------------------------------------------------------------------------