Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Misterr-H committed Nov 5, 2022
1 parent 42fab58 commit 9febc27
Show file tree
Hide file tree
Showing 75 changed files with 6,036 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
15 changes: 15 additions & 0 deletions Whatsapp-chatbot-android-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
3 changes: 3 additions & 0 deletions Whatsapp-chatbot-android-app/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Whatsapp-chatbot-android-app/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Whatsapp-chatbot-android-app/.idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions Whatsapp-chatbot-android-app/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Whatsapp-chatbot-android-app/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Whatsapp-chatbot-android-app/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
56 changes: 56 additions & 0 deletions Whatsapp-chatbot-android-app/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
apply plugin: 'kotlin-android'

android {
compileSdk 33
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "com.misterh.tech.angela"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
namespace 'com.misterh.tech.angela'
}

dependencies {
implementation 'com.squareup.okhttp3:okhttp:3.8.1'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-firestore:24.4.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "androidx.core:core-ktx:"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation("com.tbuonomo:dotsindicator:4.3")
implementation 'com.intuit.sdp:sdp-android:1.1.0'
}
repositories {
// mavenCentral()
// google()
// mavenCentral()
}
39 changes: 39 additions & 0 deletions Whatsapp-chatbot-android-app/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"project_info": {
"project_number": "863756050593",
"project_id": "angela-eab82",
"storage_bucket": "angela-eab82.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:863756050593:android:fd1b6cbefd9bf72f9790e0",
"android_client_info": {
"package_name": "com.misterh.tech.angela"
}
},
"oauth_client": [
{
"client_id": "863756050593-p1a71pq0k6pv5mlglqnc2eaidsgr47j6.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDgJTiIg7PyREouqhhHtH-2c2NtN_IBWJ4"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "863756050593-p1a71pq0k6pv5mlglqnc2eaidsgr47j6.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
21 changes: 21 additions & 0 deletions Whatsapp-chatbot-android-app/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.misterh.tech.angela

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.misterh.tech.angela", appContext.packageName)
}
}
44 changes: 44 additions & 0 deletions Whatsapp-chatbot-android-app/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AngelaTheAIWhatsAppBot"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

<service
android:name=".NotificationService"
android:exported="true"
android:label="@string/service_name"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>

<meta-data
android:name="android.service.notification.default_filter_types"
android:value="conversations|alerting"></meta-data>
<meta-data
android:name="android.service.notification.disabled_filter_types"
android:value="ongoing|silent"></meta-data>
</service>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package com.misterh.tech.angela.Fragment

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Switch
import android.widget.Toast
import com.google.android.material.switchmaterial.SwitchMaterial
import com.misterh.tech.angela.MainActivity
import com.misterh.tech.angela.R

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private const val ARG_PARAM1 = "param1"
private const val ARG_PARAM2 = "param2"

/**
* A simple [Fragment] subclass.
* Use the [MainFragment.newInstance] factory method to
* create an instance of this fragment.
*/
class MainFragment : Fragment() {
// TODO: Rename and change types of parameters
private var param1: Boolean? = null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.let {
param1 = it.getBoolean(ARG_PARAM1)
}


}

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {





// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_main, container, false)
}

override fun onStart() {
super.onStart()

param1 = (activity as MainActivity).checkNotificationEnabled()
val switch = requireView().findViewById(R.id.switch2) as SwitchMaterial

switch.setOnClickListener() {
if(switch.isChecked) {
if(param1 == false) {
val intent = Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS")
startActivity(intent)
}
Toast.makeText(activity, "Bot Enabled", Toast.LENGTH_SHORT).show()
}
else {
Toast.makeText(activity, "Bot Disabled", Toast.LENGTH_SHORT).show()
}
val pref = activity?.getSharedPreferences("com.misterh.tech.angela", Context.MODE_PRIVATE)
with(pref?.edit()) {
this?.putBoolean("mode", switch.isChecked)
this?.apply()
}
}
}

companion object {
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment MainFragment.
*/
// TODO: Rename and change types and number of parameters
@JvmStatic
fun newInstance(param1: Boolean) =
MainFragment().apply {
arguments = Bundle().apply {
putBoolean(ARG_PARAM1, param1)
}
}
}
}
Loading

0 comments on commit 9febc27

Please sign in to comment.