├── .gitignore
├── .gitmodules
├── LICENSE
├── android
├── bcx
│ ├── .gitignore
│ ├── .idea
│ │ ├── encodings.xml
│ │ ├── gradle.xml
│ │ ├── misc.xml
│ │ ├── runConfigurations.xml
│ │ └── vcs.xml
│ ├── .project
│ ├── .settings
│ │ └── org.eclipse.buildship.core.prefs
│ ├── app
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ ├── androidTest
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── sdkbox
│ │ │ │ └── test
│ │ │ │ └── bcx
│ │ │ │ └── ExampleInstrumentedTest.java
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── sdkbox
│ │ │ │ │ └── test
│ │ │ │ │ └── bcx
│ │ │ │ │ └── MainActivity.java
│ │ │ └── res
│ │ │ │ ├── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ │ ├── drawable
│ │ │ │ └── ic_launcher_background.xml
│ │ │ │ ├── layout
│ │ │ │ └── activity_main.xml
│ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ └── values
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── sdkbox
│ │ │ └── test
│ │ │ └── bcx
│ │ │ └── ExampleUnitTest.java
│ ├── bcxbridge
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── deps
│ │ │ └── unityplayer.jar
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ ├── androidTest
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── cocos
│ │ │ │ └── bcx_sdk
│ │ │ │ └── unity
│ │ │ │ └── bridge
│ │ │ │ └── ExampleInstrumentedTest.java
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── cocos
│ │ │ │ │ └── bcx_sdk
│ │ │ │ │ └── unity
│ │ │ │ │ └── bridge
│ │ │ │ │ └── Bridge.java
│ │ │ └── res
│ │ │ │ └── values
│ │ │ │ └── strings.xml
│ │ │ └── test
│ │ │ └── java
│ │ │ └── com
│ │ │ └── cocos
│ │ │ └── bcx_sdk
│ │ │ └── unity
│ │ │ └── bridge
│ │ │ └── ExampleUnitTest.java
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
└── genBridgeLibAndSync.sh
├── ios
└── genBridgeLibAndSync.sh
├── readme.md
├── readme_cn.md
├── tool
└── genLibAndSync.sh
└── unity
└── bcx
├── .gitignore
├── Assets
├── BCX.meta
├── BCX
│ ├── BCX.prefab
│ ├── BCX.prefab.meta
│ ├── BCXAndroidReceiver.cs
│ ├── BCXAndroidReceiver.cs.meta
│ ├── BCXWrapper.cs
│ ├── BCXWrapper.cs.meta
│ ├── BCXWrapperAndroid.cs
│ ├── BCXWrapperAndroid.cs.meta
│ ├── BCXWrapperBase.cs
│ ├── BCXWrapperBase.cs.meta
│ ├── BCXWrapperDummy.cs
│ ├── BCXWrapperDummy.cs.meta
│ ├── BCXWrapperIOS.cs
│ ├── BCXWrapperIOS.cs.meta
│ ├── Document.meta
│ ├── Document
│ │ ├── android_export_setting.png
│ │ ├── android_export_setting.png.meta
│ │ ├── readme.md
│ │ ├── readme.md.meta
│ │ ├── versions.md
│ │ ├── versions.md.meta
│ │ ├── xcode_secp_target_setting.png
│ │ └── xcode_secp_target_setting.png.meta
│ ├── Editor.meta
│ ├── Editor
│ │ ├── ExtractTarGz.cs
│ │ ├── ExtractTarGz.cs.meta
│ │ ├── ProjectFileHook.cs
│ │ ├── ProjectFileHook.cs.meta
│ │ ├── Utils.cs
│ │ ├── Utils.cs.meta
│ │ ├── iOS.meta
│ │ └── iOS
│ │ │ ├── BCXUnitySDK.tar.gz
│ │ │ └── BCXUnitySDK.tar.gz.meta
│ ├── Plugins.meta
│ ├── Plugins
│ │ ├── Android.meta
│ │ ├── Android
│ │ │ ├── bcx_sdk.aar
│ │ │ ├── bcx_sdk.aar.meta
│ │ │ ├── bcxbridge.aar
│ │ │ └── bcxbridge.aar.meta
│ │ └── iOS.meta
│ ├── Sample.meta
│ ├── Sample
│ │ ├── BCXTest.cs
│ │ ├── BCXTest.cs.meta
│ │ ├── SampleScene.unity
│ │ └── SampleScene.unity.meta
│ ├── UnityMainThreadDispatcher.cs
│ └── UnityMainThreadDispatcher.cs.meta
├── JSON.meta
├── JSON
│ ├── Editor.meta
│ ├── Editor
│ │ ├── JSONChecker.cs
│ │ └── JSONChecker.cs.meta
│ ├── JSONObject.cs
│ ├── JSONObject.cs.meta
│ ├── LICENSE.md
│ ├── LICENSE.md.meta
│ ├── VectorTemplates.cs
│ ├── VectorTemplates.cs.meta
│ ├── readme.txt
│ └── readme.txt.meta
├── Plugins.meta
└── Plugins
│ ├── Android.meta
│ └── Android
│ ├── mainTemplate.gradle
│ └── mainTemplate.gradle.meta
├── Packages
└── manifest.json
└── ProjectSettings
├── AudioManager.asset
├── ClusterInputManager.asset
├── DynamicsManager.asset
├── EditorBuildSettings.asset
├── EditorSettings.asset
├── GraphicsSettings.asset
├── InputManager.asset
├── NavMeshAreas.asset
├── NetworkManager.asset
├── Physics2DSettings.asset
├── PresetManager.asset
├── ProjectSettings.asset
├── ProjectVersion.txt
├── QualitySettings.asset
├── TagManager.asset
├── TimeManager.asset
└── UnityConnectSettings.asset
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | .DS_Store
3 |
4 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "android/AndroidSdk"]
2 | path = android/AndroidSdk
3 | url = https://github.com/hugohuang1111/bcx-android-sdk.git
4 | [submodule "ios/iOSSDK"]
5 | path = ios/iOSSDK
6 | url = https://github.com/hugohuang1111/bcx-ios-sdk.git
7 |
--------------------------------------------------------------------------------
/android/bcx/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 |
--------------------------------------------------------------------------------
/android/bcx/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/android/bcx/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
14 |
15 |
--------------------------------------------------------------------------------
/android/bcx/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/android/bcx/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/bcx/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/android/bcx/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | bcx
4 | Project bcx created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.buildship.core.gradleprojectbuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/android/bcx/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | connection.project.dir=
2 | eclipse.preferences.version=1
3 |
--------------------------------------------------------------------------------
/android/bcx/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/android/bcx/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 28
5 | defaultConfig {
6 | applicationId "com.sdkbox.test.bcx"
7 | minSdkVersion 14
8 | targetSdkVersion 28
9 | versionCode 1
10 | versionName "1.0"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation fileTree(dir: 'libs', include: ['*.jar'])
23 | implementation 'com.android.support:appcompat-v7:28.0.0'
24 | implementation 'com.android.support.constraint:constraint-layout:1.1.3'
25 | testImplementation 'junit:junit:4.12'
26 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
27 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
28 | implementation project(path: ':bcxbridge')
29 | }
30 |
--------------------------------------------------------------------------------
/android/bcx/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/android/bcx/app/src/androidTest/java/com/sdkbox/test/bcx/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.sdkbox.test.bcx;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.sdkbox.test.bcx", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/android/bcx/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/android/bcx/app/src/main/java/com/sdkbox/test/bcx/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.sdkbox.test.bcx;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | import com.cocos.bcx_sdk.unity.bridge.Bridge;
7 |
8 | import java.util.Arrays;
9 | import java.util.List;
10 |
11 | public class MainActivity extends AppCompatActivity {
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | setContentView(R.layout.activity_main);
17 |
18 | List mListNode = Arrays.asList("ws://39.106.126.54:8049", "ws://39.106.126.54:8049");
19 | String faucetUrl = "http://47.93.62.96:8041";
20 | String chainId = "7d89b84f22af0b150780a2b121aa6c715b19261c8b7fe0fda3a564574ed7d3e9";
21 | String coreAsset = "COCOS";
22 | boolean isOpenLog = true;
23 | Bridge.connect(chainId, mListNode, faucetUrl, coreAsset, isOpenLog, this);
24 |
25 | // Bridge.reflectionCall("{\"p\":[\"hugo\",\"111111\"],\"f\":\"password_login\"}");
26 | Bridge.reflectionCall("{\"p\":[[\"string1\",\"string2\"]],\"f\":\"lookup_nh_asset\"}");
27 | // Bridge.reflectionCall("{\"f\":\"get_version_info\"}");
28 | // Bridge.reflectionCall("{\"f\":\"log_out\"}");
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
10 |
12 |
14 |
16 |
18 |
20 |
22 |
24 |
26 |
28 |
30 |
32 |
34 |
36 |
38 |
40 |
42 |
44 |
46 |
48 |
50 |
52 |
54 |
56 |
58 |
60 |
62 |
64 |
66 |
68 |
70 |
72 |
74 |
75 |
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
18 |
19 |
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cocos-BCX/UnitySDK/314c6b1f66bc7b43fbb887f540aafd3dea51eace/android/bcx/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cocos-BCX/UnitySDK/314c6b1f66bc7b43fbb887f540aafd3dea51eace/android/bcx/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cocos-BCX/UnitySDK/314c6b1f66bc7b43fbb887f540aafd3dea51eace/android/bcx/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cocos-BCX/UnitySDK/314c6b1f66bc7b43fbb887f540aafd3dea51eace/android/bcx/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cocos-BCX/UnitySDK/314c6b1f66bc7b43fbb887f540aafd3dea51eace/android/bcx/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cocos-BCX/UnitySDK/314c6b1f66bc7b43fbb887f540aafd3dea51eace/android/bcx/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cocos-BCX/UnitySDK/314c6b1f66bc7b43fbb887f540aafd3dea51eace/android/bcx/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cocos-BCX/UnitySDK/314c6b1f66bc7b43fbb887f540aafd3dea51eace/android/bcx/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cocos-BCX/UnitySDK/314c6b1f66bc7b43fbb887f540aafd3dea51eace/android/bcx/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cocos-BCX/UnitySDK/314c6b1f66bc7b43fbb887f540aafd3dea51eace/android/bcx/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | BCX
3 |
4 |
--------------------------------------------------------------------------------
/android/bcx/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/bcx/app/src/test/java/com/sdkbox/test/bcx/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.sdkbox.test.bcx;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/android/bcx/bcxbridge/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /libs
3 | /deps
4 |
--------------------------------------------------------------------------------
/android/bcx/bcxbridge/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 28
5 |
6 |
7 | defaultConfig {
8 | minSdkVersion 14
9 | targetSdkVersion 28
10 | versionCode 1
11 | versionName "1.0"
12 |
13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 |
15 | }
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 |
24 | }
25 |
26 | dependencies {
27 | compileOnly files('deps/unityplayer.jar')
28 | compileOnly files('deps/bcx_sdk.aar')
29 |
30 | implementation 'com.android.support:appcompat-v7:28.0.0'
31 | testImplementation 'junit:junit:4.12'
32 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
33 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
34 |
35 | // implenment websocket
36 | implementation 'com.neovisionaries:nv-websocket-client:1.30'
37 | // implenment bitcoinj
38 | implementation 'org.bitcoinj:bitcoinj-core:0.14.7'
39 | implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
40 | implementation group: "org.tukaani", name: "xz", version: "1.6"
41 | implementation 'com.squareup.okhttp3:okhttp:3.12.1'
42 | // spongycastle
43 | implementation 'com.madgag.spongycastle:core:1.58.0.0'
44 | implementation 'com.madgag.spongycastle:prov:1.58.0.0'
45 | implementation 'com.madgag.spongycastle:pkix:1.54.0.0'
46 | implementation 'com.madgag.spongycastle:pg:1.54.0.0'
47 | // fasterxml
48 | implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.7'
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/android/bcx/bcxbridge/deps/unityplayer.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Cocos-BCX/UnitySDK/314c6b1f66bc7b43fbb887f540aafd3dea51eace/android/bcx/bcxbridge/deps/unityplayer.jar
--------------------------------------------------------------------------------
/android/bcx/bcxbridge/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/android/bcx/bcxbridge/src/androidTest/java/com/cocos/bcx_sdk/unity/bridge/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.cocos.bcx_sdk.unity.bridge;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.cocos.bcx_sdk.unity.bridge.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/android/bcx/bcxbridge/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/android/bcx/bcxbridge/src/main/java/com/cocos/bcx_sdk/unity/bridge/Bridge.java:
--------------------------------------------------------------------------------
1 | package com.cocos.bcx_sdk.unity.bridge;
2 |
3 | import android.app.Activity;
4 | import android.app.Application;
5 | import android.content.Context;
6 | import android.util.Log;
7 |
8 | import com.cocos.bcx_sdk.bcx_api.CocosBcxApiWrapper;
9 | import com.cocos.bcx_sdk.bcx_callback.IBcxCallBack;
10 | import com.cocos.bcx_sdk.bcx_entity.AccountType;
11 | import com.unity3d.player.UnityPlayer;
12 |
13 | import org.json.JSONArray;
14 | import org.json.JSONException;
15 | import org.json.JSONObject;
16 |
17 | import java.lang.reflect.Method;
18 | import java.lang.reflect.Type;
19 | import java.util.ArrayList;
20 | import java.util.Arrays;
21 | import java.util.List;
22 |
23 | public class Bridge {
24 |
25 | private static final String TAG = "BCXBridge";
26 | private static final String GAME_OBJECT = "BCX";
27 |
28 | private static String combineSuccessResult(String s) {
29 | return String.format("{\"code\":1,\"data\":\"%s\"}", s);
30 | }
31 |
32 | private static String combineErrorResult(String s) {
33 | return String.format("{\"code\":0,\"message\":\"%s\"}", s);
34 | }
35 |
36 | public static void reflectionCall(String json) {
37 | JSONObject obj = null;
38 | try {
39 | obj = new JSONObject(json);
40 | } catch (JSONException e) {
41 | Log.e(TAG, "parse json failed:" + e.toString());
42 | return;
43 | }
44 | final String f = obj.optString("f", "");
45 | JSONArray arr = obj.optJSONArray("p");
46 |
47 | if (null == f || 0 == f.length()) {
48 | Log.e(TAG, "f is null");
49 | return;
50 | }
51 |
52 | CocosBcxApiWrapper api = CocosBcxApiWrapper.getBcxInstance();
53 |
54 | Method m = null;
55 | for(Method method : api.getClass().getMethods()) {
56 | if (f.equalsIgnoreCase(method.getName())) {
57 | m = method;
58 |
59 | Class>[] paramTypes = m.getParameterTypes();
60 | //Type[] paramTypes1 = m.getGenericParameterTypes();
61 | Class> returnType = m.getReturnType();
62 | List