Skip to content

Commit

Permalink
cleared all non-privacy things
Browse files Browse the repository at this point in the history
  • Loading branch information
kamaravichow committed Jun 19, 2021
1 parent c6094d7 commit e80f09f
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 168 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

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

1 change: 1 addition & 0 deletions .idea/runConfigurations.xml

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

7 changes: 2 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ android {

def versionMajor = 3
def versionMinor = 0
def versionPatch = 4
def versionPatch = 5

defaultConfig {
applicationId "com.aravi.dot"
Expand Down Expand Up @@ -69,15 +69,14 @@ repositories {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'org.jetbrains:annotations:15.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

// Firebase
implementation platform('com.google.firebase:firebase-bom:28.0.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-auth'

// Room Db
implementation "androidx.room:room-runtime:$rootProject.roomVersion"
Expand All @@ -86,8 +85,6 @@ dependencies {

// 3rd party
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.pes.materialcolorpicker:library:1.2.5'
implementation 'com.facebook.android:audience-network-sdk:6.4.0'

testImplementation 'junit:junit:4.13.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
Expand Down
20 changes: 20 additions & 0 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 1,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.aravi.dot",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"properties": [],
"versionCode": 30005,
"versionName": "3.0.5",
"enabled": true,
"outputFile": "app-release.apk"
}
]
}
17 changes: 1 addition & 16 deletions app/src/main/java/com/aravi/dot/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,21 @@
import com.aravi.dot.constant.Constants;
import com.aravi.dot.helper.ApplicationHelper;
import com.aravi.dot.manager.AnalyticsManager;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;


import java.util.Objects;

public class App extends Application {
private FirebaseAuth mAuth;
private AnalyticsManager analyticsManager;

@Override
public void onCreate() {
super.onCreate();
ApplicationHelper.initApplicationHelper(this);
mAuth = FirebaseAuth.getInstance();
analyticsManager = AnalyticsManager.getInstance(this);
checkAuth();
localNotificationSetup(this);
}


private void checkAuth() {
FirebaseUser currentUser = mAuth.getCurrentUser();
if (currentUser == null) {
mAuth.signInAnonymously().addOnSuccessListener(authResult -> analyticsManager.setUserId(Objects.requireNonNull(authResult.getUser()).getUid()));
} else {
analyticsManager.setUserId(currentUser.getUid());
}
}


private static void localNotificationSetup(Application application) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel(Constants.SERVICE_NOTIFICATION_CHANNEL, "Service Notification", NotificationManager.IMPORTANCE_LOW);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.aravi.dot.databinding.ActivityCustomisationBinding;
import com.aravi.dot.manager.AnalyticsManager;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.firebase.auth.FirebaseAuth;

import java.util.Locale;
import java.util.Objects;
Expand All @@ -35,29 +34,20 @@
public class CustomisationActivity extends AppCompatActivity {
private ActivityCustomisationBinding mBinding;
private AnalyticsManager analyticsManager;
private FirebaseAuth mAuth;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBinding = ActivityCustomisationBinding.inflate(getLayoutInflater());
setContentView(mBinding.getRoot());
analyticsManager = AnalyticsManager.getInstance(this);
mAuth = FirebaseAuth.getInstance();
setSupportActionBar(mBinding.toolbar);

mBinding.saveButton.setOnClickListener(v -> {
new MaterialAlertDialogBuilder(CustomisationActivity.this)
.setTitle("Requires Upgrade")
.setMessage("Customisation Center and more other features will be available only in the PRO version of the app.")
.setPositiveButton("Get Premium", (dialog, which) -> {

Bundle bundle = new Bundle();
bundle.putString("user_id", Objects.requireNonNull(mAuth.getCurrentUser()).getUid());
bundle.putString("language", Locale.getDefault().getDisplayLanguage());
bundle.putString("location", Locale.getDefault().getCountry());
analyticsManager.getAnalytics().logEvent("likely_purchaser", bundle);

String url = "https://play.google.com/store/apps/details?id=com.aravi.dotpro";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
Expand Down
16 changes: 0 additions & 16 deletions app/src/main/java/com/aravi/dot/activities/main/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@
import com.aravi.dot.activities.custom.CustomisationActivity;
import com.aravi.dot.activities.log.LogsActivity;
import com.aravi.dot.databinding.ActivityMainBinding;
import com.aravi.dot.manager.AdvertisementManager;
import com.aravi.dot.manager.PreferenceManager;
import com.aravi.dot.service.DotService;
import com.aravi.dot.util.Utils;
import com.facebook.ads.InterstitialAd;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.snackbar.Snackbar;

Expand All @@ -53,9 +51,7 @@ public class MainActivity extends AppCompatActivity {
private boolean TRIGGERED_START = false;
private PreferenceManager sharedPreferenceManager;
private Intent serviceIntent;
private AdvertisementManager advertisementManager;
private ActivityMainBinding mBinding;
private InterstitialAd interstitialAd;

@Override
protected void onStart() {
Expand All @@ -71,18 +67,11 @@ protected void onCreate(Bundle savedInstanceState) {
mBinding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(mBinding.getRoot());
sharedPreferenceManager = PreferenceManager.getInstance(getApplication());
advertisementManager = AdvertisementManager.getInstance(getApplication());
loadFromPrefs();
init();
loadAd();
checkAutoStartRequirement();
}

private void loadAd() {
interstitialAd = new InterstitialAd(this, "-----");
interstitialAd.loadAd();
advertisementManager.setBannerAd(mBinding.adLayout);
}

private void loadFromPrefs() {
mBinding.vibrationSwitch.setChecked(sharedPreferenceManager.isVibrationEnabled());
Expand Down Expand Up @@ -139,7 +128,6 @@ private void init() {
}

private void checkForAccessibilityAndStart() {

if (!accessibilityPermission(getApplicationContext(), DotService.class)) {
mBinding.mainSwitch.setChecked(false);
new MaterialAlertDialogBuilder(this)
Expand Down Expand Up @@ -279,10 +267,6 @@ private void checkAutoStartRequirement() {

@Override
protected void onPostResume() {
assert interstitialAd != null;
if (interstitialAd.isAdLoaded()) {
interstitialAd.show();
}
super.onPostResume();
}

Expand Down
75 changes: 0 additions & 75 deletions app/src/main/java/com/aravi/dot/manager/AdvertisementManager.java

This file was deleted.

37 changes: 0 additions & 37 deletions app/src/main/java/com/aravi/dot/manager/AnalyticsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ public class AnalyticsManager {
private FirebaseAnalytics analytics;
private FirebaseCrashlytics crashlytics;

public static class AdEvents {
public static final String IMPRESSION = "ad.impression";
public static final String CLICK = "ad.clicked";
public static final String ERROR = "ad.error";
public static final String DISMISS = "ad.dismissed";
}

/**
* Analytics manager initialisation
*
Expand Down Expand Up @@ -52,22 +45,7 @@ private void init() {
crashlytics.setCrashlyticsCollectionEnabled(true);
}

/**
* This is set by autogenerated id that is basically the user authentication id in general
*/
public void setUserId(String id) {
analytics.setUserId(id);
crashlytics.setUserId(id);
}

/**
* Set user properties
* this method is called on sign in
*/
public void userProperties(String signInMethod, String consentStatus) {
analytics.setUserProperty(FirebaseAnalytics.UserProperty.SIGN_UP_METHOD, signInMethod);
analytics.setUserProperty(FirebaseAnalytics.UserProperty.ALLOW_AD_PERSONALIZATION_SIGNALS, consentStatus);
}

/**
* Activity log method
Expand All @@ -78,25 +56,10 @@ public void setActivity(Activity activity) {
Bundle activityLog = new Bundle();
activityLog.putString(FirebaseAnalytics.Param.SCREEN_NAME, activity.getTitle().toString());
activityLog.putString(FirebaseAnalytics.Param.SCREEN_CLASS, activity.getLocalClassName());
activityLog.putString(FirebaseAnalytics.Param.LOCATION, Locale.getDefault().getCountry());
analytics.logEvent(FirebaseAnalytics.Event.SCREEN_VIEW, activityLog);
}


/**
* Advertisement log method
* this helps understand user experience with advertisements
* this also helps understand earnings
*/
public void setAdvertisementEvent(String event) {
Bundle adLog = new Bundle();
adLog.putString(FirebaseAnalytics.Param.AD_FORMAT, "banner");
adLog.putString(FirebaseAnalytics.Param.AD_SOURCE, "admob");
adLog.putString("EVENT_TYPE", event);
adLog.putString(FirebaseAnalytics.Param.AD_UNIT_NAME, "home_banner");
analytics.logEvent(FirebaseAnalytics.Event.AD_IMPRESSION, adLog);
}


/**
* Gets the permission state
Expand Down
8 changes: 0 additions & 8 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@
android:orientation="vertical"
android:padding="10dp">

<LinearLayout
android:id="@+id/ad_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:minHeight="100dp"
android:orientation="vertical" />

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down

0 comments on commit e80f09f

Please sign in to comment.