Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
From 7b72723c62d8567dd795dc83ef016da5817cfe7b Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Wed, 22 Feb 2017 06:12:09 -0500
Subject: [PATCH] Freedom
---
app/build.gradle | 3 -
app/google-services.json | 42 ------------
app/src/main/AndroidManifest.xml | 13 +---
.../projekt/substratum/InformationActivity.java | 18 +-----
.../main/java/projekt/substratum/MainActivity.java | 21 +-----
.../substratum/config/FirebaseAnalytics.java | 74 ----------------------
.../java/projekt/substratum/config/References.java | 3 +-
.../services/FirebaseMessagingService.java | 35 ----------
build.gradle | 3 +-
9 files changed, 5 insertions(+), 207 deletions(-)
delete mode 100644 app/google-services.json
delete mode 100644 app/src/main/java/projekt/substratum/config/FirebaseAnalytics.java
delete mode 100644 app/src/main/java/projekt/substratum/services/FirebaseMessagingService.java
diff --git a/app/build.gradle b/app/build.gradle
index 176f4dc..714b54d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -64,8 +64,6 @@ dependencies {
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:palette-v7:25.2.0'
compile 'com.android.support:preference-v14:25.2.0'
- compile 'com.google.firebase:firebase-database:10.0.1'
- compile 'com.google.firebase:firebase-messaging:10.0.1'
// Image Downloading and Caching
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup.picasso:picasso:2.5.2'
@@ -112,4 +110,3 @@ dependencies {
// Floating App Head
compile 'com.github.recruit-lifestyle:FloatingView:2.1'
}
-apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
diff --git a/app/google-services.json b/app/google-services.json
deleted file mode 100644
index 9aa0fb8..0000000
--- a/app/google-services.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "project_info": {
- "project_number": "860912288789",
- "firebase_url": "https://substratum-d455c.firebaseio.com",
- "project_id": "substratum-d455c",
- "storage_bucket": "substratum-d455c.appspot.com"
- },
- "client": [
- {
- "client_info": {
- "mobilesdk_app_id": "1:860912288789:android:cecb4572f9730fd6",
- "android_client_info": {
- "package_name": "projekt.substratum"
- }
- },
- "oauth_client": [
- {
- "client_id": "860912288789-pfmsjp5clcmin2us8b4t71pb4an2a2dn.apps.googleusercontent.com",
- "client_type": 3
- }
- ],
- "api_key": [
- {
- "current_key": "AIzaSyDN0PNpizStRu0JsRFxZb7V6TPqRp7dQjA"
- }
- ],
- "services": {
- "analytics_service": {
- "status": 1
- },
- "appinvite_service": {
- "status": 1,
- "other_platform_oauth_client": []
- },
- "ads_service": {
- "status": 2
- }
- }
- }
- ],
- "configuration_version": "1"
-}
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index f711272..71143c3 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -99,21 +99,10 @@
<service android:name=".services.ScheduledProfileService"/>
<meta-data
- android:name="com.google.android.gms.version"
- android:value="@integer/google_play_services_version"/>
-
- <meta-data
android:name="android.service.quicksettings.ACTIVE_TILE"
android:value="true"/>
<service
- android:name=".services.FirebaseMessagingService"
- android:exported="false">
- <intent-filter>
- <action android:name="com.google.firebase.MESSAGING_EVENT"/>
- </intent-filter>
- </service>
- <service
android:name=".services.ThemeService"
android:enabled="true"/>
@@ -223,4 +212,4 @@
android:theme="@style/AppTheme.Dialog"/>
</application>
-</manifest>
\ No newline at end of file
+</manifest>
diff --git a/app/src/main/java/projekt/substratum/InformationActivity.java b/app/src/main/java/projekt/substratum/InformationActivity.java
index a8ba184..2a3c99b 100644
--- a/app/src/main/java/projekt/substratum/InformationActivity.java
+++ b/app/src/main/java/projekt/substratum/InformationActivity.java
@@ -58,7 +58,6 @@ import projekt.substratum.adapters.InformationTabsAdapter;
import projekt.substratum.config.BootAnimationManager;
import projekt.substratum.config.ElevatedCommands;
import projekt.substratum.config.FileOperations;
-import projekt.substratum.config.FirebaseAnalytics;
import projekt.substratum.config.FontManager;
import projekt.substratum.config.References;
import projekt.substratum.config.SoundManager;
@@ -298,21 +297,6 @@ public class InformationActivity extends AppCompatActivity {
}
}
- if (References.isOffensive(theme_name)) {
- FirebaseAnalytics.backupDebuggableStatistics(
- getApplicationContext(),
- "bannable-offence",
- References.getDeviceID(getApplicationContext()),
- theme_name);
- } else if (
- References.isOffensive(theme_author)) {
- FirebaseAnalytics.backupDebuggableStatistics(
- getApplicationContext(),
- "bannable-offence",
- References.getDeviceID(getApplicationContext()),
- theme_author);
- }
-
new LayoutLoader().execute("");
tabLayout = (TabLayout) findViewById(R.id.tabs);
@@ -867,4 +851,4 @@ public class InformationActivity extends AppCompatActivity {
return null;
}
}
-}
\ No newline at end of file
+}
diff --git a/app/src/main/java/projekt/substratum/MainActivity.java b/app/src/main/java/projekt/substratum/MainActivity.java
index c6ffdb2..a3c88fd 100644
--- a/app/src/main/java/projekt/substratum/MainActivity.java
+++ b/app/src/main/java/projekt/substratum/MainActivity.java
@@ -36,8 +36,6 @@ import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
-import com.google.firebase.database.FirebaseDatabase;
-import com.google.firebase.iid.FirebaseInstanceId;
import com.mikepenz.aboutlibraries.LibsBuilder;
import com.mikepenz.aboutlibraries.LibsConfiguration;
import com.mikepenz.aboutlibraries.ui.LibsSupportFragment;
@@ -149,11 +147,6 @@ public class MainActivity extends AppCompatActivity implements
supportInvalidateOptionsMenu();
}
- private void printFCMtoken() {
- String token = FirebaseInstanceId.getInstance().getToken();
- Log.d(References.SUBSTRATUM_LOG, "FCM Registration Token: " + token);
- }
-
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -441,8 +434,6 @@ public class MainActivity extends AppCompatActivity implements
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE);
}
- FirebaseDatabase.getInstance().setPersistenceEnabled(true);
- printFCMtoken();
if (!References.checkOMS(getApplicationContext()) &&
!prefs.contains("legacy_dismissal")) {
@@ -478,16 +469,6 @@ public class MainActivity extends AppCompatActivity implements
.show();
} else {
drawer.setSelectionAtPosition(1);
- try {
- FirebaseDatabase.getInstance().setPersistenceEnabled(true);
- } catch (RuntimeException re1) {
- try {
- FirebaseDatabase.getInstance().setPersistenceEnabled(true);
- } catch (RuntimeException re2) {
- // Suppress warning
- }
- }
- printFCMtoken();
if (!References.checkOMS(getApplicationContext()) &&
!prefs.contains("legacy_dismissal")) {
@@ -866,4 +847,4 @@ public class MainActivity extends AppCompatActivity implements
}
}
}
-}
\ No newline at end of file
+}
diff --git a/app/src/main/java/projekt/substratum/config/FirebaseAnalytics.java b/app/src/main/java/projekt/substratum/config/FirebaseAnalytics.java
deleted file mode 100644
index 198b89a..0000000
--- a/app/src/main/java/projekt/substratum/config/FirebaseAnalytics.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package projekt.substratum.config;
-
-import android.accounts.Account;
-import android.accounts.AccountManager;
-import android.app.ActivityManager;
-import android.content.Context;
-import android.util.Log;
-
-import com.google.firebase.database.DatabaseReference;
-import com.google.firebase.database.FirebaseDatabase;
-import com.google.firebase.database.IgnoreExtraProperties;
-import com.google.firebase.iid.FirebaseInstanceId;
-
-import java.util.Calendar;
-import java.util.List;
-
-import projekt.substratum.BuildConfig;
-
-import static android.content.Context.ACTIVITY_SERVICE;
-
-public class FirebaseAnalytics {
-
- // Save data to Firebase
- public static void backupDebuggableStatistics(Context mContext, String tag, String data,
- String reason) {
- try {
- FirebaseDatabase mDatabaseInstance = FirebaseDatabase.getInstance();
- DatabaseReference mDatabase = mDatabaseInstance.getReference(tag);
- String currentTimeAndDate = java.text.DateFormat.getDateTimeInstance().format(
- Calendar.getInstance().getTime());
- Account[] accounts = AccountManager.get(mContext).getAccountsByType("com.google");
- String main_acc = "null";
- for (Account account : accounts) {
- if (account.name != null) {
- main_acc = account.name.replace(".", "(dot)");
- }
- }
- String entryId = main_acc;
- String userId = FirebaseInstanceId.getInstance().getToken();
- DeviceCollection user = new DeviceCollection(
- currentTimeAndDate,
- userId,
- data,
- reason,
- BuildConfig.VERSION_CODE,
- BuildConfig.VERSION_NAME);
- mDatabase.child(entryId).child(data).setValue(user);
- } catch (RuntimeException re) {
- // Suppress Warning
- }
- }
-
- @IgnoreExtraProperties
- @SuppressWarnings("WeakerAccess")
- private static class DeviceCollection {
-
- public String CurrentTime;
- public String FireBaseID;
- public String ID;
- public String Reason;
- public int VersionCode;
- public String VersionName;
-
- public DeviceCollection(String CurrentTime, String FireBaseID, String ID, String Reason,
- int VersionCode, String VersionName) {
- this.CurrentTime = CurrentTime;
- this.FireBaseID = FireBaseID;
- this.ID = ID;
- this.Reason = Reason;
- this.VersionCode = VersionCode;
- this.VersionName = VersionName;
- }
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/projekt/substratum/config/References.java b/app/src/main/java/projekt/substratum/config/References.java
index f4a7ac9..cd15f2f 100644
--- a/app/src/main/java/projekt/substratum/config/References.java
+++ b/app/src/main/java/projekt/substratum/config/References.java
@@ -75,7 +75,6 @@ public class References {
private static final long NOVEMBER_PATCH_TIMESTAMP = 1478304000000L;
private static final long JANUARY_PATCH_TIMESTAMP = 1483549200000L;
// This int controls the notification identifier
- public static int firebase_notification_id = 24862486;
public static int notification_id = 2486;
public static int notification_id_upgrade = 248600;
// Universal switch for Application-wide Debugging
@@ -1218,4 +1217,4 @@ public class References {
return null;
}
}
-}
\ No newline at end of file
+}
diff --git a/app/src/main/java/projekt/substratum/services/FirebaseMessagingService.java b/app/src/main/java/projekt/substratum/services/FirebaseMessagingService.java
deleted file mode 100644
index a127cdc..0000000
--- a/app/src/main/java/projekt/substratum/services/FirebaseMessagingService.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package projekt.substratum.services;
-
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.content.Context;
-import android.content.Intent;
-import android.support.v4.app.NotificationCompat;
-
-import com.google.firebase.messaging.RemoteMessage;
-
-import projekt.substratum.R;
-import projekt.substratum.config.References;
-
-public class FirebaseMessagingService extends
- com.google.firebase.messaging.FirebaseMessagingService {
-
- @Override
- public void onMessageReceived(RemoteMessage remoteMessage) {
- Intent showIntent = new Intent();
- PendingIntent contentIntent = PendingIntent.getActivity(this, 0, showIntent, 0);
-
- NotificationManager notificationManager =
- (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
- NotificationCompat.Builder mBuilder =
- new NotificationCompat.Builder(this)
- .setContentIntent(contentIntent)
- .setAutoCancel(true)
- .setSmallIcon(R.mipmap.main_launcher)
- .setContentTitle(getString(R.string.app_name))
- .setContentText(remoteMessage.getNotification().getBody());
- Notification notification = mBuilder.build();
- notificationManager.notify(References.firebase_notification_id, notification);
- }
-}
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 0a1f330..fbd0f8a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -7,7 +7,6 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
- classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
@@ -22,4 +21,4 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
-}
\ No newline at end of file
+}
--
2.11.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment