aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle27
-rw-r--r--proguard-rules.txt6
-rw-r--r--src/canary/AndroidManifest.xml18
-rw-r--r--src/canary/java/com/anysoftkeyboard/canary/CanaryAnyApplication.java38
-rw-r--r--src/canary/res/values/strings.xml4
-rw-r--r--src/main/java/com/menny/android/anysoftkeyboard/AnyApplication.java6
6 files changed, 89 insertions, 10 deletions
diff --git a/build.gradle b/build.gradle
index f3fff2847..393663ef9 100644
--- a/build.gradle
+++ b/build.gradle
@@ -18,15 +18,23 @@ buildscript {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://jitpack.io' }
+ maven { url 'https://maven.fabric.io/public' }
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.0.0-beta4'
+ classpath 'com.android.tools.build:gradle:2.0.0-beta5'
classpath 'com.github.JakeWharton:sdk-manager-plugin:e05218601b1274ea0721e13b33a426f641156f69'
+ classpath 'io.fabric.tools:gradle:1.21.4'
}
}
apply plugin: 'android-sdk-manager'
apply plugin: 'com.android.application'
+apply plugin: 'io.fabric'
+
+repositories {
+ maven { url 'https://maven.fabric.io/public' }
+}
+
apply plugin: 'pmd'
apply plugin: 'jacoco'
@@ -127,13 +135,13 @@ android {
useLibrary 'org.apache.http.legacy'
}
- }
- splits {
- density {
- enable false
- //these will merged into the universal APK
- //I'm trying to really reduce the size of the low densities.
- exclude "tvdpi", "xxhdpi", "xxxhdpi"
+
+ canary {
+ signingConfig signingConfigs.release
+ zipAlignEnabled true
+
+ minifyEnabled true
+ proguardFiles 'proguard-android-optimize.txt', 'proguard-rules.txt'
}
}
}
@@ -190,4 +198,7 @@ dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:3.0'
testCompile 'org.mockito:mockito-core:1.9.5'
+ canaryCompile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
+ transitive = true;
+ }
}
diff --git a/proguard-rules.txt b/proguard-rules.txt
index bd39fcf55..656328aed 100644
--- a/proguard-rules.txt
+++ b/proguard-rules.txt
@@ -52,4 +52,8 @@
-keepclasseswithmembernames @com.anysoftkeyboard.IndirectlyInstantiated class * {
<init>(...);
-} \ No newline at end of file
+}
+
+#for crashlytics
+-keepattributes SourceFile,LineNumberTable,*Annotation*
+-keep public class * extends java.lang.Exception \ No newline at end of file
diff --git a/src/canary/AndroidManifest.xml b/src/canary/AndroidManifest.xml
new file mode 100644
index 000000000..e8eddc0c9
--- /dev/null
+++ b/src/canary/AndroidManifest.xml
@@ -0,0 +1,18 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ package="com.menny.android.anysoftkeyboard">
+
+ <!-- internet is required for Crashlytics -->
+ <uses-permission android:name="android.permission.INTERNET"/>
+
+ <!-- Crashlytics requries SDK version 8, but we want to allow SDK 7. See CanaryApplication for more about this -->
+ <uses-sdk tools:overrideLibrary="com.crashlytics.android, com.crashlytics.android.answers, io.fabric.sdk.android, com.crashlytics.android.core, com.crashlytics.android.beta"/>
+
+ <application tools:replace="android:name"
+ android:name="com.anysoftkeyboard.canary.CanaryAnyApplication">
+
+ <meta-data
+ android:name="io.fabric.ApiKey"
+ android:value="e34140fee128520e40d96052088ef31bd83fc895"/>
+ </application>
+</manifest>
diff --git a/src/canary/java/com/anysoftkeyboard/canary/CanaryAnyApplication.java b/src/canary/java/com/anysoftkeyboard/canary/CanaryAnyApplication.java
new file mode 100644
index 000000000..3fd762cde
--- /dev/null
+++ b/src/canary/java/com/anysoftkeyboard/canary/CanaryAnyApplication.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2013 Menny Even-Danan
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.anysoftkeyboard.canary;
+
+
+import android.os.Build;
+
+import com.crashlytics.android.Crashlytics;
+import com.menny.android.anysoftkeyboard.AnyApplication;
+
+import io.fabric.sdk.android.Fabric;
+
+public class CanaryAnyApplication extends AnyApplication {
+
+ @Override
+ protected void setupCrashHandler() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
+ //replacing the default crash-handler with Crashlytics.
+ Fabric.with(this, new Crashlytics());
+ } else {
+ super.setupCrashHandler();
+ }
+ }
+}
diff --git a/src/canary/res/values/strings.xml b/src/canary/res/values/strings.xml
new file mode 100644
index 000000000..61c36383e
--- /dev/null
+++ b/src/canary/res/values/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="ime_name">AnySoftKeyboard Canary</string>
+</resources> \ No newline at end of file
diff --git a/src/main/java/com/menny/android/anysoftkeyboard/AnyApplication.java b/src/main/java/com/menny/android/anysoftkeyboard/AnyApplication.java
index f680eab33..c2d25bff5 100644
--- a/src/main/java/com/menny/android/anysoftkeyboard/AnyApplication.java
+++ b/src/main/java/com/menny/android/anysoftkeyboard/AnyApplication.java
@@ -48,7 +48,7 @@ public class AnyApplication extends Application implements OnSharedPreferenceCha
@Override
public void onCreate() {
super.onCreate();
- Thread.setDefaultUncaughtExceptionHandler(new ChewbaccaUncaughtExceptionHandler(getBaseContext(), null));
+ setupCrashHandler();
Log.d(TAG, "** Starting application in DEBUG mode.");
msFrank = Lab.build(getApplicationContext(), R.array.frankenrobot_interfaces_mapping);
if (BuildConfig.DEBUG) {
@@ -71,6 +71,10 @@ public class AnyApplication extends Application implements OnSharedPreferenceCha
TutorialsProvider.showDragonsIfNeeded(getApplicationContext());
}
+ protected void setupCrashHandler() {
+ Thread.setDefaultUncaughtExceptionHandler(new ChewbaccaUncaughtExceptionHandler(getBaseContext(), null));
+ }
+
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
((AskPrefsImpl) msConfig).onSharedPreferenceChanged(sharedPreferences, key);
//should we disable the Settings App? com.menny.android.anysoftkeyboard.LauncherSettingsActivity