@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,46 @@
|
|||||||
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion COMPILE_SDK_VERSION as Integer
|
||||||
|
buildToolsVersion BUILD_TOOLS_VERSION
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdkVersion MIN_SDK_VERSION as Integer
|
||||||
|
targetSdkVersion TARGET_SDK_VERSION as Integer
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation "com.google.dagger:dagger:$DAGGER_VERSION"
|
||||||
|
implementation "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
|
||||||
|
implementation "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
|
||||||
|
implementation "org.apache.commons:commons-lang3:3.5"
|
||||||
|
|
||||||
|
annotationProcessor "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
|
||||||
|
androidTestAnnotationProcessor "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
|
||||||
|
androidTestImplementation "com.google.dagger:dagger:$DAGGER_VERSION"
|
||||||
|
testAnnotationProcessor "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
|
||||||
|
testImplementation "junit:junit:4.12"
|
||||||
|
|
||||||
|
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||||
|
exclude group: 'com.android.support', module: 'support-annotations'
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# By default, the flags in this file are appended to flags specified
|
||||||
|
# in /gemini-b/opt/android-sdk/tools/proguard/proguard-android.txt
|
||||||
|
# You can edit the include path and order by changing the proguardFiles
|
||||||
|
# directive in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# Add any project specific keep options here:
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Uncomment this to preserve the line number information for
|
||||||
|
# debugging stack traces.
|
||||||
|
#-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
# If you keep the line number information, uncomment this to
|
||||||
|
# hide the original source file name.
|
||||||
|
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,2 @@
|
|||||||
|
<manifest package="org.isoron.androidbase"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"/>
|
@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2017 Álinson Santos Xavier <isoron@gmail.com>
|
||||||
|
*
|
||||||
|
* This file is part of Loop Habit Tracker.
|
||||||
|
*
|
||||||
|
* Loop Habit Tracker is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by the
|
||||||
|
* Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
* option) any later version.
|
||||||
|
*
|
||||||
|
* Loop Habit Tracker is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.isoron.androidbase;
|
||||||
|
|
||||||
|
import android.support.annotation.*;
|
||||||
|
|
||||||
|
import org.isoron.androidbase.activities.*;
|
||||||
|
|
||||||
|
public class BaseExceptionHandler implements Thread.UncaughtExceptionHandler
|
||||||
|
{
|
||||||
|
@Nullable
|
||||||
|
private Thread.UncaughtExceptionHandler originalHandler;
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
private BaseActivity activity;
|
||||||
|
|
||||||
|
public BaseExceptionHandler(@NonNull BaseActivity activity)
|
||||||
|
{
|
||||||
|
this.activity = activity;
|
||||||
|
originalHandler = Thread.getDefaultUncaughtExceptionHandler();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void uncaughtException(@Nullable Thread thread,
|
||||||
|
@Nullable Throwable ex)
|
||||||
|
{
|
||||||
|
if (ex == null) return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ex.printStackTrace();
|
||||||
|
new AndroidBugReporter(activity).dumpBugReportToFile();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (ex.getCause() instanceof InconsistentDatabaseException)
|
||||||
|
// {
|
||||||
|
// HabitsApplication app = (HabitsApplication) activity.getApplication();
|
||||||
|
// HabitList habits = app.getComponent().getHabitList();
|
||||||
|
// habits.repair();
|
||||||
|
// System.exit(0);
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (originalHandler != null)
|
||||||
|
originalHandler.uncaughtException(thread, ex);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2017 Álinson Santos Xavier <isoron@gmail.com>
|
||||||
|
*
|
||||||
|
* This file is part of Loop Habit Tracker.
|
||||||
|
*
|
||||||
|
* Loop Habit Tracker is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by the
|
||||||
|
* Free Software Foundation, either version 3 of the License, or (at your
|
||||||
|
* option) any later version.
|
||||||
|
*
|
||||||
|
* Loop Habit Tracker is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.isoron.androidbase;
|
||||||
|
|
||||||
|
import android.content.*;
|
||||||
|
import android.support.annotation.*;
|
||||||
|
|
||||||
|
import org.isoron.androidbase.*;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.security.*;
|
||||||
|
import java.security.cert.Certificate;
|
||||||
|
import java.security.cert.*;
|
||||||
|
|
||||||
|
import javax.inject.*;
|
||||||
|
import javax.net.ssl.*;
|
||||||
|
|
||||||
|
public class SSLContextProvider
|
||||||
|
{
|
||||||
|
private Context context;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public SSLContextProvider(@NonNull @AppContext Context context)
|
||||||
|
{
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SSLContext getCACertSSLContext()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CertificateFactory cf = CertificateFactory.getInstance("X.509");
|
||||||
|
InputStream caInput = context.getAssets().open("cacert.pem");
|
||||||
|
Certificate ca = cf.generateCertificate(caInput);
|
||||||
|
|
||||||
|
KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
|
||||||
|
ks.load(null, null);
|
||||||
|
ks.setCertificateEntry("ca", ca);
|
||||||
|
|
||||||
|
TrustManagerFactory tmf = TrustManagerFactory.getInstance(
|
||||||
|
TrustManagerFactory.getDefaultAlgorithm());
|
||||||
|
tmf.init(ks);
|
||||||
|
|
||||||
|
SSLContext ctx = SSLContext.getInstance("TLS");
|
||||||
|
ctx.init(null, tmf.getTrustManagers(), null);
|
||||||
|
|
||||||
|
return ctx;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
<resources>
|
||||||
|
<item name="toolbar" type="id" />
|
||||||
|
<item name="toolbarShadow" type="id" />
|
||||||
|
<item name="headerShadow" type="id" />
|
||||||
|
<attr name="palette" format="reference"/>
|
||||||
|
</resources>
|
@ -1,97 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
|
||||||
Copyright (C) 2013 The Android Open Source Project
|
|
||||||
|
|
||||||
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.
|
|
||||||
-->
|
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<array name="lightPalette">
|
|
||||||
<item>@color/red_700</item>
|
|
||||||
<item>@color/deep_orange_700</item>
|
|
||||||
<item>@color/yellow_800</item>
|
|
||||||
<item>@color/lime_700</item>
|
|
||||||
<item>@color/green_700</item>
|
|
||||||
<item>@color/teal_600</item>
|
|
||||||
<item>@color/cyan_600</item>
|
|
||||||
<item>@color/light_blue_600</item>
|
|
||||||
<item>@color/deep_purple_600</item>
|
|
||||||
<item>@color/purple_600</item>
|
|
||||||
<item>@color/pink_600</item>
|
|
||||||
<item>@color/grey_800</item>
|
|
||||||
<item>@color/grey_500</item>
|
|
||||||
</array>
|
|
||||||
|
|
||||||
<array name="darkPalette">
|
|
||||||
<item>@color/red_200</item>
|
|
||||||
<item>@color/deep_orange_200</item>
|
|
||||||
<item>@color/yellow_200</item>
|
|
||||||
<item>@color/lime_200</item>
|
|
||||||
<item>@color/green_A200</item>
|
|
||||||
<item>@color/teal_200</item>
|
|
||||||
<item>@color/cyan_200</item>
|
|
||||||
<item>@color/light_blue_200</item>
|
|
||||||
<item>@color/deep_purple_200</item>
|
|
||||||
<item>@color/purple_200</item>
|
|
||||||
<item>@color/pink_200</item>
|
|
||||||
<item>@color/grey_100</item>
|
|
||||||
<item>@color/grey_500</item>
|
|
||||||
</array>
|
|
||||||
|
|
||||||
<array name="transparentWidgetPalette">
|
|
||||||
<item>@color/red_800</item>
|
|
||||||
<item>@color/deep_orange_800</item>
|
|
||||||
<item>@color/yellow_800</item>
|
|
||||||
<item>@color/lime_800</item>
|
|
||||||
<item>@color/green_700</item>
|
|
||||||
<item>@color/teal_700</item>
|
|
||||||
<item>@color/cyan_700</item>
|
|
||||||
<item>@color/light_blue_700</item>
|
|
||||||
<item>@color/deep_purple_700</item>
|
|
||||||
<item>@color/purple_700</item>
|
|
||||||
<item>@color/pink_700</item>
|
|
||||||
<item>@color/black_aa</item>
|
|
||||||
<item>@color/black_aa</item>
|
|
||||||
</array>
|
|
||||||
|
|
||||||
<!-- Time and Date picker -->
|
|
||||||
<color name="circle_background">#f2f2f2</color>
|
|
||||||
<color name="line_background">#cccccc</color>
|
|
||||||
<color name="ampm_text_color">#8c8c8c</color>
|
|
||||||
<color name="done_text_color_normal">#000000</color>
|
|
||||||
<color name="done_text_color_disabled">#cccccc</color>
|
|
||||||
<color name="numbers_text_color">#8c8c8c</color>
|
|
||||||
<color name="transparent">#00000000</color>
|
|
||||||
<color name="transparent_black">#7f000000</color>
|
|
||||||
<color name="blue">#33b5e5</color>
|
|
||||||
<color name="blue_focused">#c1e8f7</color>
|
|
||||||
<color name="neutral_pressed">#33999999</color>
|
|
||||||
<color name="darker_blue">#0099cc</color>
|
|
||||||
<color name="date_picker_text_normal">#ff999999</color>
|
|
||||||
<color name="calendar_header">#999999</color>
|
|
||||||
<color name="date_picker_view_animator">#f2f2f2</color>
|
|
||||||
<color name="calendar_selected_date_text">#ffd1d2d4</color>
|
|
||||||
<color name="done_text_color">#888888</color>
|
|
||||||
<color name="done_text_color_dark">#888888</color>
|
|
||||||
|
|
||||||
<!-- Colors for red theme -->
|
|
||||||
<color name="red">#ff3333</color>
|
|
||||||
<color name="red_focused">#853333</color>
|
|
||||||
<color name="light_gray">#404040</color>
|
|
||||||
<color name="dark_gray">#363636</color>
|
|
||||||
<color name="line_dark">#808080</color>
|
|
||||||
|
|
||||||
<!-- Material design color palette -->
|
|
||||||
<color name="red_50">#FFEBEE</color>
|
<color name="red_50">#FFEBEE</color>
|
||||||
<color name="red_100">#FFCDD2</color>
|
<color name="red_100">#FFCDD2</color>
|
||||||
<color name="red_200">#EF9A9A</color>
|
<color name="red_200">#EF9A9A</color>
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,25 @@
|
|||||||
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion COMPILE_SDK_VERSION as Integer
|
||||||
|
buildToolsVersion BUILD_TOOLS_VERSION
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdkVersion MIN_SDK_VERSION as Integer
|
||||||
|
targetSdkVersion TARGET_SDK_VERSION as Integer
|
||||||
|
versionCode 1
|
||||||
|
versionName "1.0"
|
||||||
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# By default, the flags in this file are appended to flags specified
|
||||||
|
# in /gemini-b/opt/android-sdk/tools/proguard/proguard-android.txt
|
||||||
|
# You can edit the include path and order by changing the proguardFiles
|
||||||
|
# directive in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# Add any project specific keep options here:
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Uncomment this to preserve the line number information for
|
||||||
|
# debugging stack traces.
|
||||||
|
#-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
# If you keep the line number information, uncomment this to
|
||||||
|
# hide the original source file name.
|
||||||
|
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,2 @@
|
|||||||
|
<manifest package="com.android"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"/>
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="select_hours"/>
|
||||||
|
<string name="select_minutes"/>
|
||||||
|
<string name="color_picker_default_title"/>
|
||||||
|
<string name="clear"/>
|
||||||
|
<string name="clear_label"/>
|
||||||
|
<string name="done_label"/>
|
||||||
|
</resources>
|
@ -1,3 +0,0 @@
|
|||||||
-dontwarn java.beans.**
|
|
||||||
-dontwarn java.lang.**
|
|
||||||
-dontobfuscate
|
|
Before Width: | Height: | Size: 48 KiB |
@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
P=/sdcard/Android/data/org.isoron.uhabits/cache/Failed/
|
|
||||||
|
|
||||||
adb pull $P Failed/
|
|
||||||
adb shell rm -r $P
|
|
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 551 B |
Before Width: | Height: | Size: 505 B |
Before Width: | Height: | Size: 559 B |