├── app
├── .gitignore
├── libs
│ ├── mail.jar
│ ├── activation.jar
│ └── additionnal.jar
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── drawable
│ │ │ │ ├── a.png
│ │ │ │ ├── exit.png
│ │ │ │ ├── help.png
│ │ │ │ ├── onbp.png
│ │ │ │ ├── user.png
│ │ │ │ ├── about.png
│ │ │ │ ├── alpha.png
│ │ │ │ ├── laptop.png
│ │ │ │ ├── login.png
│ │ │ │ ├── logout.png
│ │ │ │ ├── account.png
│ │ │ │ ├── android.png
│ │ │ │ ├── favourite.png
│ │ │ │ ├── onb_user.png
│ │ │ │ ├── profile.png
│ │ │ │ ├── project.png
│ │ │ │ ├── whatshot.png
│ │ │ │ ├── onb_getstarted.png
│ │ │ │ ├── indicator_unselected.xml
│ │ │ │ ├── indicator_selected.xml
│ │ │ │ ├── edit.xml
│ │ │ │ ├── ic_chevron_right_24dp.xml
│ │ │ │ ├── mail.xml
│ │ │ │ ├── network.xml
│ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── raw
│ │ │ │ └── alarm.mp3
│ │ │ ├── font
│ │ │ │ └── bookerly.ttf
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── color
│ │ │ │ └── nav_colors.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── layout
│ │ │ │ ├── fragment_about.xml
│ │ │ │ ├── fragment_help.xml
│ │ │ │ ├── fragment_get_location.xml
│ │ │ │ ├── fragment_discover.xml
│ │ │ │ ├── activity_emergency_timer.xml
│ │ │ │ ├── activity_module_design.xml
│ │ │ │ ├── activity_root.xml
│ │ │ │ ├── fragment_module.xml
│ │ │ │ ├── activity_home.xml
│ │ │ │ ├── fragment_module_design.xml
│ │ │ │ ├── nav_header.xml
│ │ │ │ ├── activity_splash.xml
│ │ │ │ ├── activity_help_sms.xml
│ │ │ │ ├── fragment_user.xml
│ │ │ │ ├── fragment_onboarding.xml
│ │ │ │ ├── card_user.xml
│ │ │ │ ├── app_bar.xml
│ │ │ │ ├── fragment_lostphone.xml
│ │ │ │ ├── fragment_smswifion.xml
│ │ │ │ ├── fragment_smswifioff.xml
│ │ │ │ ├── fragment_volume_max.xml
│ │ │ │ ├── fragment_quotes_email.xml
│ │ │ │ ├── card_discover.xml
│ │ │ │ ├── fragment_low_battery_sm.xml
│ │ │ │ ├── fragment_xkcd.xml
│ │ │ │ ├── fragment_rss.xml
│ │ │ │ ├── fragment_volume_min.xml
│ │ │ │ ├── activity_onboarding.xml
│ │ │ │ ├── fragment_wifi_ontimer.xml
│ │ │ │ ├── fragment_geo_fencing.xml
│ │ │ │ ├── fragment_wifi_timer.xml
│ │ │ │ └── fragment_help_button.xml
│ │ │ ├── values-w820dp
│ │ │ │ └── dimens.xml
│ │ │ ├── menu
│ │ │ │ ├── menu_onboarding.xml
│ │ │ │ ├── navigation.xml
│ │ │ │ └── drawer_view.xml
│ │ │ ├── values
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ └── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── aaars
│ │ │ │ └── b
│ │ │ │ ├── MessageListener.java
│ │ │ │ ├── TriggerLogs.java
│ │ │ │ ├── LastRun.java
│ │ │ │ ├── UserData.java
│ │ │ │ ├── Fragments
│ │ │ │ ├── HelpFragment.java
│ │ │ │ ├── AboutFragment.java
│ │ │ │ ├── ModuleDesignFragment.java
│ │ │ │ ├── LowBatterySMS.java
│ │ │ │ ├── QuotesEmail.java
│ │ │ │ ├── XKCD.java
│ │ │ │ ├── VolumeMax.java
│ │ │ │ ├── VolumeMin.java
│ │ │ │ ├── SMSWiFiOn.java
│ │ │ │ ├── GetLocation.java
│ │ │ │ ├── SMSWiFiOff.java
│ │ │ │ ├── RSS.java
│ │ │ │ ├── LostPhone.java
│ │ │ │ └── WiFiOnTimer.java
│ │ │ │ ├── Module.java
│ │ │ │ ├── JSSEProvider.java
│ │ │ │ ├── Splash.java
│ │ │ │ ├── GMailSender.java
│ │ │ │ ├── HelpSMS.java
│ │ │ │ ├── TriggerOnReceiver.java
│ │ │ │ └── TriggerReceiver.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── aaars
│ │ │ └── b
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── aaars
│ │ └── b
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
├── google-services.json
└── build.gradle
├── screenshots
├── .gitignore
├── app-five.jpg
├── app-four.jpg
├── app-nine.jpg
├── app-one.jpg
├── app-six.jpg
├── app-ten.jpg
├── app-two.jpg
├── app-eight.jpg
├── app-eleven.jpg
├── app-seven.jpg
└── app-three.jpg
├── settings.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── gradle.properties
├── gradlew.bat
├── README.md
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/screenshots/.gitignore:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/app/libs/mail.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/libs/mail.jar
--------------------------------------------------------------------------------
/app/libs/activation.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/libs/activation.jar
--------------------------------------------------------------------------------
/app/libs/additionnal.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/libs/additionnal.jar
--------------------------------------------------------------------------------
/screenshots/app-five.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/screenshots/app-five.jpg
--------------------------------------------------------------------------------
/screenshots/app-four.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/screenshots/app-four.jpg
--------------------------------------------------------------------------------
/screenshots/app-nine.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/screenshots/app-nine.jpg
--------------------------------------------------------------------------------
/screenshots/app-one.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/screenshots/app-one.jpg
--------------------------------------------------------------------------------
/screenshots/app-six.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/screenshots/app-six.jpg
--------------------------------------------------------------------------------
/screenshots/app-ten.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/screenshots/app-ten.jpg
--------------------------------------------------------------------------------
/screenshots/app-two.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/screenshots/app-two.jpg
--------------------------------------------------------------------------------
/screenshots/app-eight.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/screenshots/app-eight.jpg
--------------------------------------------------------------------------------
/screenshots/app-eleven.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/screenshots/app-eleven.jpg
--------------------------------------------------------------------------------
/screenshots/app-seven.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/screenshots/app-seven.jpg
--------------------------------------------------------------------------------
/screenshots/app-three.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/screenshots/app-three.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/a.png
--------------------------------------------------------------------------------
/app/src/main/res/raw/alarm.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/raw/alarm.mp3
--------------------------------------------------------------------------------
/app/src/main/res/drawable/exit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/exit.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/help.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/onbp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/onbp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/user.png
--------------------------------------------------------------------------------
/app/src/main/res/font/bookerly.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/font/bookerly.ttf
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/drawable/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/about.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/alpha.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/alpha.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/laptop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/laptop.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/login.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/logout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/logout.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/account.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/account.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/android.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/favourite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/favourite.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/onb_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/onb_user.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/profile.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/project.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/project.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/whatshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/whatshot.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/onb_getstarted.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/drawable/onb_getstarted.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/theashwin/automator/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/MessageListener.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b;
2 |
3 | public interface MessageListener {
4 | void messageReceived(String message);
5 | }
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/libraries
5 | /.idea/modules.xml
6 | /.idea/workspace.xml
7 | .DS_Store
8 | /build
9 | /captures
10 | .externalNativeBuild
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/TriggerLogs.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b;
2 |
3 | public class TriggerLogs {
4 | public int id;
5 |
6 | public TriggerLogs() {}
7 |
8 | public TriggerLogs(int id) {
9 | this.id = id;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/res/color/nav_colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/indicator_unselected.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/indicator_selected.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Sep 07 23:12:31 IST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/edit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/LastRun.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b;
2 |
3 | import java.util.*;
4 |
5 | public class LastRun {
6 | public ArrayList lastrun;
7 |
8 |
9 | public LastRun() {
10 | lastrun = new ArrayList<>();
11 | for(int i = 0; i < 29; i++) {
12 | lastrun.add("0");
13 | }
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_chevron_right_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_onboarding.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 | 8dp
7 |
8 | 8dp
9 | 24dp
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/aaars/b/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/mail.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/UserData.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b;
2 |
3 | import android.support.annotation.Keep;
4 |
5 | @Keep
6 | public class UserData {
7 | public String name;
8 | public String email;
9 | public String photo;
10 |
11 | public UserData() { }
12 |
13 | public UserData(String name, String email, String photo) {
14 | this.name = name;
15 | this.email = email;
16 | this.photo = photo;
17 |
18 | }
19 |
20 | public class activity { }
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_help.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_get_location.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/network.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/navigation.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #488EFF
4 | #488EFF
5 | #ffd739
6 |
7 | #00BCD4
8 | #4CAF50
9 | #FF9800
10 | #e0e0e0
11 | #40e0e0e0
12 | #00000000
13 | #FFA000
14 | #D32F2F
15 |
16 | #ffffff
17 | #80ffffff
18 |
19 | #a4c639
20 |
21 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/HelpFragment.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 |
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | import com.aaars.b.R;
11 |
12 | /**
13 | * A simple {@link Fragment} subclass.
14 | */
15 | public class HelpFragment extends Fragment {
16 |
17 |
18 | public HelpFragment() {
19 | // Required empty public constructor
20 | }
21 |
22 |
23 | @Override
24 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
25 | Bundle savedInstanceState) {
26 | // Inflate the layout for this fragment
27 | return inflater.inflate(R.layout.fragment_help, container, false);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/AboutFragment.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 |
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | import com.aaars.b.R;
11 |
12 | /**
13 | * A simple {@link Fragment} subclass.
14 | */
15 | public class AboutFragment extends Fragment {
16 |
17 |
18 | public AboutFragment() {
19 | // Required empty public constructor
20 | }
21 |
22 |
23 | @Override
24 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
25 | Bundle savedInstanceState) {
26 | // Inflate the layout for this fragment
27 | return inflater.inflate(R.layout.fragment_about, container, false);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/aaars/b/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.aaars.b", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Module.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b;
2 |
3 | import java.util.*;
4 |
5 | public class Module {
6 | public int activityid;
7 | public int triggerid;
8 | public Boolean enabled;
9 | public ArrayList parameters;
10 |
11 |
12 | public Module() {
13 | activityid = -1;
14 | triggerid = -1;
15 | enabled = false;
16 | parameters = new ArrayList<>();
17 | }
18 |
19 | public void onStart() {
20 | if(enabled) {
21 | switch(activityid) {
22 | case 1:
23 | break;
24 | case -1:
25 | return;
26 | }
27 |
28 | switch(triggerid) {
29 | case 1:
30 | break;
31 | case -1:
32 | return;
33 | }
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_discover.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
13 |
14 |
19 |
20 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
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
22 |
23 | -keep class com.google.firebase.example.fireeats.model.** { *; }
24 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Automator
3 | Onboarding
4 | Settings
5 | To get started, please signup using Google to get you up and running in no time.
6 | The app requires special permissions to function.
7 | Almost there! A beautiful world, that works for you awaits.
8 | Modules
9 | Discover
10 | Profile
11 |
12 |
13 | Ashwin Patil
14 | theashwinpaitl@gmail.com
15 |
16 |
17 | Hello blank fragment
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
14 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_emergency_timer.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
18 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_module_design.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
18 |
26 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/JSSEProvider.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b;
2 |
3 | import java.security.AccessController;
4 | import java.security.Provider;
5 |
6 | public final class JSSEProvider extends Provider {
7 | public JSSEProvider() {
8 | super("HarmonyJSSE", 1.0, "Harmony JSSE Provider");
9 | AccessController
10 | .doPrivileged(new java.security.PrivilegedAction() {
11 |
12 | public Void run() {
13 | put("SSLContext.TLS",
14 | "org.apache.harmony.xnet.provider.jsse.SSLContextImpl");
15 | put("Alg.Alias.SSLContext.TLSv1", "TLS");
16 | put("KeyManagerFactory.X509",
17 | "org.apache.harmony.xnet.provider.jsse.KeyManagerFactoryImpl");
18 | put("TrustManagerFactory.X509",
19 | "org.apache.harmony.xnet.provider.jsse.TrustManagerFactoryImpl");
20 | return null;
21 | }
22 |
23 | });
24 | }
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_root.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
18 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_module.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
13 |
14 |
20 |
21 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
17 |
18 |
25 |
26 |
27 |
28 |
29 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_module_design.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
20 |
21 |
29 |
30 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/nav_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
20 |
21 |
30 |
31 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/drawer_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_splash.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
20 |
21 |
25 |
26 |
27 |
33 |
34 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_help_sms.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
20 |
21 |
25 |
26 |
27 |
33 |
34 |
42 |
--------------------------------------------------------------------------------
/app/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "7999255876**",
4 | "firebase_url": "https://automator-*****.firebaseio.com",
5 | "project_id": "automator-*****",
6 | "storage_bucket": "automator-*****.appspot.com"
7 | },
8 | "client": [
9 | {
10 | "client_info": {
11 | "mobilesdk_app_id": "1:799925587615:android:fc9c7a81a0*****",
12 | "android_client_info": {
13 | "package_name": "com.aaars.b"
14 | }
15 | },
16 | "oauth_client": [
17 | {
18 | "client_id": "799925587615-3e2fceaf4qrb3dca85kktihaeo3*****.apps.googleusercontent.com",
19 | "client_type": 1,
20 | "android_info": {
21 | "package_name": "com.aaars.b",
22 | "certificate_hash": "89bf870f5428cc7b009e43209dba759eb92*****"
23 | }
24 | },
25 | {
26 | "client_id": "799925587615-l5oger5tfjm4gos5fcflkbab0k*****.apps.googleusercontent.com",
27 | "client_type": 3
28 | }
29 | ],
30 | "api_key": [
31 | {
32 | "current_key": "AIzaSyAmgzEA7CjfRBPxkok4R5n9Nm9E******"
33 | }
34 | ],
35 | "services": {
36 | "analytics_service": {
37 | "status": 1
38 | },
39 | "appinvite_service": {
40 | "status": 2,
41 | "other_platform_oauth_client": [
42 | {
43 | "client_id": "799925587615-l5oger5tfjm4gos5fcflkbab*****.apps.googleusercontent.com",
44 | "client_type": 3
45 | }
46 | ]
47 | },
48 | "ads_service": {
49 | "status": 2
50 | }
51 | }
52 | }
53 | ],
54 | "configuration_version": "1"
55 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_user.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
14 |
15 |
25 |
32 |
33 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_onboarding.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
22 |
23 |
35 |
36 |
43 |
44 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 28
5 | defaultConfig {
6 | applicationId "com.aaars.b"
7 | minSdkVersion 21
8 | targetSdkVersion 28
9 | versionCode 1
10 | versionName "1.23.1"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | sourceSets { main { java.srcDirs = ['src/main/java', 'src/main/java/com.aaars.b/Fragments'] } }
20 | }
21 |
22 | dependencies {
23 | implementation fileTree(include: ['*.jar'], dir: 'libs')
24 | implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
25 | implementation 'com.android.support.constraint:constraint-layout:1.1.3'
26 | implementation 'com.google.firebase:firebase-core:16.0.3'
27 | implementation 'com.google.firebase:firebase-auth:16.0.3'
28 | implementation 'com.google.firebase:firebase-database:16.0.1'
29 | implementation 'com.google.android.gms:play-services-auth:16.0.0'
30 | implementation 'com.android.support:design:28.0.0-alpha1'
31 | implementation 'com.android.support:support-v4:28.0.0-alpha1'
32 | implementation 'com.android.support:cardview-v7:28.0.0-alpha1'
33 | implementation 'com.android.support:recyclerview-v7:28.0.0-alpha1'
34 | implementation 'com.prof.rssparser:rssparser:1.4.4'
35 | testImplementation 'junit:junit:4.12'
36 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
37 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
38 | implementation 'com.google.android.gms:play-services-maps:15.0.0'
39 | implementation files('libs/activation.jar')
40 | implementation files('libs/additionnal.jar')
41 | implementation files('libs/mail.jar')
42 | }
43 |
44 | apply plugin: 'com.google.gms.google-services'
45 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/ModuleDesignFragment.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 |
4 | import android.content.Intent;
5 | import android.content.IntentFilter;
6 | import android.os.BatteryManager;
7 | import android.os.Bundle;
8 | import android.support.v4.app.Fragment;
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.widget.Button;
13 | import android.widget.EditText;
14 | import android.widget.TextView;
15 |
16 | import com.aaars.b.R;
17 |
18 | /**
19 | * A simple {@link Fragment} subclass.
20 | */
21 | public class ModuleDesignFragment extends Fragment {
22 |
23 | private Button mDo;
24 | private EditText input;
25 | private int parameter;
26 |
27 | public ModuleDesignFragment() { }
28 |
29 |
30 | @Override
31 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
32 | Bundle savedInstanceState) {
33 | View view =inflater.inflate(R.layout.fragment_module_design, container, false);
34 |
35 | mDo = view.findViewById(R.id.click);
36 | input = view.findViewById(R.id.input);
37 |
38 | final TextView tv = view.findViewById(R.id.tv);
39 |
40 | IntentFilter ifilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
41 | Intent batteryStatus = getContext().registerReceiver(null, ifilter);
42 |
43 | final int level = batteryStatus.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
44 |
45 | tv.setText("" + level);
46 |
47 | mDo.setOnClickListener(new View.OnClickListener() {
48 | @Override
49 | public void onClick(View view) {
50 | parameter = Integer.parseInt(input.getText().toString());
51 | if(level < parameter) {
52 | tv.setTextColor(getResources().getColor(R.color.green));
53 | }
54 | else {
55 | tv.setTextColor(getResources().getColor(R.color.orange));
56 | }
57 | }
58 | });
59 |
60 |
61 |
62 | return view;
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/card_user.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
19 |
20 |
30 |
31 |
40 |
41 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
20 |
21 |
28 |
29 |
30 |
31 |
32 |
38 |
39 |
53 |
54 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Automator - App That Works For You
2 | ```
3 | The modern technology solutions are diverse and work at different levels making it difficult for the
4 | users to link their applications to work synchronously. Individual applications are a great feature in
5 | itself but integration of various applications and services can lead to increased productivity.
6 | Integration will save time on users part to perform simple functionalities.
7 | ```
8 | ```
9 | Our project is an Android application which aims to connect applications and create an unique workflow.
10 | It’s main purpose is to interlink applications and reduce the users work. Automator’s primary task will be
11 | to interconnect basic applications like SMS service, Wi-Fi service, Location service etc. (phone functionalities)
12 | with each other in order to simplify users work. It will create a workflow that will automate everyday
13 | functions for the user. It will also provide features for individual and device safety.
14 | This project was inspired by the app IFTTT.
15 | ```
16 |
17 | ## Screenshots
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_lostphone.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
25 |
26 |
37 |
38 |
48 |
49 |
59 |
60 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_smswifion.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
25 |
26 |
37 |
38 |
48 |
49 |
59 |
60 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_smswifioff.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
25 |
26 |
37 |
38 |
48 |
49 |
59 |
60 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_volume_max.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
25 |
26 |
37 |
38 |
48 |
49 |
59 |
60 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_quotes_email.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
24 |
25 |
37 |
38 |
39 |
50 |
51 |
62 |
63 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/card_discover.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
20 |
21 |
35 |
36 |
47 |
48 |
57 |
58 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_low_battery_sm.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
24 |
25 |
37 |
38 |
51 |
52 |
63 |
64 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_xkcd.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
24 |
25 |
37 |
38 |
39 |
52 |
53 |
64 |
65 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Splash.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b;
2 |
3 | import android.app.NotificationChannel;
4 | import android.app.NotificationManager;
5 | import android.app.PendingIntent;
6 | import android.content.Intent;
7 | import android.content.IntentFilter;
8 | import android.os.Build;
9 | import android.os.Handler;
10 | import android.support.v4.app.NotificationCompat;
11 | import android.support.v4.app.NotificationManagerCompat;
12 | import android.support.v7.app.AppCompatActivity;
13 | import android.os.Bundle;
14 | import android.widget.ProgressBar;
15 |
16 | import com.google.firebase.analytics.FirebaseAnalytics;
17 |
18 | import java.util.Random;
19 |
20 | public class Splash extends AppCompatActivity {
21 |
22 | private ProgressBar progressBar;
23 | private int progressStatus = 0;
24 | private Handler handler = new Handler();
25 | private FirebaseAnalytics mFirebaseAnalytics;
26 |
27 | @Override
28 | protected void onStart() {
29 | super.onStart();
30 | }
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | setContentView(R.layout.activity_splash);
36 | createNotificationChannel();
37 |
38 | mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
39 |
40 | progressBar = findViewById(R.id.progressBar);
41 |
42 | new Thread(new Runnable() {
43 | @Override
44 | public void run() {
45 | while(progressStatus < 100) {
46 | progressStatus += new Random().nextInt(15);
47 | handler.post(new Runnable() {
48 | public void run() {
49 | progressBar.setProgress(progressStatus);
50 | }
51 | });
52 | try {
53 | Thread.sleep(50); //SET TO ARBITRARY NUMBER
54 | } catch (InterruptedException e) {
55 | e.printStackTrace();
56 | }
57 | }
58 | Intent onbIntent = new Intent(Splash.this, Onboarding.class);
59 | Splash.this.startActivity(onbIntent);
60 | finish();
61 | }
62 | }).start();
63 | }
64 |
65 | private void createNotificationChannel(){
66 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
67 | //MIN
68 | int importanceLow = NotificationManager.IMPORTANCE_LOW;
69 | NotificationChannel channelLow = new NotificationChannel("default", "Automator", importanceLow);
70 | channelLow.setDescription("Automator Notification Channel");
71 |
72 | //HIGH PRIORITY
73 | int importanceHigh = NotificationManager.IMPORTANCE_HIGH;
74 | NotificationChannel channelHigh = new NotificationChannel("high", "Automator", importanceHigh);
75 | channelHigh.setDescription("Automator Notification Channel");
76 |
77 | NotificationManager notificationManager = getSystemService(NotificationManager.class);
78 |
79 | notificationManager.createNotificationChannel(channelLow);
80 | notificationManager.createNotificationChannel(channelHigh);
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
38 |
42 |
43 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
61 |
62 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_rss.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
24 |
25 |
37 |
38 |
51 |
52 |
64 |
65 |
76 |
77 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_volume_min.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
24 |
25 |
37 |
38 |
51 |
52 |
65 |
66 |
77 |
78 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/GMailSender.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b;
2 |
3 | import javax.activation.DataHandler;
4 | import javax.activation.DataSource;
5 | import javax.activation.FileDataSource;
6 | import javax.mail.BodyPart;
7 | import javax.mail.Message;
8 | import javax.mail.Multipart;
9 | import javax.mail.PasswordAuthentication;
10 | import javax.mail.Session;
11 | import javax.mail.Transport;
12 | import javax.mail.internet.InternetAddress;
13 | import javax.mail.internet.MimeBodyPart;
14 | import javax.mail.internet.MimeMessage;
15 | import javax.mail.internet.MimeMultipart;
16 | import java.io.ByteArrayInputStream;
17 | import java.io.IOException;
18 | import java.io.InputStream;
19 | import java.io.OutputStream;
20 | import java.security.Security;
21 | import java.util.Properties;
22 |
23 | public class GMailSender extends javax.mail.Authenticator {
24 | private String mailhost = "smtp.gmail.com";
25 | private String user;
26 | private String password;
27 | private Session session;
28 |
29 | static {
30 | Security.addProvider(new com.aaars.b.JSSEProvider());
31 | }
32 |
33 | public GMailSender(String user, String password) {
34 | this.user = user;
35 | this.password = password;
36 |
37 | Properties props = new Properties();
38 | props.setProperty("mail.transport.protocol", "smtp");
39 | props.setProperty("mail.host", mailhost);
40 | props.put("mail.smtp.auth", "true");
41 | props.put("mail.smtp.port", "465");
42 | props.put("mail.smtp.socketFactory.port", "465");
43 | props.put("mail.smtp.socketFactory.class",
44 | "javax.net.ssl.SSLSocketFactory");
45 | props.put("mail.smtp.socketFactory.fallback", "false");
46 | props.setProperty("mail.smtp.quitwait", "false");
47 |
48 | session = Session.getDefaultInstance(props, this);
49 | }
50 |
51 | protected PasswordAuthentication getPasswordAuthentication() {
52 | return new PasswordAuthentication(user, password);
53 | }
54 |
55 | public synchronized void sendMail(String subject, String body, String sender, String recipients) throws Exception {
56 | try{
57 | MimeMessage message = new MimeMessage(session);
58 | DataHandler handler = new DataHandler(new ByteArrayDataSource(body.getBytes(), "text/html"));
59 | message.setSender(new InternetAddress(sender));
60 | message.setSubject(subject);
61 | message.setDataHandler(handler);
62 | if (recipients.indexOf(',') > 0)
63 | message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipients));
64 | else
65 | message.setRecipient(Message.RecipientType.TO, new InternetAddress(recipients));
66 | Transport.send(message);
67 | }catch(Exception e){
68 |
69 | }
70 | }
71 |
72 | public class ByteArrayDataSource implements DataSource {
73 | private byte[] data;
74 | private String type;
75 |
76 | public ByteArrayDataSource(byte[] data, String type) {
77 | super();
78 | this.data = data;
79 | this.type = type;
80 | }
81 |
82 | public ByteArrayDataSource(byte[] data) {
83 | super();
84 | this.data = data;
85 | }
86 |
87 | public void setType(String type) {
88 | this.type = type;
89 | }
90 |
91 | public String getContentType() {
92 | if (type == null)
93 | return "application/octet-stream";
94 | else
95 | return type;
96 | }
97 |
98 | public InputStream getInputStream() throws IOException {
99 | return new ByteArrayInputStream(data);
100 | }
101 |
102 | public String getName() {
103 | return "ByteArrayDataSource";
104 | }
105 |
106 | public OutputStream getOutputStream() throws IOException {
107 | throw new IOException("Not Supported");
108 | }
109 | }
110 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_onboarding.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
18 |
19 |
20 |
27 |
28 |
36 |
37 |
38 |
46 |
47 |
52 |
53 |
60 |
61 |
68 |
69 |
75 |
76 |
77 |
78 |
79 |
88 |
89 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/HelpSMS.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b;
2 |
3 | import android.Manifest;
4 | import android.content.Intent;
5 | import android.content.pm.PackageManager;
6 | import android.location.Location;
7 | import android.location.LocationListener;
8 | import android.location.LocationManager;
9 | import android.support.v4.content.ContextCompat;
10 | import android.support.v7.app.AppCompatActivity;
11 | import android.os.Bundle;
12 | import android.telephony.SmsManager;
13 | import android.widget.Toast;
14 |
15 | import com.google.firebase.database.DataSnapshot;
16 | import com.google.firebase.database.DatabaseError;
17 | import com.google.firebase.database.DatabaseReference;
18 | import com.google.firebase.database.FirebaseDatabase;
19 | import com.google.firebase.database.ValueEventListener;
20 |
21 | import static com.aaars.b.Root.USER_ID;
22 |
23 | public class HelpSMS extends AppCompatActivity {
24 | SmsManager smsManager, smsManagerbeta, smsManagergamma;
25 | LocationManager locationManager;
26 | Module md6;
27 | DatabaseReference drmd6;
28 | Boolean flag = true;
29 |
30 | @Override
31 | protected void onCreate(Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 | setContentView(R.layout.activity_help_sms);
34 |
35 | FirebaseDatabase database = FirebaseDatabase.getInstance();
36 |
37 | //5 HELP - MODULE 10
38 | drmd6 = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("10");
39 | ValueEventListener helpListener = new ValueEventListener() {
40 | @Override
41 | public void onDataChange(DataSnapshot dataSnapshot) {
42 | if(dataSnapshot.exists()) {
43 | md6 = dataSnapshot.getValue(Module.class);
44 | if(flag)
45 | call(md6.parameters.get(0),md6.parameters.get(1),md6.parameters.get(2));
46 | }
47 | }
48 |
49 | @Override
50 | public void onCancelled(DatabaseError databaseError) {
51 | Toast.makeText(getApplicationContext(), "Failed to load post.",
52 | Toast.LENGTH_SHORT).show();
53 | }
54 | };
55 | drmd6.addValueEventListener(helpListener);
56 |
57 | }
58 |
59 | void call(String a, String b, String c) {
60 | try {
61 | flag = false;
62 | smsManager = SmsManager.getDefault();
63 |
64 | final LocationListener locationListener = new LocationListener() {
65 | @Override
66 | public void onLocationChanged(final Location location) {
67 | FirebaseDatabase database = FirebaseDatabase.getInstance();
68 | DatabaseReference ref = database.getReference("users").child(USER_ID).child("modules");
69 | ref.child("10").child("currentLocation").setValue(location);
70 | }
71 |
72 | @Override
73 | public void onStatusChanged(String s, int i, Bundle bundle) {
74 | }
75 |
76 | @Override
77 | public void onProviderEnabled(String s) {
78 | }
79 |
80 | @Override
81 | public void onProviderDisabled(String s) {
82 | }
83 | };
84 |
85 | locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
86 | if (PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION))
87 | locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 15,
88 | 50, locationListener);
89 |
90 | Location lc = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
91 | String content = "I am here: https://www.google.com/maps/search/?api=1&query=" + lc.getLatitude() + "," + lc.getLongitude() + " - Sent via Automator";
92 | if (a.length() == 10)
93 | smsManager.sendTextMessage(a, null, content, null, null);
94 | if (b.length() == 10)
95 | smsManager.sendTextMessage(b, null, content, null, null);
96 | if (c.length() == 10)
97 | smsManager.sendTextMessage(c, null, content, null, null);
98 | finish();
99 | System.exit(0);
100 | }
101 | catch (Exception e) {
102 | Toast.makeText(getApplicationContext(), "Module Ran, Restart app to sync with server", Toast.LENGTH_LONG).show();
103 | }
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/TriggerOnReceiver.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b;
2 |
3 | import android.app.PendingIntent;
4 | import android.content.BroadcastReceiver;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.media.MediaPlayer;
8 | import android.net.Uri;
9 | import android.net.wifi.WifiManager;
10 | import android.os.BatteryManager;
11 | import android.os.Environment;
12 | import android.support.v4.app.NotificationCompat;
13 | import android.support.v4.app.NotificationManagerCompat;
14 | import android.support.v4.content.ContextCompat;
15 | import android.widget.Toast;
16 |
17 | import com.google.firebase.database.DataSnapshot;
18 | import com.google.firebase.database.DatabaseError;
19 | import com.google.firebase.database.DatabaseReference;
20 | import com.google.firebase.database.FirebaseDatabase;
21 | import com.google.firebase.database.ValueEventListener;
22 |
23 | import java.util.Calendar;
24 |
25 | import static com.aaars.b.Root.USER_ID;
26 |
27 | public class TriggerOnReceiver extends BroadcastReceiver {
28 | Module md2;
29 |
30 | @Override
31 | public void onReceive(final Context context, Intent intent) {
32 |
33 | try {
34 | md2 = new Module();
35 | FirebaseDatabase database = FirebaseDatabase.getInstance();
36 | DatabaseReference drmd2 = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("3");
37 | ValueEventListener wifiTimerListener = new ValueEventListener() {
38 | @Override
39 | public void onDataChange(DataSnapshot dataSnapshot) {
40 | if (dataSnapshot.exists()) {
41 | md2 = dataSnapshot.getValue(Module.class);
42 | Calendar c = Calendar.getInstance();
43 | c.setTimeInMillis(System.currentTimeMillis());
44 |
45 | int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);
46 | int weekDay = 0;
47 |
48 | if (Calendar.MONDAY == dayOfWeek) weekDay = 0;
49 | else if (Calendar.TUESDAY == dayOfWeek) weekDay = 1;
50 | else if (Calendar.WEDNESDAY == dayOfWeek) weekDay = 2;
51 | else if (Calendar.THURSDAY == dayOfWeek) weekDay = 3;
52 | else if (Calendar.FRIDAY == dayOfWeek) weekDay = 4;
53 | else if (Calendar.SATURDAY == dayOfWeek) weekDay = 5;
54 | else if (Calendar.SUNDAY == dayOfWeek) weekDay = 6;
55 |
56 |
57 | if (md2.parameters.get(weekDay).equals("true")) {
58 | WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
59 | if (wifiManager != null) {
60 | wifiManager.setWifiEnabled(true);
61 | callNotification("A Module Ran - WiFi Turned ON", "WiFi was turned ON!", context);
62 | }
63 | }
64 | }
65 | }
66 |
67 | @Override
68 | public void onCancelled(DatabaseError databaseError) {
69 | Toast.makeText(context, "Failed to load post.",
70 | Toast.LENGTH_SHORT).show();
71 | }
72 | };
73 | drmd2.addValueEventListener(wifiTimerListener);
74 | }
75 | catch(Exception e) {
76 | Toast.makeText(context, "Module ran, Restart app to sync", Toast.LENGTH_LONG).show();
77 | }
78 | }
79 |
80 | public void callNotification(String title, String text, Context context) {
81 | Intent intent = new Intent(context, Splash.class);
82 | intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
83 | PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
84 |
85 | NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, "default")
86 | .setContentTitle(title)
87 | .setContentText(text)
88 | .setStyle(new NotificationCompat.BigTextStyle()
89 | .bigText(text))
90 | .setSmallIcon(R.drawable.alpha)
91 | .setPriority(NotificationCompat.PRIORITY_DEFAULT)
92 | .setContentIntent(pendingIntent)
93 | .setColor(ContextCompat.getColor(context, R.color.colorPrimary))
94 | .setAutoCancel(true);
95 |
96 | NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
97 | notificationManager.notify(1, mBuilder.build());
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/LowBatterySMS.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.Button;
9 | import android.widget.CompoundButton;
10 | import android.widget.EditText;
11 | import android.widget.Switch;
12 | import android.widget.TextView;
13 | import android.widget.Toast;
14 |
15 | import com.aaars.b.Module;
16 | import com.aaars.b.ModuleDesign;
17 | import com.aaars.b.R;
18 | import com.google.firebase.database.DataSnapshot;
19 | import com.google.firebase.database.DatabaseError;
20 | import com.google.firebase.database.DatabaseReference;
21 | import com.google.firebase.database.FirebaseDatabase;
22 | import com.google.firebase.database.ValueEventListener;
23 |
24 |
25 | public class LowBatterySMS extends Fragment {
26 |
27 | TextView tv, tvhead;
28 | Switch toggle;
29 | EditText input;
30 | Button savePhone;
31 | String USER_ID;
32 |
33 | public Module md;
34 | DatabaseReference dr;
35 |
36 |
37 | public LowBatterySMS() {}
38 |
39 |
40 | @Override
41 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
42 | Bundle savedInstanceState) {
43 | View view = inflater.inflate(R.layout.fragment_low_battery_sm, container, false);
44 |
45 | USER_ID = ModuleDesign.USER_ID;
46 | md = new Module();
47 |
48 | tvhead = view.findViewById(R.id.tvhead);
49 | tv = view.findViewById(R.id.tv);
50 | toggle = view.findViewById(R.id.toggle);
51 | input = view.findViewById(R.id.input);
52 | savePhone = view.findViewById(R.id.savePhone);
53 |
54 | tvhead.setText("Send SMS to your trusted contacts when battery is low.");
55 | tv.setText("Sending SMS to your trusted contacts can be of great help when your battery runs out of power");
56 |
57 | //FIREBASE DATABASE
58 | FirebaseDatabase database = FirebaseDatabase.getInstance();
59 |
60 | dr = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("1");
61 | ValueEventListener postListener = new ValueEventListener() {
62 | @Override
63 | public void onDataChange(DataSnapshot dataSnapshot) {
64 | if(dataSnapshot.exists()) {
65 | md = dataSnapshot.getValue(Module.class);
66 | toggle.setChecked(md.enabled);
67 | if(md.parameters.get(0).length() == 10) {
68 | input.setText(md.parameters.get(0));
69 | input.setEnabled(false);
70 | savePhone.setText("Edit Number");
71 | }
72 |
73 | }
74 | else {
75 | //INSTANTIATION OF MODULE 01
76 | md.triggerid = 101;
77 | md.activityid = 101;
78 | md.enabled = true;
79 | md.parameters.add("");
80 | dr.setValue(md);
81 |
82 | input.setEnabled(true);
83 | savePhone.setText("Save Number");
84 | }
85 | }
86 |
87 | @Override
88 | public void onCancelled(DatabaseError databaseError) {
89 | Toast.makeText(getContext(), "Failed to load post.",
90 | Toast.LENGTH_SHORT).show();
91 | }
92 | };
93 | dr.addValueEventListener(postListener);
94 |
95 | savePhone.setOnClickListener(new View.OnClickListener() {
96 | @Override
97 | public void onClick(View view) {
98 | if (input.isEnabled()) {
99 | String phone = input.getText().toString();
100 | if (phone.length() == 10) {
101 | md.parameters.set(0,phone);
102 | dr.setValue(md);
103 | input.setEnabled(false);
104 | savePhone.setText("Edit Number");
105 | }
106 | }
107 | else {
108 | input.setEnabled(true);
109 | savePhone.setText("Save Number");
110 | }
111 | }
112 | });
113 |
114 | toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
115 | @Override
116 | public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
117 | md.enabled = b;
118 | dr.setValue(md);
119 | }
120 | });
121 |
122 | return view;
123 | }
124 |
125 | }
126 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/QuotesEmail.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.Button;
9 | import android.widget.CompoundButton;
10 | import android.widget.EditText;
11 | import android.widget.Switch;
12 | import android.widget.TextView;
13 | import android.widget.Toast;
14 |
15 | import com.aaars.b.Module;
16 | import com.aaars.b.ModuleDesign;
17 | import com.aaars.b.R;
18 | import com.google.firebase.database.DataSnapshot;
19 | import com.google.firebase.database.DatabaseError;
20 | import com.google.firebase.database.DatabaseReference;
21 | import com.google.firebase.database.FirebaseDatabase;
22 | import com.google.firebase.database.ValueEventListener;
23 |
24 |
25 | public class QuotesEmail extends Fragment {
26 |
27 | TextView tv, tvhead;
28 | Switch toggle;
29 | EditText input;
30 | Button email;
31 | String USER_ID;
32 |
33 | public Module md;
34 | DatabaseReference dr;
35 |
36 |
37 | public QuotesEmail() {}
38 |
39 |
40 | @Override
41 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
42 | Bundle savedInstanceState) {
43 | View view = inflater.inflate(R.layout.fragment_xkcd, container, false);
44 |
45 | USER_ID = ModuleDesign.USER_ID;
46 | md = new Module();
47 |
48 | tvhead = view.findViewById(R.id.tvhead);
49 | tv = view.findViewById(R.id.tv);
50 | toggle = view.findViewById(R.id.toggle);
51 | input = view.findViewById(R.id.input);
52 | email = view.findViewById(R.id.savePhone);
53 |
54 | tvhead.setText("Sends Quote of the Day to you email address");
55 | tv.setText("Uses RSS feed to send you a quote of the day at 10 a.m. everyday.");
56 |
57 | //FIREBASE DATABASE
58 | FirebaseDatabase database = FirebaseDatabase.getInstance();
59 |
60 | dr = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("5");
61 | ValueEventListener postListener = new ValueEventListener() {
62 | @Override
63 | public void onDataChange(DataSnapshot dataSnapshot) {
64 | if(dataSnapshot.exists()) {
65 | md = dataSnapshot.getValue(Module.class);
66 | toggle.setChecked(md.enabled);
67 | if(md.parameters.get(0).contains("@") && md.parameters.get(0).contains(".")) {
68 | input.setText(md.parameters.get(0));
69 | input.setEnabled(false);
70 | email.setText("Edit Email");
71 | }
72 | }
73 | else {
74 | //INSTANTIATION OF MODULE 01
75 | md.triggerid = 101;
76 | md.activityid = 101;
77 | md.enabled = true;
78 | md.parameters.add("");
79 | dr.setValue(md);
80 |
81 | input.setEnabled(true);
82 | email.setText("Save Email");
83 | }
84 | }
85 |
86 | @Override
87 | public void onCancelled(DatabaseError databaseError) {
88 | Toast.makeText(getContext(), "Failed to load post.",
89 | Toast.LENGTH_SHORT).show();
90 | }
91 | };
92 | dr.addValueEventListener(postListener);
93 |
94 | email.setOnClickListener(new View.OnClickListener() {
95 | @Override
96 | public void onClick(View view) {
97 | if (input.isEnabled()) {
98 | String emailid = input.getText().toString();
99 | if (emailid.contains("@") && emailid.contains(".") && emailid.length() > 10) {
100 | md.parameters.set(0,emailid);
101 | dr.setValue(md);
102 | input.setEnabled(false);
103 | email.setText("Edit Email");
104 | }
105 | }
106 | else {
107 | input.setEnabled(true);
108 | email.setText("Save Email");
109 | }
110 | }
111 | });
112 |
113 | toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
114 | @Override
115 | public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
116 | md.enabled = b;
117 | dr.setValue(md);
118 | }
119 | });
120 |
121 | return view;
122 | }
123 |
124 | }
125 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_wifi_ontimer.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
24 |
25 |
36 |
37 |
44 |
45 |
55 |
56 |
62 |
68 |
74 |
80 |
81 |
88 |
94 |
100 |
101 |
102 |
109 |
110 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/TriggerReceiver.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b;
2 |
3 | import android.app.PendingIntent;
4 | import android.content.BroadcastReceiver;
5 | import android.content.Context;
6 | import android.content.Intent;
7 | import android.media.MediaPlayer;
8 | import android.net.Uri;
9 | import android.net.wifi.WifiManager;
10 | import android.os.BatteryManager;
11 | import android.os.Environment;
12 | import android.support.v4.app.NotificationCompat;
13 | import android.support.v4.app.NotificationManagerCompat;
14 | import android.support.v4.content.ContextCompat;
15 | import android.widget.Toast;
16 |
17 | import com.google.firebase.database.DataSnapshot;
18 | import com.google.firebase.database.DatabaseError;
19 | import com.google.firebase.database.DatabaseReference;
20 | import com.google.firebase.database.FirebaseDatabase;
21 | import com.google.firebase.database.ValueEventListener;
22 |
23 | import java.util.Calendar;
24 |
25 | import static com.aaars.b.Root.USER_ID;
26 |
27 | public class TriggerReceiver extends BroadcastReceiver {
28 | Module md2;
29 |
30 | @Override
31 | public void onReceive(final Context context, Intent intent) {
32 | /*
33 | MediaPlayer mpintro = MediaPlayer.create(context, Uri.parse(Environment.getExternalStorageDirectory().getPath()+ "/Alarms/pirate.mp3"));
34 | mpintro.setLooping(true);
35 | mpintro.start();
36 | */
37 | md2 = new Module();
38 | FirebaseDatabase database = FirebaseDatabase.getInstance();
39 | DatabaseReference drmd2 = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("2");
40 | ValueEventListener wifiTimerListener = new ValueEventListener() {
41 | @Override
42 | public void onDataChange(DataSnapshot dataSnapshot) {
43 | if(dataSnapshot.exists()) {
44 | md2 = dataSnapshot.getValue(Module.class);
45 | Calendar c = Calendar.getInstance();
46 | c.setTimeInMillis(System.currentTimeMillis());
47 |
48 | int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);
49 | int weekDay = 0;
50 |
51 | if (Calendar.MONDAY == dayOfWeek) weekDay = 0;
52 | else if (Calendar.TUESDAY == dayOfWeek) weekDay = 1;
53 | else if (Calendar.WEDNESDAY == dayOfWeek) weekDay = 2;
54 | else if (Calendar.THURSDAY == dayOfWeek) weekDay = 3;
55 | else if (Calendar.FRIDAY == dayOfWeek) weekDay = 4;
56 | else if (Calendar.SATURDAY == dayOfWeek) weekDay = 5;
57 | else if (Calendar.SUNDAY == dayOfWeek) weekDay = 6;
58 |
59 | if(md2.parameters.get(weekDay).equals("true")) {
60 | try {
61 | WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
62 | if(wifiManager != null) {
63 | wifiManager.setWifiEnabled(false);
64 | callNotification("A Module Ran - WiFi Turned OFF","WiFi was turned OFF!", context);
65 | }
66 | }
67 | catch (Exception e) {
68 | Toast.makeText(context, "Module ran, Restart app to sync", Toast.LENGTH_LONG).show();
69 | }
70 | }
71 | }
72 | }
73 |
74 | @Override
75 | public void onCancelled(DatabaseError databaseError) {
76 | Toast.makeText(context, "Failed to load post.",
77 | Toast.LENGTH_SHORT).show();
78 | }
79 | };
80 | drmd2.addValueEventListener(wifiTimerListener);
81 | }
82 |
83 | public void callNotification(String title, String text, Context context) {
84 | Intent intent = new Intent(context, Splash.class);
85 | intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
86 | PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
87 |
88 | NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context, "default")
89 | .setContentTitle(title)
90 | .setContentText(text)
91 | .setStyle(new NotificationCompat.BigTextStyle()
92 | .bigText(text))
93 | .setSmallIcon(R.drawable.alpha)
94 | .setPriority(NotificationCompat.PRIORITY_DEFAULT)
95 | .setContentIntent(pendingIntent)
96 | .setColor(ContextCompat.getColor(context, R.color.colorPrimary))
97 | .setAutoCancel(true);
98 |
99 | NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
100 | notificationManager.notify(1, mBuilder.build());
101 | }
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/XKCD.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 | import android.os.Bundle;
4 | import android.support.design.widget.Snackbar;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.Button;
10 | import android.widget.CompoundButton;
11 | import android.widget.EditText;
12 | import android.widget.Switch;
13 | import android.widget.TextView;
14 | import android.widget.Toast;
15 |
16 | import com.aaars.b.Module;
17 | import com.aaars.b.ModuleDesign;
18 | import com.aaars.b.R;
19 | import com.google.firebase.database.DataSnapshot;
20 | import com.google.firebase.database.DatabaseError;
21 | import com.google.firebase.database.DatabaseReference;
22 | import com.google.firebase.database.FirebaseDatabase;
23 | import com.google.firebase.database.ValueEventListener;
24 |
25 |
26 | public class XKCD extends Fragment {
27 |
28 | TextView tv, tvhead;
29 | Switch toggle;
30 | EditText input;
31 | Button email;
32 | String USER_ID;
33 |
34 | public Module md;
35 | DatabaseReference dr;
36 |
37 |
38 | public XKCD() {}
39 |
40 |
41 | @Override
42 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
43 | Bundle savedInstanceState) {
44 | View view = inflater.inflate(R.layout.fragment_xkcd, container, false);
45 |
46 | USER_ID = ModuleDesign.USER_ID;
47 | md = new Module();
48 |
49 | tvhead = view.findViewById(R.id.tvhead);
50 | tv = view.findViewById(R.id.tv);
51 | toggle = view.findViewById(R.id.toggle);
52 | input = view.findViewById(R.id.input);
53 | email = view.findViewById(R.id.savePhone);
54 |
55 | tvhead.setText("Sends a comic snippet daily to you email address");
56 | tv.setText("Uses RSS feed to send you a comic snippet at 10 a.m. everyday.");
57 |
58 | //FIREBASE DATABASE
59 | FirebaseDatabase database = FirebaseDatabase.getInstance();
60 |
61 | dr = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("7");
62 | ValueEventListener postListener = new ValueEventListener() {
63 | @Override
64 | public void onDataChange(DataSnapshot dataSnapshot) {
65 | if(dataSnapshot.exists()) {
66 | md = dataSnapshot.getValue(Module.class);
67 | toggle.setChecked(md.enabled);
68 | if(md.parameters.get(0).contains("@") && md.parameters.get(0).contains(".")) {
69 | input.setText(md.parameters.get(0));
70 | input.setEnabled(false);
71 | email.setText("Edit Email");
72 | }
73 | }
74 | else {
75 | //INSTANTIATION OF MODULE 01
76 | md.triggerid = 101;
77 | md.activityid = 101;
78 | md.enabled = true;
79 | md.parameters.add("");
80 | dr.setValue(md);
81 |
82 | input.setEnabled(true);
83 | email.setText("Save Email");
84 | }
85 | }
86 |
87 | @Override
88 | public void onCancelled(DatabaseError databaseError) {
89 | Toast.makeText(getContext(), "Failed to load post.",
90 | Toast.LENGTH_SHORT).show();
91 | }
92 | };
93 | dr.addValueEventListener(postListener);
94 |
95 | email.setOnClickListener(new View.OnClickListener() {
96 | @Override
97 | public void onClick(View view) {
98 | if (input.isEnabled()) {
99 | String emailid = input.getText().toString();
100 | if (emailid.contains("@") && emailid.contains(".") && emailid.length() > 10) {
101 | md.parameters.set(0,emailid);
102 | dr.setValue(md);
103 | input.setEnabled(false);
104 | email.setText("Edit Email");
105 | }
106 | else {
107 | Toast.makeText(getContext(),"Enter a valid email address",Toast.LENGTH_LONG).show();
108 | }
109 | }
110 | else {
111 | input.setEnabled(true);
112 | email.setText("Save Email");
113 | }
114 | }
115 | });
116 |
117 | toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
118 | @Override
119 | public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
120 | md.enabled = b;
121 | dr.setValue(md);
122 | }
123 | });
124 |
125 | return view;
126 | }
127 |
128 | }
129 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_geo_fencing.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
24 |
25 |
37 |
38 |
39 |
52 |
53 |
66 |
67 |
80 |
81 |
85 |
86 |
96 |
97 |
98 |
109 |
110 |
111 |
112 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_wifi_timer.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
24 |
25 |
37 |
38 |
45 |
46 |
56 |
57 |
63 |
69 |
75 |
81 |
82 |
89 |
95 |
101 |
102 |
111 |
112 |
123 |
124 |
125 |
126 |
127 |
128 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/VolumeMax.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.view.WindowManager;
9 | import android.widget.Button;
10 | import android.widget.CompoundButton;
11 | import android.widget.EditText;
12 | import android.widget.Switch;
13 | import android.widget.TextView;
14 | import android.widget.Toast;
15 |
16 | import com.aaars.b.Module;
17 | import com.aaars.b.ModuleDesign;
18 | import com.aaars.b.R;
19 | import com.google.firebase.database.DataSnapshot;
20 | import com.google.firebase.database.DatabaseError;
21 | import com.google.firebase.database.DatabaseReference;
22 | import com.google.firebase.database.FirebaseDatabase;
23 | import com.google.firebase.database.ValueEventListener;
24 |
25 |
26 | public class VolumeMax extends Fragment {
27 |
28 | TextView tv, tvhead;
29 | Switch toggle;
30 | EditText input;
31 | Button email;
32 | String USER_ID;
33 |
34 | public Module md;
35 | DatabaseReference dr;
36 |
37 |
38 | public VolumeMax() {}
39 |
40 |
41 | @Override
42 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
43 | Bundle savedInstanceState) {
44 | View view = inflater.inflate(R.layout.fragment_volume_min, container, false);
45 |
46 | getActivity().getWindow().setSoftInputMode(
47 | WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
48 |
49 | USER_ID = ModuleDesign.USER_ID;
50 | md = new Module();
51 |
52 | tvhead = view.findViewById(R.id.tvhead);
53 | tv = view.findViewById(R.id.tv);
54 | toggle = view.findViewById(R.id.toggle);
55 | input = view.findViewById(R.id.input);
56 | email = view.findViewById(R.id.savePhone);
57 | TextView paraphrase = view.findViewById(R.id.paraphrase);
58 |
59 | tvhead.setText("Set device volume to maximum through sms");
60 | tv.setText("On receiving a sms containing keywords and paraphrase sets the volume to maximum value");
61 | paraphrase.setText("volume max ");
62 |
63 | //FIREBASE DATABASE
64 | FirebaseDatabase database = FirebaseDatabase.getInstance();
65 |
66 | dr = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("6");
67 | ValueEventListener postListener = new ValueEventListener() {
68 | @Override
69 | public void onDataChange(DataSnapshot dataSnapshot) {
70 | if(dataSnapshot.exists()) {
71 | md = dataSnapshot.getValue(Module.class);
72 |
73 | if(!md.parameters.get(0).equals(""))
74 | input.setEnabled(false);
75 |
76 | toggle.setChecked(md.parameters.get(3).equals("true"));
77 | input.setText(md.parameters.get(0));
78 | email.setText("Edit Paraphrase");
79 |
80 | }
81 | else {
82 | //INSTANTIATION OF MODULE 01
83 | md.triggerid = 105;
84 | md.activityid = 108;
85 | md.enabled = true;
86 | md.parameters.add("");
87 | for(int i = 0; i < 6; i++)
88 | md.parameters.add("false");
89 | dr.setValue(md);
90 |
91 | input.setEnabled(true);
92 | email.setText("Save Paraphrase");
93 | }
94 | }
95 |
96 | @Override
97 | public void onCancelled(DatabaseError databaseError) {
98 | Toast.makeText(getContext(), "Failed to load post.",
99 | Toast.LENGTH_SHORT).show();
100 | }
101 | };
102 | dr.addValueEventListener(postListener);
103 |
104 | email.setOnClickListener(new View.OnClickListener() {
105 | @Override
106 | public void onClick(View view) {
107 | if (input.isEnabled()) {
108 | String paraphrase = input.getText().toString();
109 | if (paraphrase.length() > 3) {
110 | md.parameters.set(0,paraphrase);
111 | dr.setValue(md);
112 | input.setEnabled(false);
113 | email.setText("Edit Paraphrase");
114 | }
115 | }
116 | else {
117 | input.setEnabled(true);
118 | email.setText("Save Paraphrase");
119 | }
120 | }
121 | });
122 |
123 | toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
124 | @Override
125 | public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
126 | md.parameters.set(3,(b?"true":"false"));
127 | dr.setValue(md);
128 | }
129 | });
130 |
131 | return view;
132 | }
133 |
134 | }
135 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/VolumeMin.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.view.WindowManager;
9 | import android.widget.Button;
10 | import android.widget.CompoundButton;
11 | import android.widget.EditText;
12 | import android.widget.Switch;
13 | import android.widget.TextView;
14 | import android.widget.Toast;
15 |
16 | import com.aaars.b.Module;
17 | import com.aaars.b.ModuleDesign;
18 | import com.aaars.b.R;
19 | import com.google.firebase.database.DataSnapshot;
20 | import com.google.firebase.database.DatabaseError;
21 | import com.google.firebase.database.DatabaseReference;
22 | import com.google.firebase.database.FirebaseDatabase;
23 | import com.google.firebase.database.ValueEventListener;
24 |
25 |
26 | public class VolumeMin extends Fragment {
27 |
28 | TextView tv, tvhead;
29 | Switch toggle;
30 | EditText input;
31 | Button email;
32 | String USER_ID;
33 |
34 | public Module md;
35 | DatabaseReference dr;
36 |
37 |
38 | public VolumeMin() {}
39 |
40 |
41 | @Override
42 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
43 | Bundle savedInstanceState) {
44 | View view = inflater.inflate(R.layout.fragment_volume_min, container, false);
45 |
46 | getActivity().getWindow().setSoftInputMode(
47 | WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
48 |
49 | USER_ID = ModuleDesign.USER_ID;
50 | md = new Module();
51 |
52 | tvhead = view.findViewById(R.id.tvhead);
53 | tv = view.findViewById(R.id.tv);
54 | toggle = view.findViewById(R.id.toggle);
55 | input = view.findViewById(R.id.input);
56 | email = view.findViewById(R.id.savePhone);
57 | TextView paraphrase = view.findViewById(R.id.paraphrase);
58 |
59 | tvhead.setText("Set device volume to minimum through sms");
60 | tv.setText("On receiving a sms containing keywords and paraphrase sets the volume to minimum value");
61 | paraphrase.setText("volume min ");
62 |
63 | //FIREBASE DATABASE
64 | FirebaseDatabase database = FirebaseDatabase.getInstance();
65 |
66 | dr = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("6");
67 | ValueEventListener postListener = new ValueEventListener() {
68 | @Override
69 | public void onDataChange(DataSnapshot dataSnapshot) {
70 | if(dataSnapshot.exists()) {
71 | md = dataSnapshot.getValue(Module.class);
72 |
73 | if(!md.parameters.get(0).equals(""))
74 | input.setEnabled(false);
75 |
76 | toggle.setChecked(md.parameters.get(4).equals("true"));
77 | input.setText(md.parameters.get(0));
78 | email.setText("Edit Paraphrase");
79 |
80 | }
81 | else {
82 | //INSTANTIATION OF MODULE 01
83 | md.triggerid = 105;
84 | md.activityid = 108;
85 | md.enabled = true;
86 | md.parameters.add("");
87 | for(int i = 0; i < 6; i++)
88 | md.parameters.add("false");
89 | dr.setValue(md);
90 |
91 | input.setEnabled(true);
92 | email.setText("Save Paraphrase");
93 | }
94 | }
95 |
96 | @Override
97 | public void onCancelled(DatabaseError databaseError) {
98 | Toast.makeText(getContext(), "Failed to load post.",
99 | Toast.LENGTH_SHORT).show();
100 | }
101 | };
102 | dr.addValueEventListener(postListener);
103 |
104 | email.setOnClickListener(new View.OnClickListener() {
105 | @Override
106 | public void onClick(View view) {
107 | if (input.isEnabled()) {
108 | String paraphrase = input.getText().toString();
109 | if (paraphrase.length() > 3) {
110 | md.parameters.set(0,paraphrase);
111 | dr.setValue(md);
112 | input.setEnabled(false);
113 | email.setText("Edit Paraphrase");
114 | }
115 | }
116 | else {
117 | input.setEnabled(true);
118 | email.setText("Save Paraphrase");
119 | }
120 | }
121 | });
122 |
123 | toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
124 | @Override
125 | public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
126 | md.parameters.set(4,(b?"true":"false"));
127 | dr.setValue(md);
128 | }
129 | });
130 |
131 | return view;
132 | }
133 |
134 | }
135 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/SMSWiFiOn.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.view.WindowManager;
9 | import android.widget.Button;
10 | import android.widget.CompoundButton;
11 | import android.widget.EditText;
12 | import android.widget.Switch;
13 | import android.widget.TextView;
14 | import android.widget.Toast;
15 |
16 | import com.aaars.b.Module;
17 | import com.aaars.b.ModuleDesign;
18 | import com.aaars.b.R;
19 | import com.google.firebase.database.DataSnapshot;
20 | import com.google.firebase.database.DatabaseError;
21 | import com.google.firebase.database.DatabaseReference;
22 | import com.google.firebase.database.FirebaseDatabase;
23 | import com.google.firebase.database.ValueEventListener;
24 |
25 |
26 | public class SMSWiFiOn extends Fragment {
27 |
28 | TextView tv, tvhead;
29 | Switch toggle;
30 | EditText input;
31 | Button email;
32 | String USER_ID;
33 |
34 | public Module md;
35 | DatabaseReference dr;
36 |
37 |
38 | public SMSWiFiOn() {}
39 |
40 |
41 | @Override
42 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
43 | Bundle savedInstanceState) {
44 | View view = inflater.inflate(R.layout.fragment_volume_min, container, false);
45 |
46 | getActivity().getWindow().setSoftInputMode(
47 | WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
48 |
49 | USER_ID = ModuleDesign.USER_ID;
50 | md = new Module();
51 |
52 | tvhead = view.findViewById(R.id.tvhead);
53 | tv = view.findViewById(R.id.tv);
54 | toggle = view.findViewById(R.id.toggle);
55 | input = view.findViewById(R.id.input);
56 | email = view.findViewById(R.id.savePhone);
57 | TextView paraphrase = view.findViewById(R.id.paraphrase);
58 |
59 | tvhead.setText("Switch on device wifi through sms");
60 | tv.setText("On receiving a sms containing keywords and paraphrase switches on the wifi for remote control of your device");
61 | paraphrase.setText("wifi on ");
62 |
63 | //FIREBASE DATABASE
64 | FirebaseDatabase database = FirebaseDatabase.getInstance();
65 |
66 | dr = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("6");
67 | ValueEventListener postListener = new ValueEventListener() {
68 | @Override
69 | public void onDataChange(DataSnapshot dataSnapshot) {
70 | if(dataSnapshot.exists()) {
71 | md = dataSnapshot.getValue(Module.class);
72 |
73 | if(!md.parameters.get(0).equals(""))
74 | input.setEnabled(false);
75 |
76 | toggle.setChecked(md.parameters.get(1).equals("true"));
77 | input.setText(md.parameters.get(0));
78 | email.setText("Edit Paraphrase");
79 |
80 | }
81 | else {
82 | //INSTANTIATION OF MODULE 01
83 | md.triggerid = 105;
84 | md.activityid = 106;
85 | md.enabled = true;
86 | md.parameters.add("");
87 | for(int i = 0; i < 6; i++)
88 | md.parameters.add("false");
89 | dr.setValue(md);
90 |
91 | input.setEnabled(true);
92 | email.setText("Save Paraphrase");
93 | }
94 | }
95 |
96 | @Override
97 | public void onCancelled(DatabaseError databaseError) {
98 | Toast.makeText(getContext(), "Failed to load post.",
99 | Toast.LENGTH_SHORT).show();
100 | }
101 | };
102 | dr.addValueEventListener(postListener);
103 |
104 | email.setOnClickListener(new View.OnClickListener() {
105 | @Override
106 | public void onClick(View view) {
107 | if (input.isEnabled()) {
108 | String paraphrase = input.getText().toString();
109 | if (paraphrase.length() > 3) {
110 | md.parameters.set(0,paraphrase);
111 | dr.setValue(md);
112 | input.setEnabled(false);
113 | email.setText("Edit Paraphrase");
114 | }
115 | }
116 | else {
117 | input.setEnabled(true);
118 | email.setText("Save Paraphrase");
119 | }
120 | }
121 | });
122 |
123 | toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
124 | @Override
125 | public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
126 | md.parameters.set(1,(b?"true":"false"));
127 | dr.setValue(md);
128 | }
129 | });
130 |
131 | return view;
132 | }
133 |
134 | }
135 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/GetLocation.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.view.WindowManager;
9 | import android.widget.Button;
10 | import android.widget.CompoundButton;
11 | import android.widget.EditText;
12 | import android.widget.Switch;
13 | import android.widget.TextView;
14 | import android.widget.Toast;
15 |
16 | import com.aaars.b.Module;
17 | import com.aaars.b.ModuleDesign;
18 | import com.aaars.b.R;
19 | import com.google.firebase.database.DataSnapshot;
20 | import com.google.firebase.database.DatabaseError;
21 | import com.google.firebase.database.DatabaseReference;
22 | import com.google.firebase.database.FirebaseDatabase;
23 | import com.google.firebase.database.ValueEventListener;
24 |
25 |
26 | public class GetLocation extends Fragment {
27 |
28 | TextView tv, tvhead;
29 | Switch toggle;
30 | EditText input;
31 | Button email;
32 | String USER_ID;
33 |
34 | public Module md;
35 | DatabaseReference dr;
36 |
37 |
38 | public GetLocation() {}
39 |
40 |
41 | @Override
42 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
43 | Bundle savedInstanceState) {
44 | View view = inflater.inflate(R.layout.fragment_volume_min, container, false);
45 |
46 | getActivity().getWindow().setSoftInputMode(
47 | WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
48 |
49 | USER_ID = ModuleDesign.USER_ID;
50 | md = new Module();
51 |
52 | tvhead = view.findViewById(R.id.tvhead);
53 | tv = view.findViewById(R.id.tv);
54 | toggle = view.findViewById(R.id.toggle);
55 | input = view.findViewById(R.id.input);
56 | email = view.findViewById(R.id.savePhone);
57 | TextView paraphrase = view.findViewById(R.id.paraphrase);
58 |
59 | tvhead.setText("Get device location through sms");
60 | tv.setText("On receiving a sms containing keywords and paraphrase sends the location of the device to requesting number");
61 | paraphrase.setText("location ");
62 |
63 | //FIREBASE DATABASE
64 | FirebaseDatabase database = FirebaseDatabase.getInstance();
65 |
66 | dr = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("6");
67 | ValueEventListener postListener = new ValueEventListener() {
68 | @Override
69 | public void onDataChange(DataSnapshot dataSnapshot) {
70 | if(dataSnapshot.exists()) {
71 | md = dataSnapshot.getValue(Module.class);
72 |
73 | if(!md.parameters.get(0).equals(""))
74 | input.setEnabled(false);
75 |
76 | toggle.setChecked(md.parameters.get(6).equals("true"));
77 | input.setText(md.parameters.get(0));
78 | email.setText("Edit Paraphrase");
79 |
80 | }
81 | else {
82 | //INSTANTIATION OF MODULE 01
83 | md.triggerid = 105;
84 | md.activityid = 108;
85 | md.enabled = true;
86 | md.parameters.add("");
87 | for(int i = 0; i < 6; i++)
88 | md.parameters.add("false");
89 | dr.setValue(md);
90 |
91 | input.setEnabled(true);
92 | email.setText("Save Paraphrase");
93 | }
94 | }
95 |
96 | @Override
97 | public void onCancelled(DatabaseError databaseError) {
98 | Toast.makeText(getContext(), "Failed to load post.",
99 | Toast.LENGTH_SHORT).show();
100 | }
101 | };
102 | dr.addValueEventListener(postListener);
103 |
104 | email.setOnClickListener(new View.OnClickListener() {
105 | @Override
106 | public void onClick(View view) {
107 | if (input.isEnabled()) {
108 | String paraphrase = input.getText().toString();
109 | if (paraphrase.length() > 3) {
110 | md.parameters.set(0,paraphrase);
111 | dr.setValue(md);
112 | input.setEnabled(false);
113 | email.setText("Edit Paraphrase");
114 | }
115 | }
116 | else {
117 | input.setEnabled(true);
118 | email.setText("Save Paraphrase");
119 | }
120 | }
121 | });
122 |
123 | toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
124 | @Override
125 | public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
126 | md.parameters.set(6,(b?"true":"false"));
127 | dr.setValue(md);
128 | }
129 | });
130 |
131 | return view;
132 | }
133 |
134 | }
135 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/SMSWiFiOff.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.view.WindowManager;
9 | import android.widget.Button;
10 | import android.widget.CompoundButton;
11 | import android.widget.EditText;
12 | import android.widget.Switch;
13 | import android.widget.TextView;
14 | import android.widget.Toast;
15 |
16 | import com.aaars.b.Module;
17 | import com.aaars.b.ModuleDesign;
18 | import com.aaars.b.R;
19 | import com.google.firebase.database.DataSnapshot;
20 | import com.google.firebase.database.DatabaseError;
21 | import com.google.firebase.database.DatabaseReference;
22 | import com.google.firebase.database.FirebaseDatabase;
23 | import com.google.firebase.database.ValueEventListener;
24 |
25 |
26 | public class SMSWiFiOff extends Fragment {
27 |
28 | TextView tv, tvhead;
29 | Switch toggle;
30 | EditText input;
31 | Button email;
32 | String USER_ID;
33 |
34 | public Module md;
35 | DatabaseReference dr;
36 |
37 |
38 | public SMSWiFiOff() {}
39 |
40 |
41 | @Override
42 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
43 | Bundle savedInstanceState) {
44 | View view = inflater.inflate(R.layout.fragment_volume_min, container, false);
45 |
46 | getActivity().getWindow().setSoftInputMode(
47 | WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
48 |
49 | USER_ID = ModuleDesign.USER_ID;
50 | md = new Module();
51 |
52 | tvhead = view.findViewById(R.id.tvhead);
53 | tv = view.findViewById(R.id.tv);
54 | toggle = view.findViewById(R.id.toggle);
55 | input = view.findViewById(R.id.input);
56 | email = view.findViewById(R.id.savePhone);
57 | TextView paraphrase = view.findViewById(R.id.paraphrase);
58 |
59 | tvhead.setText("Switch off device wifi through sms");
60 | tv.setText("On receiving a sms containing keywords and paraphrase switches off the wifi for remote control of your device");
61 | paraphrase.setText("wifi off ");
62 |
63 | //FIREBASE DATABASE
64 | FirebaseDatabase database = FirebaseDatabase.getInstance();
65 |
66 | dr = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("6");
67 | ValueEventListener postListener = new ValueEventListener() {
68 | @Override
69 | public void onDataChange(DataSnapshot dataSnapshot) {
70 | if(dataSnapshot.exists()) {
71 | md = dataSnapshot.getValue(Module.class);
72 |
73 | if(!md.parameters.get(0).equals(""))
74 | input.setEnabled(false);
75 |
76 | toggle.setChecked(md.parameters.get(2).equals("true"));
77 | input.setText(md.parameters.get(0));
78 | email.setText("Edit Paraphrase");
79 |
80 | }
81 | else {
82 | //INSTANTIATION OF MODULE 01
83 | md.triggerid = 105;
84 | md.activityid = 107;
85 | md.enabled = true;
86 | md.parameters.add("");
87 | for(int i = 0; i < 6; i++)
88 | md.parameters.add("false");
89 | dr.setValue(md);
90 |
91 | input.setEnabled(true);
92 | email.setText("Save Paraphrase");
93 | }
94 | }
95 |
96 | @Override
97 | public void onCancelled(DatabaseError databaseError) {
98 | Toast.makeText(getContext(), "Failed to load post.",
99 | Toast.LENGTH_SHORT).show();
100 | }
101 | };
102 | dr.addValueEventListener(postListener);
103 |
104 | email.setOnClickListener(new View.OnClickListener() {
105 | @Override
106 | public void onClick(View view) {
107 | if (input.isEnabled()) {
108 | String paraphrase = input.getText().toString();
109 | if (paraphrase.length() > 3) {
110 | md.parameters.set(0,paraphrase);
111 | dr.setValue(md);
112 | input.setEnabled(false);
113 | email.setText("Edit Paraphrase");
114 | }
115 | }
116 | else {
117 | input.setEnabled(true);
118 | email.setText("Save Paraphrase");
119 | }
120 | }
121 | });
122 |
123 | toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
124 | @Override
125 | public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
126 | md.parameters.set(2,(b?"true":"false"));
127 | dr.setValue(md);
128 | }
129 | });
130 |
131 | return view;
132 | }
133 |
134 | }
135 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/RSS.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.Button;
9 | import android.widget.CompoundButton;
10 | import android.widget.EditText;
11 | import android.widget.Switch;
12 | import android.widget.TextView;
13 | import android.widget.Toast;
14 |
15 | import com.aaars.b.Module;
16 | import com.aaars.b.ModuleDesign;
17 | import com.aaars.b.R;
18 | import com.google.firebase.database.DataSnapshot;
19 | import com.google.firebase.database.DatabaseError;
20 | import com.google.firebase.database.DatabaseReference;
21 | import com.google.firebase.database.FirebaseDatabase;
22 | import com.google.firebase.database.ValueEventListener;
23 |
24 |
25 | public class RSS extends Fragment {
26 |
27 | TextView tv, tvhead;
28 | Switch toggle;
29 | EditText input, rss;
30 | Button email;
31 | String USER_ID;
32 |
33 | public Module md;
34 | DatabaseReference dr;
35 |
36 |
37 | public RSS() {}
38 |
39 |
40 | @Override
41 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
42 | Bundle savedInstanceState) {
43 | View view = inflater.inflate(R.layout.fragment_rss, container, false);
44 |
45 | USER_ID = ModuleDesign.USER_ID;
46 | md = new Module();
47 |
48 | tvhead = view.findViewById(R.id.tvhead);
49 | tv = view.findViewById(R.id.tv);
50 | toggle = view.findViewById(R.id.toggle);
51 | input = view.findViewById(R.id.input);
52 | rss = view.findViewById(R.id.rss);
53 | email = view.findViewById(R.id.savePhone);
54 |
55 | tvhead.setText("Sends RSS feed bundle to you email address");
56 | tv.setText("Creates an RSS bundle specially for you to include all of your daily reads");
57 |
58 | //FIREBASE DATABASE
59 | FirebaseDatabase database = FirebaseDatabase.getInstance();
60 |
61 | dr = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("8");
62 | ValueEventListener postListener = new ValueEventListener() {
63 | @Override
64 | public void onDataChange(DataSnapshot dataSnapshot) {
65 | if(dataSnapshot.exists()) {
66 | md = dataSnapshot.getValue(Module.class);
67 | toggle.setChecked(md.enabled);
68 | if(md.parameters.get(0).contains("@") && md.parameters.get(0).contains(".")) {
69 | input.setText(md.parameters.get(0));
70 | input.setEnabled(false);
71 | email.setText("Edit Email");
72 | }
73 | if(!md.parameters.get(1).equals("")) {
74 | rss.setText(md.parameters.get(1));
75 | rss.setEnabled(false);
76 | }
77 |
78 | }
79 | else {
80 | //INSTANTIATION OF MODULE 01
81 | md.triggerid = 101;
82 | md.activityid = 101;
83 | md.enabled = true;
84 | md.parameters.add("");
85 | md.parameters.add("");
86 | dr.setValue(md);
87 |
88 | input.setEnabled(true);
89 | rss.setEnabled(true);
90 | email.setText("Save Email");
91 | }
92 | }
93 |
94 | @Override
95 | public void onCancelled(DatabaseError databaseError) {
96 | Toast.makeText(getContext(), "Failed to load post.",
97 | Toast.LENGTH_SHORT).show();
98 | }
99 | };
100 | dr.addValueEventListener(postListener);
101 |
102 | email.setOnClickListener(new View.OnClickListener() {
103 | @Override
104 | public void onClick(View view) {
105 | if (input.isEnabled()) {
106 | String emailid = input.getText().toString();
107 | if (emailid.contains("@") && emailid.contains(".") && emailid.length() > 10) {
108 | md.parameters.set(0,emailid);
109 | dr.setValue(md);
110 | input.setEnabled(false);
111 | rss.setEnabled(false);
112 | email.setText("Edit Email");
113 | }
114 | }
115 | else {
116 | input.setEnabled(true);
117 | rss.setEnabled(true);
118 | email.setText("Save Email");
119 | }
120 | }
121 | });
122 |
123 | toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
124 | @Override
125 | public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
126 | md.enabled = b;
127 | dr.setValue(md);
128 | }
129 | });
130 |
131 | return view;
132 | }
133 |
134 | }
135 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/LostPhone.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.view.WindowManager;
9 | import android.widget.Button;
10 | import android.widget.CompoundButton;
11 | import android.widget.EditText;
12 | import android.widget.Switch;
13 | import android.widget.TextView;
14 | import android.widget.Toast;
15 |
16 | import com.aaars.b.Module;
17 | import com.aaars.b.ModuleDesign;
18 | import com.aaars.b.R;
19 | import com.google.firebase.database.DataSnapshot;
20 | import com.google.firebase.database.DatabaseError;
21 | import com.google.firebase.database.DatabaseReference;
22 | import com.google.firebase.database.FirebaseDatabase;
23 | import com.google.firebase.database.ValueEventListener;
24 |
25 |
26 | public class LostPhone extends Fragment {
27 |
28 | TextView tv, tvhead;
29 | Switch toggle;
30 | EditText input;
31 | Button email;
32 | String USER_ID;
33 |
34 | public Module md;
35 | DatabaseReference dr;
36 |
37 |
38 | public LostPhone() {}
39 |
40 |
41 | @Override
42 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
43 | Bundle savedInstanceState) {
44 | View view = inflater.inflate(R.layout.fragment_volume_min, container, false);
45 |
46 | getActivity().getWindow().setSoftInputMode(
47 | WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
48 |
49 | USER_ID = ModuleDesign.USER_ID;
50 | md = new Module();
51 |
52 | tvhead = view.findViewById(R.id.tvhead);
53 | tv = view.findViewById(R.id.tv);
54 | toggle = view.findViewById(R.id.toggle);
55 | input = view.findViewById(R.id.input);
56 | email = view.findViewById(R.id.savePhone);
57 | TextView paraphrase = view.findViewById(R.id.paraphrase);
58 |
59 | tvhead.setText("Take extreme measures to find the lost device");
60 | tv.setText("On receiving a sms containing keywords and paraphrase switches on the wifi, send location to the number and sounds alarm for recovering the device");
61 | paraphrase.setText("lostphone ");
62 |
63 | //FIREBASE DATABASE
64 | FirebaseDatabase database = FirebaseDatabase.getInstance();
65 |
66 | dr = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("6");
67 | ValueEventListener postListener = new ValueEventListener() {
68 | @Override
69 | public void onDataChange(DataSnapshot dataSnapshot) {
70 | if(dataSnapshot.exists()) {
71 | md = dataSnapshot.getValue(Module.class);
72 |
73 | if(!md.parameters.get(0).equals(""))
74 | input.setEnabled(false);
75 |
76 | toggle.setChecked(md.parameters.get(5).equals("true"));
77 | input.setText(md.parameters.get(0));
78 | email.setText("Edit Paraphrase");
79 |
80 | }
81 | else {
82 | //INSTANTIATION OF MODULE 01
83 | md.triggerid = 105;
84 | md.activityid = 108;
85 | md.enabled = true;
86 | md.parameters.add("");
87 | for(int i = 0; i < 6; i++)
88 | md.parameters.add("false");
89 | dr.setValue(md);
90 |
91 | input.setEnabled(true);
92 | email.setText("Save Paraphrase");
93 | }
94 | }
95 |
96 | @Override
97 | public void onCancelled(DatabaseError databaseError) {
98 | Toast.makeText(getContext(), "Failed to load post.",
99 | Toast.LENGTH_SHORT).show();
100 | }
101 | };
102 | dr.addValueEventListener(postListener);
103 |
104 | email.setOnClickListener(new View.OnClickListener() {
105 | @Override
106 | public void onClick(View view) {
107 | if (input.isEnabled()) {
108 | String paraphrase = input.getText().toString();
109 | if (paraphrase.length() >= 3) {
110 | md.parameters.set(0,paraphrase);
111 | dr.setValue(md);
112 | input.setEnabled(false);
113 | email.setText("Edit Paraphrase");
114 | }
115 | }
116 | else {
117 | input.setEnabled(true);
118 | email.setText("Save Paraphrase");
119 | }
120 | }
121 | });
122 |
123 | toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
124 | @Override
125 | public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
126 | md.parameters.set(5,(b?"true":"false"));
127 | dr.setValue(md);
128 | }
129 | });
130 |
131 | return view;
132 | }
133 |
134 | }
135 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_help_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
24 |
25 |
37 |
38 |
42 |
43 |
55 |
56 |
68 |
69 |
70 |
71 |
75 |
76 |
88 |
89 |
101 |
102 |
103 |
104 |
108 |
109 |
121 |
122 |
134 |
135 |
136 |
137 |
145 |
146 |
147 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/java/com/aaars/b/Fragments/WiFiOnTimer.java:
--------------------------------------------------------------------------------
1 | package com.aaars.b.Fragments;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.Button;
10 | import android.widget.CheckBox;
11 | import android.widget.CompoundButton;
12 | import android.widget.Switch;
13 | import android.widget.TextView;
14 | import android.widget.TimePicker;
15 | import android.widget.Toast;
16 |
17 | import com.aaars.b.Module;
18 | import com.aaars.b.ModuleDesign;
19 | import com.aaars.b.R;
20 | import com.aaars.b.Splash;
21 | import com.google.firebase.database.DataSnapshot;
22 | import com.google.firebase.database.DatabaseError;
23 | import com.google.firebase.database.DatabaseReference;
24 | import com.google.firebase.database.FirebaseDatabase;
25 | import com.google.firebase.database.ValueEventListener;
26 |
27 |
28 | public class WiFiOnTimer extends Fragment {
29 |
30 | TextView tv, tvhead;
31 | Switch toggle;
32 | Button click;
33 | String USER_ID;
34 | CheckBox mon, tue, wed, thu, fri, sat, sun;
35 | TimePicker timePicker;
36 |
37 | public Module md;
38 | DatabaseReference dr;
39 |
40 | private int hr, min;
41 |
42 |
43 | public WiFiOnTimer() {}
44 |
45 |
46 | @Override
47 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
48 | Bundle savedInstanceState) {
49 | View view = inflater.inflate(R.layout.fragment_wifi_timer, container, false);
50 |
51 | USER_ID = ModuleDesign.USER_ID;
52 | md = new Module();
53 |
54 | tvhead = view.findViewById(R.id.tvhead);
55 | tv = view.findViewById(R.id.tv);
56 | toggle = view.findViewById(R.id.toggle);
57 | click = view.findViewById(R.id.click);
58 |
59 | mon = view.findViewById(R.id.mon);
60 | tue = view.findViewById(R.id.tue);
61 | wed = view.findViewById(R.id.wed);
62 | thu = view.findViewById(R.id.thu);
63 | fri = view.findViewById(R.id.fri);
64 | sat = view.findViewById(R.id.sat);
65 | sun = view.findViewById(R.id.sun);
66 |
67 | timePicker = view.findViewById(R.id.time);
68 |
69 | tvhead.setText("Turn Wi-Fi on at specific time");
70 | tv.setText("Wi-Fi can be turned on at a specific time to connect to the Internet, enable updates and sync the device on selected days");
71 |
72 | //FIREBASE DATABASE
73 | FirebaseDatabase database = FirebaseDatabase.getInstance();
74 |
75 | dr = database.getInstance().getReference().child("users").child(USER_ID).child("modules").child("3");
76 | ValueEventListener postListener = new ValueEventListener() {
77 | @Override
78 | public void onDataChange(DataSnapshot dataSnapshot) {
79 | if(dataSnapshot.exists()) {
80 | md = dataSnapshot.getValue(Module.class);
81 | toggle.setChecked(md.enabled);
82 | mon.setChecked(md.parameters.get(0).equals("true"));
83 | tue.setChecked(md.parameters.get(1).equals("true"));
84 | wed.setChecked(md.parameters.get(2).equals("true"));
85 | thu.setChecked(md.parameters.get(3).equals("true"));
86 | fri.setChecked(md.parameters.get(4).equals("true"));
87 | sat.setChecked(md.parameters.get(5).equals("true"));
88 | sun.setChecked(md.parameters.get(6).equals("true"));
89 | timePicker.setCurrentHour(Integer.parseInt(md.parameters.get(7)));
90 | timePicker.setCurrentMinute(Integer.parseInt(md.parameters.get(8)));
91 | }
92 | else {
93 | //INSTANTIATION OF MODULE 02
94 | md.triggerid = 102;
95 | md.activityid = 103;
96 | md.enabled = false;
97 | md.parameters.add("false");
98 | md.parameters.add("false");
99 | md.parameters.add("false");
100 | md.parameters.add("false");
101 | md.parameters.add("false");
102 | md.parameters.add("false");
103 | md.parameters.add("false");
104 | md.parameters.add("0");
105 | md.parameters.add("0");
106 | dr.setValue(md);
107 |
108 | }
109 | }
110 |
111 | @Override
112 | public void onCancelled(DatabaseError databaseError) {
113 | Toast.makeText(getContext(), "Failed to load post.",
114 | Toast.LENGTH_SHORT).show();
115 | }
116 | };
117 | dr.addValueEventListener(postListener);
118 |
119 | click.setOnClickListener(new View.OnClickListener() {
120 | @Override
121 | public void onClick(View view) {
122 | hr = timePicker.getCurrentHour();
123 | min = timePicker.getCurrentMinute();
124 |
125 | md.parameters.set(0,mon.isChecked()?"true":"false");
126 | md.parameters.set(1,tue.isChecked()?"true":"false");
127 | md.parameters.set(2,wed.isChecked()?"true":"false");
128 | md.parameters.set(3,thu.isChecked()?"true":"false");
129 | md.parameters.set(4,fri.isChecked()?"true":"false");
130 | md.parameters.set(5,sat.isChecked()?"true":"false");
131 | md.parameters.set(6,sun.isChecked()?"true":"false");
132 |
133 | md.parameters.set(7,Integer.toString(hr));
134 | md.parameters.set(8,Integer.toString(min));
135 | md.enabled = true;
136 |
137 | dr.setValue(md);
138 |
139 | Intent i = new Intent(getContext(),Splash.class);
140 | startActivity(i);
141 | }
142 | });
143 |
144 | toggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
145 | @Override
146 | public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
147 | md.enabled = b;
148 | dr.setValue(md);
149 | }
150 | });
151 |
152 | return view;
153 | }
154 |
155 | }
156 |
--------------------------------------------------------------------------------