Skip to content
This repository has been archived by the owner on Feb 24, 2018. It is now read-only.

Commit

Permalink
Update gradle to latest version, Runtime permissions added for Marshm…
Browse files Browse the repository at this point in the history
…allow, sqlcipher library updated
  • Loading branch information
Faruk Toptaş committed Mar 1, 2017
1 parent 6fce7d2 commit f07b226
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ android:
- tools

# The BuildTools version used by your project
- build-tools-21.0.0
- build-tools-25.0.2

# The SDK version used to compile your project
- android-19
- android-25

# Additional components
- extra-google-google_play_services
Expand Down
15 changes: 9 additions & 6 deletions Sealnote/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ repositories {
}

android {
compileSdkVersion 19
buildToolsVersion '21.0.0'
compileSdkVersion 25
buildToolsVersion '25.0.2'

defaultConfig {
minSdkVersion 14
targetSdkVersion 19
targetSdkVersion 25

versionCode 26
versionName "0.8.6"
Expand Down Expand Up @@ -71,15 +71,18 @@ tasks.withType(JavaCompile) {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
//compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')

compile 'com.android.support:support-v4:20.0.+'
compile 'com.android.support:support-v4:25.1.1'
compile 'com.etsy.android.grid:library:1.0.4'
compile 'com.github.gabrielemariotti.cards:library:1.6.0'
compile 'com.github.gabrielemariotti.cards:library-extra:1.6.0'
compile 'com.nhaarman.listviewanimations:library:2.6.0'

compile 'com.github.codechimp-org.apprater:library:1.0.+'
compile 'com.github.codechimp-org.apprater:library:1.0.32'
compile 'net.zetetic:android-database-sqlcipher:3.3.1-2@aar'



compile project(':aFileChooser')
}
Binary file removed Sealnote/libs/armeabi-v7a/libdatabase_sqlcipher.so
Binary file not shown.
Binary file removed Sealnote/libs/armeabi-v7a/libsqlcipher_android.so
Binary file not shown.
Binary file removed Sealnote/libs/armeabi-v7a/libstlport_shared.so
Binary file not shown.
Binary file removed Sealnote/libs/armeabi/libdatabase_sqlcipher.so
Binary file not shown.
Binary file removed Sealnote/libs/armeabi/libsqlcipher_android.so
Binary file not shown.
Binary file removed Sealnote/libs/armeabi/libstlport_shared.so
Binary file not shown.
Binary file removed Sealnote/libs/sqlcipher.jar
Binary file not shown.
Binary file removed Sealnote/libs/x86/libdatabase_sqlcipher.so
Binary file not shown.
Binary file removed Sealnote/libs/x86/libsqlcipher_android.so
Binary file not shown.
Binary file removed Sealnote/libs/x86/libstlport_shared.so
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package com.twistedplane.sealnote;


import android.app.ActionBar;
import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.text.Html;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.twistedplane.sealnote.storage.BackupUtils;
import com.twistedplane.sealnote.utils.FontCache;

Expand All @@ -24,6 +27,7 @@
public class BackupActivity extends Activity implements BackupUtils.BackupListener {
private static final String TAG = "BackupActivity";
private static final int REQUEST_BACKUP = 0x10;
private static final int REQ_PERMISSION_WRITE_EXTERNAL_STORAGE = 1000;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -39,9 +43,28 @@ protected void onCreate(Bundle savedInstanceState) {
}

/**
* Start backup activity
* Request permission then start backup activity
*/
public void doBackup(View view) {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.shouldShowRequestPermissionRationale(this,
Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
makeText(this, R.string.backup_permission_error, LENGTH_SHORT).show();
} else {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
REQ_PERMISSION_WRITE_EXTERNAL_STORAGE);
}
} else {
doBackup();
}
}

/**
* Start backup activity
*/
private void doBackup() {
new BackupUtils.BackupTask(this, this).execute();
}

Expand Down Expand Up @@ -97,4 +120,18 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
findViewById(R.id.backup_progress).setVisibility(View.INVISIBLE);
findViewById(R.id.backup_button).setVisibility(View.VISIBLE);
}

@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
switch (requestCode) {
case REQ_PERMISSION_WRITE_EXTERNAL_STORAGE:
if (grantResults.length > 0 &&
grantResults[0] == PackageManager.PERMISSION_GRANTED) {
doBackup();
} else {
makeText(this, getResources().getString(R.string.backup_permission_error), LENGTH_SHORT).show();
}
break;
}
}
}
1 change: 1 addition & 0 deletions Sealnote/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,6 @@
<string name="pick_backup_file">Pick Backup File</string>
<string name="start_restore">Start Restore</string>
<string name="write_a_review">Write a Review</string>
<string name="backup_permission_error">Backup unsuccessful! Please give storage permission.</string>

</resources>
8 changes: 4 additions & 4 deletions aFileChooser/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ buildscript {
apply plugin: 'com.android.library'

dependencies {
compile 'com.android.support:support-v4:20.0.+'
compile 'com.android.support:support-v4:25.1.1'
}

android {
compileSdkVersion 19
buildToolsVersion "21.0.0"
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 14
targetSdkVersion 19
targetSdkVersion 25
}

sourceSets {
Expand Down

0 comments on commit f07b226

Please sign in to comment.