Skip to content

Commit 7a18b7d

Browse files
Publish initial code to Github.
0 parents  commit 7a18b7d

76 files changed

Lines changed: 2446 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/debug.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up JDK 11
13+
uses: actions/setup-java@v2
14+
with:
15+
distribution: temurin
16+
java-version: '11'
17+
cache: gradle
18+
- name: Ensure gradlew has +x
19+
run: chmod +x ./gradlew
20+
- name: Build the app
21+
run: ./gradlew assembleDebug
22+
- name: Publish build output
23+
uses: actions/upload-artifact@v2
24+
with:
25+
name: Debug app
26+
path: app/build/outputs/apk/debug/app-debug.apk

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
tags: [ '*' ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Decrypt keystore file
13+
env:
14+
ENCRYPTION_KEY: ${{ secrets.ENCRYPTION_KEY }}
15+
run: gpg --batch --decrypt --output=release.jks --passphrase=$ENCRYPTION_KEY --quiet --yes release.jks.gpg
16+
- name: Set up JDK 11
17+
uses: actions/setup-java@v2
18+
with:
19+
distribution: temurin
20+
java-version: '11'
21+
cache: gradle
22+
- name: Ensure gradlew has +x
23+
run: chmod +x ./gradlew
24+
- name: Build the app
25+
env:
26+
SIGNING_KEYSTORE: release.jks
27+
SIGNING_KEYSTORE_PASSWORD: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
28+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
29+
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
30+
run: ./gradlew assembleRelease
31+
- name: Publish release assets
32+
uses: softprops/action-gh-release@v1
33+
with:
34+
files: app/build/outputs/apk/release/app-release.apk

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*.iml
2+
*.jks
3+
.gradle
4+
/local.properties
5+
/.idea/caches
6+
/.idea/libraries
7+
/.idea/modules.xml
8+
/.idea/workspace.xml
9+
/.idea/navEditor.xml
10+
/.idea/assetWizardSettings.xml
11+
.DS_Store
12+
/build
13+
/captures
14+
.externalNativeBuild
15+
.cxx
16+
local.properties

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Syncloud Softech Private Limited
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Mobserve
2+
3+
If you ever wanted a tool to simply push the calls and SMS (or text messages) from your phone to somewhere remote, this is it.
4+
This app matches all missed (in case of calls), incoming and/or outgoing calls text messages against set rules and sends them over to webhook that you define.
5+
6+
[![Build](https://github.com/syncloudsoftech/mobserve/actions/workflows/debug.yml/badge.svg)](https://github.com/syncloudsoftech/mobserve/actions/workflows/debug.yml)
7+
[![Release](https://badgen.net/github/release/syncloudsoftech/mobserve)](https://github.com/syncloudsoftech/mobserve/releases)
8+
[![Downloads](https://badgen.net/github/assets-dl/syncloudsoftech/mobserve)](https://github.com/syncloudsoftech/mobserve/releases/latest)
9+
[![License](https://badgen.net/github/license/syncloudsoftech/mobserve)](https://github.com/syncloudsoftech/mobserve/blob/main/LICENSE)
10+
11+
If you find this app useful, send over your hugs :hugs: to [Syncloud Softech](https://syncloudsoft.com/).
12+
13+
### Usage
14+
15+
The app sends tiny payload similar to what's shown below on the remote webhook (as [JSON](https://www.json.org/) body in a `POST` request):
16+
17+
```json
18+
{
19+
"event": "call",
20+
"direction": "incoming",
21+
"participant": "+919876543210",
22+
"duration": 143,
23+
"date": 1609459200000
24+
}
25+
```
26+
27+
```json
28+
{
29+
"event": "sms",
30+
"direction": "incoming",
31+
"participant": "+919876543210",
32+
"content": "Your OTP for login is 123456.",
33+
"date": 1609459200000
34+
}
35+
```
36+
37+
You can use services like [Pipedream](https://pipedream.com/) to process these payloads and do stuff e.g., sending over to a Slack channel using below code:
38+
39+
```js
40+
import { axios } from "@pipedream/platform"
41+
42+
const colors = {
43+
'incoming': '#00aeff',
44+
'outgoing': '#7ac143',
45+
'missed': '#e4002b',
46+
}
47+
48+
const events = {
49+
'call': 'phone call',
50+
'sms': 'text message',
51+
}
52+
53+
export default defineComponent({
54+
async run({ $, event }) {
55+
const content = event.body.event === "call"
56+
? `Call duration was ${event.body.duration} seconds.`
57+
: (event.body.content || 'No message body was specified.');
58+
return await axios($, {
59+
url: 'https://hooks.slack.com/services/<webhook>',
60+
method: 'post',
61+
data: {
62+
text: `New ${event.body.direction} ${events[event.body.event]} captured.`,
63+
attachments: [{
64+
author_name: event.body.participant,
65+
color: colors[event.body.direction],
66+
footer: 'Mobserve',
67+
text: content,
68+
ts: event.body.date / 1000,
69+
}],
70+
},
71+
})
72+
},
73+
})
74+
```
75+
76+
### Download
77+
78+
You can download the latest version from [Releases](https://github.com/syncloudsoftech/mobserve/releases) page.
79+
80+
### License
81+
82+
See [LICENSE](LICENSE) file.

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'kotlin-android'
4+
id 'kotlin-kapt'
5+
id 'kotlinx-serialization'
6+
}
7+
8+
android {
9+
buildFeatures {
10+
dataBinding true
11+
viewBinding true
12+
}
13+
compileOptions {
14+
sourceCompatibility JavaVersion.VERSION_1_8
15+
targetCompatibility JavaVersion.VERSION_1_8
16+
}
17+
compileSdk 33
18+
defaultConfig {
19+
applicationId 'com.syncloudsoft.mobserve'
20+
minSdk 21
21+
targetSdk 33
22+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
23+
versionCode 1
24+
versionName '1.0'
25+
vectorDrawables.useSupportLibrary = true
26+
}
27+
kotlinOptions {
28+
jvmTarget = '1.8'
29+
}
30+
signingConfigs {
31+
release {
32+
storeFile System.getenv('SIGNING_KEYSTORE')
33+
? rootProject.file(System.getenv('SIGNING_KEYSTORE'))
34+
: null
35+
storePassword System.getenv('SIGNING_KEYSTORE_PASSWORD')
36+
keyAlias System.getenv('SIGNING_KEY')
37+
keyPassword System.getenv('SIGNING_KEY_PASSWORD')
38+
v1SigningEnabled true
39+
v2SigningEnabled true
40+
}
41+
}
42+
buildTypes {
43+
release {
44+
minifyEnabled false
45+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
46+
signingConfig signingConfigs.release
47+
}
48+
}
49+
namespace 'com.syncloudsoft.mobserve'
50+
}
51+
52+
dependencies {
53+
implementation 'androidx.appcompat:appcompat:1.5.1'
54+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
55+
implementation 'androidx.core:core-ktx:1.9.0'
56+
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.2'
57+
implementation 'androidx.navigation:navigation-ui-ktx:2.5.2'
58+
implementation 'androidx.preference:preference-ktx:1.2.0'
59+
implementation 'androidx.room:room-runtime:2.4.3'
60+
annotationProcessor 'androidx.room:room-compiler:2.4.3'
61+
kapt 'androidx.room:room-compiler:2.4.3'
62+
implementation 'androidx.work:work-runtime:2.7.1'
63+
implementation 'androidx.work:work-runtime-ktx:2.7.1'
64+
implementation 'com.github.vaibhavpandeyvpz:katora-java:1.0.0'
65+
implementation 'com.google.android.material:material:1.6.1'
66+
implementation 'com.jakewharton.timber:timber:5.0.1'
67+
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
68+
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0'
69+
implementation 'pub.devrel:easypermissions:3.0.0'
70+
testImplementation 'junit:junit:'
71+
testImplementation 'androidx.room:room-testing:2.4.3'
72+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
73+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
74+
androidTestImplementation 'androidx.work:work-testing:2.7.1'
75+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.syncloudsoft.mobserve
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
@RunWith(AndroidJUnit4::class)
12+
class ExampleInstrumentedTest {
13+
14+
@Test
15+
fun useAppContext() {
16+
// Context of the app under test.
17+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
18+
assertEquals("com.syncloudsoft.mobserve", appContext.packageName)
19+
}
20+
}

app/src/main/AndroidManifest.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
5+
<uses-permission android:name="android.permission.INTERNET" />
6+
<uses-permission android:name="android.permission.READ_CALL_LOG" />
7+
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
8+
<uses-permission android:name="android.permission.READ_SMS" />
9+
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
10+
11+
<application
12+
android:allowBackup="true"
13+
android:icon="@mipmap/ic_launcher"
14+
android:label="@string/app_name"
15+
android:name=".MainApplication"
16+
android:roundIcon="@mipmap/ic_launcher_round"
17+
android:supportsRtl="true"
18+
android:theme="@style/Theme.Mobserve">
19+
20+
<activity
21+
android:name=".MainActivity"
22+
android:exported="true"
23+
android:theme="@style/Theme.Mobserve.NoActionBar">
24+
25+
<intent-filter>
26+
<action android:name="android.intent.action.MAIN" />
27+
<category android:name="android.intent.category.LAUNCHER" />
28+
</intent-filter>
29+
30+
</activity>
31+
32+
<receiver
33+
android:name=".spy.TextMessageBroadcastReceiver"
34+
android:exported="true">
35+
36+
<intent-filter>
37+
<action android:name="android.intent.action.BOOT_COMPLETED" />
38+
</intent-filter>
39+
40+
</receiver>
41+
42+
<service android:name=".spy.PhoneCallOrMessageService" />
43+
44+
</application>
45+
46+
</manifest>

0 commit comments

Comments
 (0)