Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpasm committed Nov 15, 2021
0 parents commit 5c2df73
Show file tree
Hide file tree
Showing 43 changed files with 2,656 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.iml
.gradle
.idea
/local.properties
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Описание
Программа для мониторинга входящих sms и пропущенных звонков и отправка информации в телеграмм и/или на удалённый сервер.
Плюс некоторые плюшки, как обнаружение и копирование pin кода, фильтрация текста итп

## Примеры regexp filter
```
^MTC|^Balance
\/\/ .*
.*
^Этот абонент звонил вам.*(\/\/.*)
```
2 changes: 2 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build
/release
30 changes: 30 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 29
defaultConfig {
applicationId "com.pasm.smscast"
minSdk 21
targetSdk 29
versionCode 1
versionName '1.1.0'
resConfigs "nodpi"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
android.applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "${rootProject.name}_${versionName}.apk"
}
}
}
}
}

dependencies {
implementation 'com.android.volley:volley:1.2.1'
}
23 changes: 23 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-dontobfuscate
75 changes: 75 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.pasm.smscast">

<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_CALL_LOG" />

<application
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@drawable/ic_large"
android:roundIcon="@drawable/ic_large"
android:supportsRtl="true"
android:usesCleartextTraffic="true">
<receiver
android:name=".SMSMonitor"
android:enabled="true"
android:exported="true"
android:permission="android.permission.BROADCAST_SMS">
<intent-filter android:priority="500">
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
<action android:name="com.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
<receiver
android:name=".PhoneMonitor"
android:enabled="true"
android:exported="true">
<intent-filter android:priority="500">
<action android:name="android.intent.action.PHONE_STATE"/>
</intent-filter>
</receiver>
<receiver
android:name=".CopyBroadcastReceiver"
android:enabled="true"
android:exported="false" />

<service
android:name=".MyAccessibilityService"
android:label="@string/app_name"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
android:exported="false">
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>

<meta-data
android:name="android.accessibilityservice"
android:resource="@xml/my_accessibility_service" />
</service>
<service
android:name=".NotifyService"
android:enabled="true"
android:exported="false" />

<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="stateHidden|adjustResize"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
38 changes: 38 additions & 0 deletions app/src/main/java/com/pasm/smscast/CopyBroadcastReceiver.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.pasm.smscast;

import static android.content.Context.CLIPBOARD_SERVICE;

import android.content.BroadcastReceiver;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.widget.Toast;


public class CopyBroadcastReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {

if (context == null || intent == null)
return;

Bundle extras = intent.getExtras();
if (extras != null) {
String text = extras.getString("extra");
if (text != null) {
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("pin", text);
clipboard.setPrimaryClip(clip);

// Закрыть шторку уведомления. т.к. автоматом не закрывается при нажатии на Action Button
context.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));

Toast.makeText(context, Html.fromHtml(String.format(context.getString(R.string.copied), text)), Toast.LENGTH_SHORT).show();
}
}
}
}
Loading

0 comments on commit 5c2df73

Please sign in to comment.