Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(all): update libraries #280

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Android Build
on:
on:
push:
paths-ignore:
- 'ios/**'
Expand All @@ -17,7 +17,7 @@ jobs:
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
USE_CCACHE: 1
SDK_VERSION: 9.3.2.GA
SDK_VERSION: 11.0.0.GA
MODULE_ID: appcelerator.encrypteddatabase
steps:
- uses: actions/checkout@v2
Expand All @@ -37,6 +37,11 @@ jobs:
${{ runner.OS }}-node-modules-
${{ runner.OS }}-

- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'

- run: npm ci
name: Install dependencies
if: steps.node-cache.outputs.cache-hit != 'true'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node.js 12.x
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '14.x'

- run: npm ci
name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: iOS Build
on:
on:
push:
paths-ignore:
- 'android/**'
Expand All @@ -9,13 +9,13 @@ on:
- 'android/**'
- 'apidoc/**'
workflow_dispatch:

jobs:
ios:
runs-on: macos-latest
name: iOS
env:
SDK_VERSION: 9.3.2.GA
SDK_VERSION: 12.2.1.GA
MODULE_ID: appcelerator.encrypteddatabase
steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: JavaScript Lint
on:
on:
push:
paths:
- '**.js'
Expand All @@ -11,18 +11,18 @@ on:
- '**.json'
- '**.eslint*'
workflow_dispatch:

jobs:
js:
runs-on: ubuntu-latest
name: JavaScript
steps:
- uses: actions/checkout@v2

- name: Use Node.js 12.x
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '14.x'

- name: Cache Node.js modules
id: node-cache
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,27 @@ This is the Appcelerator Encrypted Database Module for Titanium.

Interested in contributing? Read the [contributors/committer's](https://wiki.appcelerator.org/display/community/Home) guide.

## How to build

### iOS

For iOS you have to build SQLCipher by hand first:
```
$ cd ~/Documents/code
$ git clone https://github.com/sqlcipher/sqlcipher.git
$ cd sqlcipher
$ ./configure --with-crypto-lib=none
$ make sqlite3.c
```
(source https://www.zetetic.net/sqlcipher/ios-tutorial/#option-1-source-integration)

and then put the sqlite3.c/sqlite3.h file into the ios folder. After that you can compile the module with `ti build -p ios -b`.

### Android

Update the version in `build.gradle` and run `ti build -p android -b`

## Legal

This module is Copyright (c) 2010-present by Appcelerator, Inc. All Rights Reserved. Usage of this module is subject to
This module is Copyright (c) 2010-present by Appcelerator, Inc. All Rights Reserved. Usage of this module is subject to
the Terms of Service agreement with Appcelerator, Inc.
5 changes: 3 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dependencies {
implementation "androidx.sqlite:sqlite:2.1.0"
}
implementation 'net.zetetic:android-database-sqlcipher:4.5.4'
implementation "androidx.sqlite:sqlite:2.2.0"
}
Binary file removed android/lib/sqlcipher.jar
Binary file not shown.
Binary file removed android/libs/arm64-v8a/libsqlcipher.so
Binary file not shown.
Binary file removed android/libs/armeabi-v7a/libsqlcipher.so
Binary file not shown.
Binary file removed android/libs/x86/libsqlcipher.so
Binary file not shown.
Binary file removed android/libs/x86_64/libsqlcipher.so
Binary file not shown.
2 changes: 1 addition & 1 deletion android/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 4.1.0
version: 5.0.1
apiversion: 4
architectures: arm64-v8a armeabi-v7a x86 x86_64
description: Provides transparent, secure 256-bit AES encryption of SQLite database files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ public void setPassword(String value)
this.password = value;
}

// clang-format off
@Kroll.setProperty
public void pageSize(int value)
// clang-format on
{
this.dbSettings.setPageSize(value);
}

// clang-format off
@Kroll.getProperty
@Kroll.method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import net.sqlcipher.DatabaseUtils;
import net.sqlcipher.SQLException;
import net.sqlcipher.database.SQLiteDatabase;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
package appcelerator.encrypteddatabase;

import android.database.Cursor;
import android.database.SQLException;
import android.os.Build;
import java.util.HashMap;
import net.sqlcipher.CrossProcessCursorWrapper;
import net.sqlcipher.SQLException;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.kroll.common.Log;
Expand Down
11 changes: 10 additions & 1 deletion apidoc/EncryptedDatabase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: |
This module exposes the same API as Titanium.Database, but it encrypts all content (even the schema) using
a password you specify.

<p class="note">Note: This feature requires a Pro or Enterprise subscription. More info <a href="https://www.appcelerator.com/pricing/" target="_blank">here</a>!</p>
You can download the module at [appcelerator.encrypteddatabase](https://github.com/tidev/appcelerator.encrypteddatabase/releases)

### Getting Started

Expand Down Expand Up @@ -129,6 +129,15 @@ properties:
type: String
since: "1.0.0"

- name: pageSize
summary: Setting the PRAGMA cipher_page_size value
description: |
Setting the PRAGMA cipher_page_size value. For more info look at
https://www.zetetic.net/sqlcipher/sqlcipher-api/#cipher_page_size
type: Number
platforms: [android]
since: { android: "5.0.0" }

examples:
- title: Open an encrypted database
example: |
Expand Down
8 changes: 4 additions & 4 deletions example/JSON1-Extension/app_json1.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ win.add(btn);
win.open();

function accessDatabase() {
dbobj.setPassword('secret');
dbobj.password = 'secret';

Ti.API.info('Opening DB ...');
const instance = dbobj.open('test.db');

instance.execute('CREATE TABLE IF NOT EXISTS user(name string, phone string);');
instance.execute('insert into user (name, phone) values("oz", json(\'{"cell":"+491765", "home":"+498973"}\'));');

const dataToInsertHandle = instance.execute('select user.phone from user where user.name==\'oz\'');
const result = dataToInsertHandle.isValidRow() ? dataToInsertHandle.fieldByName('phone') : null;

Expand Down
5 changes: 3 additions & 2 deletions ios/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 3.0.0
version: 4.0.1
apiversion: 2
architectures: armv7 arm64 i386 x86_64
architectures: arm64 x86_64
description: Provides transparent, secure 256-bit AES encryption of SQLite database files.
author: Dawson Toth
license: Appcelerator Commercial License
Expand All @@ -17,3 +17,4 @@ moduleid: appcelerator.encrypteddatabase
guid: d1b3740c-ec53-45c6-8454-8748f91da6ad
platform: iphone
minsdk: 9.2.0
mac: false
Loading
Loading