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

[TIMOB-23595] Android: Recompile ti.crypto module against latest SDK #5

Merged
merged 1 commit into from
Jul 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tmp
bin
build
*.zip
.DS_Store
.project
android/libs
android/build.properties
android/dist
24 changes: 13 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
language: objective-c
osx_image: xcode7.1
osx_image: xcode7.3
env:
global:
- "MODULE_NAME=ti.crypto"
global:
- "MODULE_NAME=ti.crypto"
- TRAVIS_NODE_VERSION="4"
before_install:
- MODULE_ROOT=$PWD
- brew update
- brew outdated caskroom/cask/brew-cask || brew upgrade caskroom/cask/brew-cask
- brew tap caskroom/versions
- sudo rm -rf /Library/Java/JavaVirtualMachines
- brew cask install caskroom/versions/java7
- brew install nvm
- source $(brew --prefix nvm)/nvm.sh
- nvm install 4
- npm config delete prefix
- nvm use --delete-prefix v4.4.7 4
install:
- cd $MODULE_ROOT
- curl -o install.sh https://raw.githubusercontent.com/appcelerator-modules/ci/master/travis/install.sh
- source install.sh -s "--branch 5_1_X"
script:
- curl -o script.sh https://raw.githubusercontent.com/appcelerator-modules/ci/master/travis/script.sh
- curl -o install.sh https://raw.githubusercontent.com/sgtcoolguy/ci/v8/travis/install.sh
- source install.sh -s "--branch master"
script:
- curl -o script.sh https://raw.githubusercontent.com/sgtcoolguy/ci/v8/travis/script.sh
- source script.sh
after_success: # and this only on success
- curl -o deploy.sh https://raw.githubusercontent.com/appcelerator-modules/ci/master/travis/deploy.sh
Expand Down
10 changes: 5 additions & 5 deletions android/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 2.0.2
apiversion: 2
architectures: armeabi armeabi-v7a x86
version: 3.0.0
apiversion: 3
architectures: armeabi-v7a x86
description: This module provides access to various encryption and decryption algorithms, and string encodings.
author: Dawson Toth
license: Appcelerator Commercial License
copyright: Copyright (c) 2010-2013 by Appcelerator, Inc.
copyright: Copyright (c) 2010-2016 by Appcelerator, Inc.


# these should not be edited
name: crypto
moduleid: ti.crypto
guid: 5041eaca-a895-4229-a44b-de2f582c9133
platform: android
minsdk: 5.0.0
minsdk: 6.0.0
8 changes: 4 additions & 4 deletions android/src/ti/crypto/CryptoModule.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Ti.Crypto Module
* Copyright (c) 2010-2013 by Appcelerator, Inc. All Rights Reserved.
* Copyright (c) 2010-2016 by Appcelerator, Inc. All Rights Reserved.
* Please see the LICENSE included with this distribution for details.
*/

Expand All @@ -15,7 +15,7 @@
import org.appcelerator.titanium.TiBlob;
import ti.crypto.utility.Hex;
import ti.modules.titanium.BufferProxy;
import org.apache.commons.codec.binary.Base64;
import android.util.Base64;
import org.appcelerator.kroll.common.Log;

@Kroll.module(name = "Crypto", id = "ti.crypto")
Expand Down Expand Up @@ -56,7 +56,7 @@ public int encodeData(@SuppressWarnings("rawtypes") HashMap args) {
String raw = (String) source;
// The astute among you may notice that I am calling "decodeBase64" in the "encodeData" method.
// This is deliberate. "encodeData" takes formatted strings and turns them in to data.
data = raw.length() > 0 ? Base64.decodeBase64(raw.getBytes()) : new byte[0];
data = raw.length() > 0 ? Base64.decode(raw.getBytes(), Base64.NO_WRAP) : new byte[0];
} catch (Exception e) {
e.printStackTrace();
data = new byte[0];
Expand Down Expand Up @@ -105,7 +105,7 @@ public String decodeData(@SuppressWarnings("rawtypes") HashMap args) {
if (type.equals(TYPE_BASE64STRING)) {
// The astute among you may notice that I am calling "encodeBase64" in the "decodeData" method.
// This is deliberate. "decodeData" takes data and turns it in to formatted strings.
result = new String(Base64.encodeBase64(source.getBuffer()));
result = new String(Base64.encode(source.getBuffer(), Base64.NO_WRAP));
} else if (type.equals(TYPE_HEXSTRING)) {
result = Hex.convertToHex(source.getBuffer());
} else {
Expand Down