Skip to content

Commit

Permalink
[TIMOB-23595] Android: Recompile ti.crypto module against latest SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
sgtcoolguy committed Jul 11, 2016
1 parent a81edb1 commit d3ec2c5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 20 deletions.
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

0 comments on commit d3ec2c5

Please sign in to comment.