Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Commit

Permalink
Legacy version without crash reporting or ads for GPlay API 10-15.
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rken committed Mar 29, 2018
1 parent 3f2ed33 commit 177b109
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 139 deletions.
67 changes: 31 additions & 36 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.21.2'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
maven { url 'https://maven.fabric.io/public' }
}


def gitSha() {
return 'git rev-parse --short HEAD'.execute().text.trim()
Expand All @@ -26,35 +11,50 @@ def gitSha() {
* @license https://github.com/d4rken/rootvalidator/blob/master/LICENSE GPLv3
*/

//def buildTime() {
// def df = new SimpleDateFormat("yyyy-MM-dd'T'HH-mm-ss'Z'")
// df.setTimeZone(TimeZone.getTimeZone("GMT+1"))
// return df.format(new Date())
//}

android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
def signingPropFile = new File(System.properties['user.home'], ".appconfig/rootvalidator/signing.properties")
if (signingPropFile.canRead()) {
Properties signingProps = new Properties()
signingProps.load(new FileInputStream(signingPropFile))

signingConfigs {
release {
storeFile new File(signingProps['release.storePath'])
keyAlias signingProps['release.keyAlias']
storePassword signingProps['release.storePassword']
keyPassword signingProps['release.keyPassword']
}
}
android {
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
}

compileSdkVersion 26
buildToolsVersion '26.0.2'

defaultConfig {
applicationId "eu.thedarken.rootvalidator"
minSdkVersion 10
targetSdkVersion 23
versionCode 26
versionName "2.1.2"
versionCode 27
versionName "2.2"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
applicationVariants.all { variant ->
if (variant.buildType.name == "release") {
variant.outputs.each { output ->
def file = output.outputFile
output.outputFile = new File(file.parent, "RootValidator-v" + defaultConfig.versionName + "-" + defaultConfig.versionCode + "-" + gitSha() + ".apk")
}
}
applicationVariants.all { variant ->
if (variant.buildType.name != "debug") {
variant.outputs.each { output ->
output.outputFileName = applicationId + "-v" + defaultConfig.versionName + "(" + defaultConfig.versionCode + ")-" + variant.buildType.name.toUpperCase() + "-" + gitSha() + ".apk"
}
}
}
Expand All @@ -70,9 +70,4 @@ dependencies {
compile "com.android.support:cardview-v7:${supportLibVersion}"
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}

}
13 changes: 0 additions & 13 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<!--This meta-data tag is required to use Google Play Services.-->
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>

<activity
android:name=".MainActivity"
android:configChanges="orientation"
Expand All @@ -33,14 +28,6 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!--Include the AdActivity configChanges and theme. -->
<activity
android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:theme="@android:style/Theme.Translucent"/>
<meta-data
android:name="com.crashlytics.ApiKey"
android:value="0"/>
</application>

</manifest>
47 changes: 0 additions & 47 deletions app/src/main/java/eu/thedarken/rootvalidator/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,9 @@
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.FrameLayout;

import com.crashlytics.android.Crashlytics;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

import java.io.File;

import io.fabric.sdk.android.Fabric;

public class MainActivity extends AppCompatActivity {
private Fragment mFragment;
private AdView mAdView;
private FrameLayout mAdContainer;
private static final String FILE_NO_ADS = "no_ads";

public String getFragmentClass() {
return ValidatorFragment.class.getName();
Expand All @@ -34,47 +21,13 @@ public String getFragmentClass() {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
setContentView(R.layout.activity_mainactivity_layout);
mFragment = getSupportFragmentManager().findFragmentByTag(getFragmentClass());
if (mFragment == null) {
mFragment = Fragment.instantiate(this, getFragmentClass());
getSupportFragmentManager().beginTransaction().replace(R.id.content, mFragment, getFragmentClass()).commit();
}
mAdContainer = (FrameLayout) findViewById(R.id.fl_ad_container);
File noAdsFile = new File(getExternalFilesDir(null), FILE_NO_ADS);
if (!noAdsFile.exists()) {
mAdContainer.setVisibility(View.VISIBLE);
mAdView = (AdView) findViewById(R.id.adv_banner);
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("C34CF836138E576F0C3CC8BBF6B19388")
.addTestDevice("A6A278A2F9CF28BD949FC2265AEAE62F")
.build();
mAdView.loadAd(adRequest);
} else {
mAdContainer.setVisibility(View.GONE);
}
}

@Override
protected void onResume() {
if (mAdView != null)
mAdView.resume();
super.onResume();
}

@Override
protected void onPause() {
if (mAdView != null)
mAdView.pause();
super.onPause();
}

@Override
protected void onDestroy() {
if (mAdView != null)
mAdView.destroy();
super.onDestroy();
}
}
31 changes: 4 additions & 27 deletions app/src/main/res/layout/activity_mainactivity_layout.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<FrameLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/fl_ad_container"/>

<FrameLayout
android:id="@+id/fl_ad_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/material_blue_grey_900">

<com.google.android.gms.ads.AdView
android:id="@+id/adv_banner"
android:visibility="visible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adSize="SMART_BANNER" />
</FrameLayout>
</RelativeLayout>
<FrameLayout android:id="@+id/content"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.android.tools.build:gradle:3.1.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -15,5 +16,6 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Apr 10 15:27:10 PDT 2013
#Thu Mar 29 06:05:08 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
16 changes: 3 additions & 13 deletions privacy_policy_for_gplay.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
Privacy policy for the app "Root Validator" (for app version 2.0+)
Privacy policy for the app "Root Validator" (for app versions 2.2.X)

I make use of "Crashlytics" to track app crashes:
https://www.crashlytics.com/
No data is collected.

Crashlytics privacy policy can be found here:
https://try.crashlytics.com/terms/

This app can contains ads, they are displayed via "AdMob":
https://www.google.com/admob/

AdMob is owned by Google, the privacy policy can be found here:
https://www.google.com/intl/en/policies/privacy/

If you have any questions, just send a mail to [email protected].
If you have any questions, feel free to mail [email protected].

0 comments on commit 177b109

Please sign in to comment.