├── IssueHandler-lib
├── TestApp
│ ├── .gitignore
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values
│ │ │ │ │ ├── styles.xml
│ │ │ │ │ ├── dimens.xml
│ │ │ │ │ └── strings.xml
│ │ │ │ ├── values-w820dp
│ │ │ │ │ └── dimens.xml
│ │ │ │ └── layout
│ │ │ │ │ └── a_main_activity.xml
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── busylee
│ │ │ │ └── issuehandlertestapp
│ │ │ │ └── testApp
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── MainApplication.java
│ │ └── androidTest
│ │ │ └── java
│ │ │ └── com
│ │ │ └── busylee
│ │ │ └── issuehandlertestapp
│ │ │ └── testApp
│ │ │ └── ApplicationTest.java
│ ├── proguard-rules.pro
│ └── build.gradle
├── issueHandler
│ ├── .gitignore
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values
│ │ │ │ │ ├── dimens.xml
│ │ │ │ │ └── strings.xml
│ │ │ │ ├── values-w820dp
│ │ │ │ │ └── dimens.xml
│ │ │ │ └── values-ru
│ │ │ │ │ └── strings.xml
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── busylee
│ │ │ │ └── issuehandler
│ │ │ │ ├── IssueHandlerSetup.java
│ │ │ │ ├── IssueHandlerActivity.java
│ │ │ │ └── IssueHandler.java
│ │ └── androidTest
│ │ │ └── java
│ │ │ └── com
│ │ │ └── busylee
│ │ │ └── issuehandlertestapp
│ │ │ └── issuehandler
│ │ │ └── ApplicationTest.java
│ ├── build.gradle
│ └── proguard-rules.pro
├── settings.gradle
├── .gitignore
├── gradle
│ ├── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradle.iml
│ ├── gradlew.bat
│ └── gradlew
├── build.gradle
├── gradle.properties
├── IssueHandler.iml
├── gradlew.bat
└── gradlew
├── IssueHandlerSample
├── app
│ ├── .gitignore
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── drawable-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── drawable-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values
│ │ │ │ │ ├── styles.xml
│ │ │ │ │ ├── dimens.xml
│ │ │ │ │ └── strings.xml
│ │ │ │ ├── values-w820dp
│ │ │ │ │ └── dimens.xml
│ │ │ │ └── layout
│ │ │ │ │ └── activity_main.xml
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── busylee
│ │ │ │ │ └── issuehandler
│ │ │ │ │ └── testApp
│ │ │ │ │ └── myapplication2
│ │ │ │ │ └── app
│ │ │ │ │ ├── CustomApplication.java
│ │ │ │ │ └── MainActivity.java
│ │ │ └── AndroidManifest.xml
│ │ └── androidTest
│ │ │ └── java
│ │ │ └── com
│ │ │ └── busylee
│ │ │ └── issuehandler
│ │ │ └── testApp
│ │ │ └── myapplication2
│ │ │ └── app
│ │ │ └── ApplicationTest.java
│ ├── proguard-rules.pro
│ ├── build.gradle
│ └── app.iml
├── settings.gradle
├── .gitignore
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── build.gradle
├── gradle.properties
├── IssueHandlerSample.iml
├── gradlew.bat
└── gradlew
├── aar-files
├── issueHandler-debug.1.0.1.aar
├── issueHandler-release1.0.2.aar
├── issueHandler-release1.1.0.aar
├── issueHandler-release-1.1.1.aar
├── issueHandler-release.1.0.3.aar
├── issueHandler-release.1.0.4.aar
├── issueHandler-release.1.0.5.aar
├── issueHandler-release.1.0.6.aar
├── issueHandler-release.2.0.1.aar
└── issueHandler-release.2.0.5.aar
└── README.md
/IssueHandler-lib/TestApp/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/IssueHandlerSample/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/IssueHandlerSample/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/IssueHandler-lib/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':issueHandler', ':TestApp'
2 |
--------------------------------------------------------------------------------
/IssueHandlerSample/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea
4 | .DS_Store
5 | /build
6 |
--------------------------------------------------------------------------------
/IssueHandler-lib/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea
4 | .DS_Store
5 | /build
6 | *.iml
7 |
--------------------------------------------------------------------------------
/aar-files/issueHandler-debug.1.0.1.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/aar-files/issueHandler-debug.1.0.1.aar
--------------------------------------------------------------------------------
/aar-files/issueHandler-release1.0.2.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/aar-files/issueHandler-release1.0.2.aar
--------------------------------------------------------------------------------
/aar-files/issueHandler-release1.1.0.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/aar-files/issueHandler-release1.1.0.aar
--------------------------------------------------------------------------------
/aar-files/issueHandler-release-1.1.1.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/aar-files/issueHandler-release-1.1.1.aar
--------------------------------------------------------------------------------
/aar-files/issueHandler-release.1.0.3.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/aar-files/issueHandler-release.1.0.3.aar
--------------------------------------------------------------------------------
/aar-files/issueHandler-release.1.0.4.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/aar-files/issueHandler-release.1.0.4.aar
--------------------------------------------------------------------------------
/aar-files/issueHandler-release.1.0.5.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/aar-files/issueHandler-release.1.0.5.aar
--------------------------------------------------------------------------------
/aar-files/issueHandler-release.1.0.6.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/aar-files/issueHandler-release.1.0.6.aar
--------------------------------------------------------------------------------
/aar-files/issueHandler-release.2.0.1.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/aar-files/issueHandler-release.2.0.1.aar
--------------------------------------------------------------------------------
/aar-files/issueHandler-release.2.0.5.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/aar-files/issueHandler-release.2.0.5.aar
--------------------------------------------------------------------------------
/IssueHandler-lib/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandler-lib/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/IssueHandlerSample/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandlerSample/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/IssueHandler-lib/gradle/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandler-lib/gradle/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/IssueHandlerSample/app/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandlerSample/app/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/IssueHandlerSample/app/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandlerSample/app/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/IssueHandlerSample/app/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandlerSample/app/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandler-lib/TestApp/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandler-lib/TestApp/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandler-lib/TestApp/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandler-lib/TestApp/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/IssueHandlerSample/app/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandlerSample/app/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandler-lib/issueHandler/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandler-lib/issueHandler/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandler-lib/issueHandler/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/busylee999/issue-handler/HEAD/IssueHandler-lib/issueHandler/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/IssueHandlerSample/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/IssueHandlerSample/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/IssueHandler-lib/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Feb 05 13:35:05 MSK 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/IssueHandler-lib/gradle/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Jan 17 15:24:43 MSK 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-bin.zip
7 |
--------------------------------------------------------------------------------
/IssueHandlerSample/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | TestApp
5 | Generate test exception!
6 | Start another activity!
7 |
8 |
9 |
--------------------------------------------------------------------------------
/IssueHandlerSample/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | My Application 2
5 | Click for generate exception!
6 | Settings
7 |
8 |
9 |
--------------------------------------------------------------------------------
/IssueHandlerSample/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/src/androidTest/java/com/busylee/issuehandlertestapp/testApp/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.busylee.issuehandlertestapp.testApp;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/src/androidTest/java/com/busylee/issuehandlertestapp/issuehandler/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.busylee.issuehandlertestapp.issuehandler;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/IssueHandlerSample/app/src/androidTest/java/com/busylee/issuehandler/testApp/myapplication2/app/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.busylee.issuehandler.testApp.myapplication2.app;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/IssueHandlerSample/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.1.1'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/IssueHandler-lib/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | mavenCentral()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.0.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | mavenCentral()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 21
5 | buildToolsVersion "21.0.0"
6 |
7 | defaultConfig {
8 | minSdkVersion 8
9 | targetSdkVersion 21
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | compile fileTree(dir: 'libs', include: ['*.jar'])
23 | }
24 |
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/src/main/java/com/busylee/issuehandler/IssueHandlerSetup.java:
--------------------------------------------------------------------------------
1 | package com.busylee.issuehandler;
2 |
3 | import java.lang.annotation.Retention;
4 | import java.lang.annotation.RetentionPolicy;
5 |
6 | /**
7 | * Created by busylee on 09.02.15.
8 | */
9 | @Retention(RetentionPolicy.RUNTIME)
10 | public @interface IssueHandlerSetup {
11 |
12 | enum IssueTracker {
13 | Redmine,
14 | }
15 |
16 | String serverUrl();
17 | String filePath() default "";
18 | boolean ignoreMode() default false;
19 |
20 | IssueTracker issueTraker() default IssueTracker.Redmine;
21 | }
22 |
--------------------------------------------------------------------------------
/IssueHandlerSample/app/src/main/java/com/busylee/issuehandler/testApp/myapplication2/app/CustomApplication.java:
--------------------------------------------------------------------------------
1 | package com.busylee.issuehandler.testApp.myapplication2.app;
2 |
3 | import android.app.Application;
4 | import com.busylee.issuehandler.IssueHandler;
5 | import com.busylee.issuehandler.IssueHandlerSetup;
6 |
7 | /**
8 | * Created by busylee on 05.02.15.
9 | */
10 |
11 | @IssueHandlerSetup(
12 | serverUrl = "http://tryremember.ru"
13 | )
14 | public class CustomApplication extends Application {
15 |
16 | @Override
17 | public void onCreate() {
18 | super.onCreate();
19 |
20 | IssueHandler.init(this);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/IssueHandlerSample/app/src/main/java/com/busylee/issuehandler/testApp/myapplication2/app/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.busylee.issuehandler.testApp.myapplication2.app;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.view.View;
6 |
7 |
8 | public class MainActivity extends Activity {
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_main);
14 |
15 | findViewById(R.id.tv_generate_exception).setOnClickListener(new View.OnClickListener() {
16 | @Override
17 | public void onClick(View view) {
18 | int i = 1 / 0;
19 | }
20 | });
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | This application uses IssueBot for posting issues to bag trackers
3 | Install
4 | Cancel
5 |
6 | Ooops.....
7 | Application crashed. Do you want to create new issue for developers?
8 | Create Issue
9 | Cancel
10 |
11 |
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/src/main/res/values-ru/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Это приложение использует IssueBot для создания задач в Bug трекере
3 | Установить
4 | Отмена
5 |
6 | Ой.....
7 | Приложение остановлено. Вы хотите завести новую задачу для разработчиков?
8 | Создать задачу
9 | Отмена
10 |
11 |
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /home/busylee/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/IssueHandlerSample/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /home/busylee/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /home/busylee/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 21
5 | buildToolsVersion "21.1.2"
6 |
7 | defaultConfig {
8 | applicationId "com.busylee.issuehandler.testApp"
9 | minSdkVersion 9
10 | targetSdkVersion 21
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile 'com.android.support:appcompat-v7:21.0.2'
25 | compile project(':issueHandler')
26 | }
27 |
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/src/main/res/layout/a_main_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/IssueHandler-lib/gradle/gradle.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/IssueHandlerSample/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/IssueHandlerSample/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/IssueHandler-lib/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/IssueHandlerSample/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/IssueHandler-lib/IssueHandler.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/IssueHandlerSample/IssueHandlerSample.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/IssueHandlerSample/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | repositories {
4 | jcenter()
5 | maven {
6 | url 'http://tryremember.ru:8383/archiva/repository/mvn'
7 | }
8 | }
9 |
10 | android {
11 | compileSdkVersion 21
12 | buildToolsVersion "21.1.2"
13 |
14 | defaultConfig {
15 | applicationId "com.busylee.issuehandler.testApp.myapplication2.app"
16 | minSdkVersion 9
17 | targetSdkVersion 21
18 | versionCode 1
19 | versionName "1.0"
20 | }
21 |
22 | compileOptions {
23 | sourceCompatibility JavaVersion.VERSION_1_6
24 | targetCompatibility JavaVersion.VERSION_1_6
25 | }
26 | buildTypes {
27 | release {
28 | minifyEnabled false
29 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
30 | }
31 | }
32 | }
33 |
34 | dependencies {
35 | compile fileTree(dir: 'libs', include: ['*.jar'])
36 | compile 'com.busylee.issuehandler:issuehandler:2.0.4'
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/src/main/java/com/busylee/issuehandlertestapp/testApp/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.busylee.issuehandlertestapp.testApp;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.ActionBarActivity;
6 | import android.view.View;
7 |
8 |
9 | public class MainActivity extends ActionBarActivity {
10 |
11 | @Override
12 | protected void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 |
15 | setContentView(R.layout.a_main_activity);
16 |
17 | inflateViews();
18 | }
19 |
20 | private void inflateViews() {
21 | findViewById(R.id.btn_test_exception).setOnClickListener(new View.OnClickListener() {
22 | @Override
23 | public void onClick(View view) {
24 | int i = 1 / 0;
25 | }
26 | });
27 |
28 | findViewById(R.id.btn_start_another_activity).setOnClickListener(new View.OnClickListener() {
29 | @Override
30 | public void onClick(View view) {
31 | startActivity(new Intent(MainActivity.this, MainActivity.class));
32 | }
33 | });
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/IssueHandler-lib/TestApp/src/main/java/com/busylee/issuehandlertestapp/testApp/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.busylee.issuehandlertestapp.testApp;
2 |
3 | import android.app.Application;
4 | import android.text.TextUtils;
5 | import android.util.Log;
6 | import com.busylee.issuehandler.IssueHandler;
7 | import com.busylee.issuehandler.IssueHandlerSetup;
8 |
9 | import java.io.*;
10 |
11 | /**
12 | * Created by busylee on 05.02.15.
13 | */
14 | @IssueHandlerSetup(
15 | serverUrl = "http://tryremember.ru:3000"
16 | )
17 | public class MainApplication extends Application {
18 |
19 | private static final String ATTACH_FILE_NAME = "/attach.txt";
20 |
21 | @Override
22 | public void onCreate() {
23 | super.onCreate();
24 | IssueHandler.init(this, getFilePath());
25 |
26 | modifyFileWeNeedTobeAttached();
27 | }
28 |
29 | private String getFilePath() {
30 | return getFilesDir().getAbsolutePath() + ATTACH_FILE_NAME;
31 | }
32 |
33 | private void modifyFileWeNeedTobeAttached() {
34 | PrintWriter out = null;
35 | try {
36 | File file = getFileFromPath(getFilePath());
37 | out = new PrintWriter(new BufferedWriter(new FileWriter(file, true)));
38 | out.println("test string");
39 | } catch (IOException e) {
40 | e.printStackTrace();
41 | } finally {
42 | if(out != null)
43 | out.close();
44 | }
45 | }
46 |
47 | private static File getFileFromPath(String path) {
48 | boolean ret;
49 | File file = null;
50 | if (TextUtils.isEmpty(path)) {
51 | Log.e("Error", "The path of Log file is Null.");
52 | return file;
53 | }
54 | file = new File(path);
55 | if (file.exists()) {
56 | if (! file.canWrite())
57 | Log.e("Error", "The Log file can not be written.");
58 | } else {
59 | //create the log file
60 | try {
61 | ret = file.createNewFile();
62 | if (ret) {
63 | Log.i("Success", "The Log file was successfully created! -" + file.getAbsolutePath());
64 | } else {
65 | Log.i("Success", "The Log file exist! -" + file.getAbsolutePath());
66 | }
67 | if (!file.canWrite()) {
68 | Log.e("Error", "The Log file can not be written.");
69 | }
70 | } catch (IOException e) {
71 | Log.e("Error", "Failed to create The Log file.");
72 | e.printStackTrace();
73 | }
74 | }
75 |
76 | // please do not forget to make file you want to upload visible for other application
77 | file.setReadable(true, false);
78 |
79 | return file;
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/IssueHandler-lib/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/IssueHandlerSample/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/IssueHandler-lib/gradle/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/src/main/java/com/busylee/issuehandler/IssueHandlerActivity.java:
--------------------------------------------------------------------------------
1 | package com.busylee.issuehandler;
2 |
3 | import android.app.Activity;
4 | import android.app.AlertDialog;
5 | import android.content.DialogInterface;
6 | import android.content.Intent;
7 | import android.net.Uri;
8 | import android.os.Bundle;
9 | import android.view.Window;
10 |
11 | /**
12 | * Created by busylee on 11.02.15.
13 | */
14 | public class IssueHandlerActivity extends Activity {
15 |
16 | private static final Uri ISSUE_BOT_PLAY_URI = Uri.parse("market://details?id=" + IssueHandler.ISSUE_BOT_PACKAGE_NAME);
17 | private static final String FILTER_ACTION = "com.busylee.issuebot.redmine.issue";
18 |
19 | public static final String EXTRA_SERVER_URL = "EXTRA_SERVER_URL";
20 | public static final String EXTRA_FILE_PATH = "EXTRA_FILE_PATH";
21 | public static final String EXTRA_THROWABLE = "EXTRA_THROWABLE";
22 |
23 | public static final String ACTION_ISSUE = "ACTION_ISSUE";
24 | public static final String ACTION_BOT_APPLICATION = "ACTION_BOT_APPLICATION";
25 |
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 |
30 | getWindow().addFlags(Window.FEATURE_NO_TITLE);
31 |
32 | final String action = getIntent().getAction();
33 |
34 | final boolean isIssueBotInstalled = IssueHandler.isIssueBotInstalled(this);
35 |
36 | if(ACTION_ISSUE.equals(action) && isIssueBotInstalled) {
37 | AlertDialog.Builder builder = new AlertDialog.Builder(this);
38 | builder.setTitle(R.string.issue_dialog_title);
39 | builder.setMessage(R.string.issue_dialog_message);
40 | builder.create();
41 | builder.setPositiveButton(R.string.issue_dialog_positive_button, new DialogInterface.OnClickListener() {
42 | @Override
43 | public void onClick(DialogInterface dialogInterface, int i) {
44 | Intent intent = new Intent(FILTER_ACTION);
45 | intent.putExtra(EXTRA_SERVER_URL, getIntent().getStringExtra(EXTRA_SERVER_URL));
46 | intent.putExtra(EXTRA_THROWABLE, getIntent().getSerializableExtra(EXTRA_THROWABLE));
47 | intent.putExtra(EXTRA_FILE_PATH, getIntent().getStringExtra(EXTRA_FILE_PATH));
48 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
49 | startActivity(intent);
50 | finish();
51 |
52 | }
53 | });
54 | builder.setNegativeButton(R.string.issue_dialog_negative_button, new DialogInterface.OnClickListener() {
55 | @Override
56 | public void onClick(DialogInterface dialogInterface, int i) {
57 | finish();
58 | }
59 | });
60 | builder.show();
61 | } else if(ACTION_BOT_APPLICATION.equals(action) || !isIssueBotInstalled) {
62 | AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
63 | alertDialogBuilder.setMessage(R.string.issuebot_not_installed_dialog_message);
64 |
65 | alertDialogBuilder.setPositiveButton(R.string.issuebot_not_installed_dialog_positive_button, new DialogInterface.OnClickListener() {
66 | @Override
67 | public void onClick(DialogInterface dialogInterface, int i) {
68 | Intent intent = new Intent(Intent.ACTION_VIEW);
69 | intent.setData(ISSUE_BOT_PLAY_URI);
70 | startActivity(intent);
71 | finish();
72 | }
73 | });
74 |
75 | alertDialogBuilder.setNegativeButton(R.string.issuebot_not_installed_dialog_negative_button, new DialogInterface.OnClickListener() {
76 | @Override
77 | public void onClick(DialogInterface dialogInterface, int i) {
78 | finish();
79 | }
80 | });
81 |
82 | alertDialogBuilder.show();
83 | } else
84 | finish();
85 |
86 | }
87 |
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Review
2 | Android Library for handling uncaught exceptions and sending it to installed IssueBot (https://play.google.com/store/apps/details?id=com.busylee.issuebot) program for posing to bug-trackers. The challenge of using this library it is simplify to store bug issues of your developing Android projects
3 |
4 | Features:
5 |
6 | 1. Handling uncaugth exceptions and posting it to preinstalled IssueBot Android Application on phone your app running for posting it to bug-tracker system IssueBot supports.
7 | 2. Installing IssueBot if it is not on the phone.
8 | 3. Automatic attaching addition files you need to store for issue in bug tracker.
9 |
10 | ## Quick start
11 |
12 | 1. Add dependency for you project.
13 | 2. Add init code in Application.
14 | 3. Specify server url and file path
15 |
16 | You can look for sample project.
17 |
18 | ### Adding dependency for project:
19 |
20 | Using gradle:
21 |
22 | Add external repository in build.gragle file in your gradle module folder uses this lib or edit build.gradle file for all project:
23 |
24 | ...
25 | apply plugin: 'com.android.application'
26 |
27 | repositories {
28 | mavenCentral()
29 | maven {
30 | url 'http://tryremember.ru:8383/archiva/repository/mvn'
31 | }
32 | }
33 |
34 | android {
35 | ...
36 |
37 |
38 | And add dependency:
39 |
40 | ...
41 | dependency {
42 | ...
43 | compile 'com.busylee.issuehandler:issuehandler:2.0.5'
44 | ...
45 | }
46 | ...
47 |
48 | This is preffered approach. But it is suitable only if you have internet connection.
49 |
50 | Using arr file:
51 |
52 | Simple download latest version of aar file from aar-files directory of this repository and add it as dependency for your project.
53 |
54 | ### Using in project:
55 | In your custom application class add IssueHandler init in on create method. Issue handler lib now uses Application context for create intents for aware user about Exception.
56 |
57 | public void onCreate() {
58 | IssueHandler.init(this)
59 | }
60 |
61 | And add annotation for your Application class. This annotation defines library setting.
62 |
63 | @IssueHandlerSetup(
64 | serverUrl = "your/redmine/server/path"
65 | filePath = "/path/to/file/from/application/private/directory"
66 | )
67 |
68 | If file path is specified in @IssueHandlerSetup annotation, assumed that file located in application private directory. This file must be marked as readable for another application.
69 | File location is not a required parameter. If your file location is constant specify it in annotation, otherwise you can ommit filePath definition in annotation and specify it in init method
70 |
71 | IssueHandler.init(this, "path/to/file/be/attached");
72 |
73 | Note: If you want to attach file for issue you need to specify file permissions as readable for everybody especially if you created it in application own directory.
74 |
75 | ## Versions
76 | Latest version in mvn repo is 2.0.5.
77 |
78 | New in 2.0.5:
79 | - Increased install Issue Bot dialog showing timeout
80 | - Added callback on throawble occuring
81 |
82 | New in 2.0.1:
83 | - Removed dependency from activity. It is no matter now where Exception was occured.
84 | - Added IssueHandlerSetup annotation for simplifying setup of library.
85 | - Auto detection absolute path of file for attach, if it is specified in annotation.
86 |
87 | ## License
88 |
89 | Copyright 2014 Popov Dmitry
90 |
91 | Licensed under the Apache License, Version 2.0 (the "License");
92 | you may not use this file except in compliance with the License.
93 | You may obtain a copy of the License at
94 |
95 | http://www.apache.org/licenses/LICENSE-2.0
96 |
97 | Unless required by applicable law or agreed to in writing, software
98 | distributed under the License is distributed on an "AS IS" BASIS,
99 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
100 | See the License for the specific language governing permissions and
101 | limitations under the License.
102 |
--------------------------------------------------------------------------------
/IssueHandler-lib/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/IssueHandlerSample/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/IssueHandler-lib/gradle/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/IssueHandlerSample/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/IssueHandler-lib/issueHandler/src/main/java/com/busylee/issuehandler/IssueHandler.java:
--------------------------------------------------------------------------------
1 | package com.busylee.issuehandler;
2 |
3 | import android.app.*;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.pm.ApplicationInfo;
7 | import android.content.pm.PackageInfo;
8 | import android.content.pm.PackageManager;
9 | import android.text.TextUtils;
10 | import android.util.Log;
11 |
12 | /**
13 | * Created by busylee on 23.10.14.
14 | */
15 | public class IssueHandler implements Thread.UncaughtExceptionHandler{
16 |
17 | public static final String ISSUE_BOT_PACKAGE_NAME = "com.busylee.issuebot";
18 |
19 | private static final String LOG_TAG = "IssueHandler";
20 | private static final int ALARM_DELAY = 500; //500ms
21 |
22 | //todo just for hotfix
23 | private static final int ALARM_DELAY_ISSUE_BOT_INSTALL_DIALOG = 2000; //2000ms
24 |
25 | private static IssueHandler INSTANCE = new IssueHandler();
26 | private static IssueHandlerConfiguration CONFIGURATION;
27 |
28 | private Application mContext;
29 | private ThrowableCallback mThrowableCallback;
30 |
31 | /**
32 | * Initialization of IssueHandler. It if Application class has no @IssueHandlerSetup
33 | * annotation, it logs appropriate error.
34 | * If file path is specified in @IssueHandlerSetup annotation, assumed that file located in
35 | * application private directory. This file must be marked as readable for another application.
36 | * @param application
37 | */
38 | public static void init(Application application) {
39 | init(application, null);
40 | }
41 |
42 | /**
43 | * Initialization of IssueHandler. It if Application class has no @IssueHandlerSetup
44 | * annotation, it logs appropriate error.
45 | * It stores file location, which will be attached to issue, if exception will occur.
46 | * Param filePath passed into function overrides filePath specified in @IssueHandlerSetup
47 | * annotation
48 | * Check if IssueBot application is installed then set instance of handler as
49 | * default uncaught exception handler, otherwise show dialog for install IssueBot app.
50 | * @param application
51 | * @param filePath file path to file will be attached to issue
52 | */
53 | public static void init(Application application, String filePath) {
54 | final IssueHandlerSetup issueHandlerSetup = application.getClass().getAnnotation(IssueHandlerSetup.class);
55 | if (issueHandlerSetup == null) {
56 | Log.e(LOG_TAG,
57 | "Issue handler missed annotation @IssueHandlerSetup");
58 | return;
59 | }
60 |
61 | if(isApplicationDebuggable(application) || CONFIGURATION.mIgnoreMode) {
62 |
63 | if (Thread.getDefaultUncaughtExceptionHandler() instanceof IssueHandler)
64 | return;
65 |
66 | if(!isIssueBotInstalled(application))
67 | showIssueBotInstallDialog(application);
68 |
69 | INSTANCE.mContext = application;
70 |
71 | final String serverUrl = issueHandlerSetup.serverUrl();
72 | final boolean ignoreMode = issueHandlerSetup.ignoreMode();
73 |
74 | String resultFilePath = null;
75 | if(!TextUtils.isEmpty(filePath)) {
76 | resultFilePath = filePath;
77 | } else {
78 | String filePathSetup = issueHandlerSetup.filePath();
79 | if(!TextUtils.isEmpty(filePathSetup))
80 | resultFilePath = application.getFilesDir().getAbsolutePath() + filePathSetup;
81 | }
82 |
83 | init(new IssueHandlerConfiguration(serverUrl, ignoreMode, resultFilePath));
84 |
85 | Thread.setDefaultUncaughtExceptionHandler(INSTANCE);
86 | } else {
87 | Log.i(LOG_TAG,
88 | "Application not in debug mode");
89 | }
90 |
91 | }
92 |
93 | /**
94 | * Storing parsed configuration parameters
95 | * @param issueHandlerConfiguration
96 | */
97 | private static void init(IssueHandlerConfiguration issueHandlerConfiguration) {
98 | CONFIGURATION = issueHandlerConfiguration;
99 | }
100 |
101 | /**
102 | * Setting exception callback, it is usefull to store any data into your file log for example or check consistent of
103 | * your program time model
104 | * @param throwableCallback
105 | */
106 | public static void setCallback(ThrowableCallback throwableCallback) {
107 | INSTANCE.mThrowableCallback = throwableCallback;
108 | }
109 |
110 | /**
111 | * Check is application debuggable
112 | * @param context
113 | * @return
114 | */
115 | private static boolean isApplicationDebuggable(Context context) {
116 | return (0 != (context.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));
117 | }
118 |
119 | private Context getContext() {
120 | return mContext;
121 | }
122 | /**
123 | * Catching exception and showing alert dialog to ask user if he wants to create issue.
124 | * @param thread
125 | * @param throwable
126 | */
127 | @Override
128 | public void uncaughtException(Thread thread, final Throwable throwable) {
129 |
130 | // get user ability to do some action
131 | if(mThrowableCallback != null)
132 | try {
133 | mThrowableCallback.onThrowable(throwable);
134 | } catch (Exception ignore) {}
135 |
136 | Intent crashedIntent = new Intent(getContext(), IssueHandlerActivity.class);
137 | crashedIntent.setAction(IssueHandlerActivity.ACTION_ISSUE);
138 | crashedIntent.putExtra(IssueHandlerActivity.EXTRA_SERVER_URL, CONFIGURATION.mServerUrl);
139 | crashedIntent.putExtra(IssueHandlerActivity.EXTRA_THROWABLE, throwable);
140 | if(!TextUtils.isEmpty(CONFIGURATION.mFileUrl))
141 | crashedIntent.putExtra(IssueHandlerActivity.EXTRA_FILE_PATH, CONFIGURATION.mFileUrl);
142 |
143 | crashedIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
144 | crashedIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
145 | crashedIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
146 |
147 | PendingIntent intent = PendingIntent.getActivity(getContext(), 0, crashedIntent, crashedIntent.getFlags());
148 | AlarmManager mgr = (AlarmManager) getContext().getSystemService(Context.ALARM_SERVICE);
149 | mgr.set(AlarmManager.RTC, System.currentTimeMillis() + ALARM_DELAY, intent);
150 |
151 | System.exit(0);
152 | }
153 |
154 | /**
155 | * Showing information dialog, that this application uses Issue Bot application for posting
156 | * issues to bug tracker. Asking user if he wants to install it from google play.
157 | * @param context
158 | */
159 | private static void showIssueBotInstallDialog(final Context context) {
160 | Intent issueBotInstallIntent = new Intent(context, IssueHandlerActivity.class);
161 | issueBotInstallIntent.setAction(IssueHandlerActivity.ACTION_BOT_APPLICATION);
162 |
163 | PendingIntent intent = PendingIntent.getActivity(context, 0, issueBotInstallIntent, issueBotInstallIntent.getFlags());
164 | AlarmManager mgr = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
165 | mgr.set(AlarmManager.RTC, System.currentTimeMillis() + ALARM_DELAY_ISSUE_BOT_INSTALL_DIALOG, intent);
166 | }
167 |
168 | /**
169 | * Checking for Issue Bot application is installed
170 | * @param context
171 | * @return
172 | */
173 | static boolean isIssueBotInstalled(Context context) {
174 | return checkPackageInstalled(context, ISSUE_BOT_PACKAGE_NAME);
175 | }
176 |
177 | /**
178 | * CHeck package is installed
179 | * @param context
180 | * @param packageName
181 | * @return
182 | */
183 | private static boolean checkPackageInstalled(Context context, String packageName) {
184 | PackageManager packageManager = context.getPackageManager();
185 | for(PackageInfo packageInfo : packageManager.getInstalledPackages(0)) {
186 | if(packageInfo.packageName.equals(packageName))
187 | return true;
188 | }
189 | return false;
190 | }
191 |
192 | /**
193 | * Class for storing information about IssueHandler configuration
194 | */
195 | private static class IssueHandlerConfiguration {
196 |
197 | private String mServerUrl;
198 | private String mFileUrl;
199 | private boolean mIgnoreMode = false;
200 |
201 | IssueHandlerConfiguration(String serverUrl, boolean ignoreMode, String filePath) {
202 | mServerUrl = serverUrl;
203 | mIgnoreMode = ignoreMode;
204 | mFileUrl = filePath;
205 | }
206 | }
207 |
208 | public interface ThrowableCallback {
209 | void onThrowable(Throwable e);
210 | }
211 | }
212 |
--------------------------------------------------------------------------------