diff --git a/packages/ccc_fplugin/.gitignore b/packages/ccc_fplugin/.gitignore
new file mode 100644
index 0000000..6e18396
--- /dev/null
+++ b/packages/ccc_fplugin/.gitignore
@@ -0,0 +1,6 @@
+.dart_tool/
+.packages
+.pub/
+build/
+.idea/vcs.xml
+.DS_Store
diff --git a/packages/ccc_fplugin/.idea/encodings.xml b/packages/ccc_fplugin/.idea/encodings.xml
new file mode 100644
index 0000000..15a15b2
--- /dev/null
+++ b/packages/ccc_fplugin/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/packages/ccc_fplugin/.idea/libraries/Dart_SDK.xml b/packages/ccc_fplugin/.idea/libraries/Dart_SDK.xml
new file mode 100644
index 0000000..12c6d6b
--- /dev/null
+++ b/packages/ccc_fplugin/.idea/libraries/Dart_SDK.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/ccc_fplugin/.idea/libraries/Flutter_Plugins.xml b/packages/ccc_fplugin/.idea/libraries/Flutter_Plugins.xml
new file mode 100644
index 0000000..53449da
--- /dev/null
+++ b/packages/ccc_fplugin/.idea/libraries/Flutter_Plugins.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/ccc_fplugin/.idea/libraries/Flutter_for_Android.xml b/packages/ccc_fplugin/.idea/libraries/Flutter_for_Android.xml
new file mode 100644
index 0000000..0baf6bd
--- /dev/null
+++ b/packages/ccc_fplugin/.idea/libraries/Flutter_for_Android.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/packages/ccc_fplugin/.idea/misc.xml b/packages/ccc_fplugin/.idea/misc.xml
new file mode 100644
index 0000000..5c94cb2
--- /dev/null
+++ b/packages/ccc_fplugin/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/ccc_fplugin/.idea/modules.xml b/packages/ccc_fplugin/.idea/modules.xml
new file mode 100644
index 0000000..5f562eb
--- /dev/null
+++ b/packages/ccc_fplugin/.idea/modules.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/ccc_fplugin/.idea/runConfigurations/example_lib_main_dart.xml b/packages/ccc_fplugin/.idea/runConfigurations/example_lib_main_dart.xml
new file mode 100644
index 0000000..bac2c8a
--- /dev/null
+++ b/packages/ccc_fplugin/.idea/runConfigurations/example_lib_main_dart.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/ccc_fplugin/.idea/workspace.xml b/packages/ccc_fplugin/.idea/workspace.xml
new file mode 100644
index 0000000..d1fae2f
--- /dev/null
+++ b/packages/ccc_fplugin/.idea/workspace.xml
@@ -0,0 +1,217 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1557699660369
+
+
+ 1557699660369
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/ccc_fplugin/.metadata b/packages/ccc_fplugin/.metadata
new file mode 100644
index 0000000..2c8ec56
--- /dev/null
+++ b/packages/ccc_fplugin/.metadata
@@ -0,0 +1,10 @@
+# This file tracks properties of this Flutter project.
+# Used by Flutter tool to assess capabilities and perform upgrades etc.
+#
+# This file should be version controlled and should not be manually edited.
+
+version:
+ revision: 8661d8aecd626f7f57ccbcb735553edc05a2e713
+ channel: stable
+
+project_type: plugin
diff --git a/packages/ccc_fplugin/CHANGELOG.rst b/packages/ccc_fplugin/CHANGELOG.rst
new file mode 100644
index 0000000..2a6c60a
--- /dev/null
+++ b/packages/ccc_fplugin/CHANGELOG.rst
@@ -0,0 +1,3 @@
+Version
+-------
+* 0.0.1
diff --git a/packages/ccc_fplugin/LICENSE b/packages/ccc_fplugin/LICENSE
new file mode 100644
index 0000000..ba75c69
--- /dev/null
+++ b/packages/ccc_fplugin/LICENSE
@@ -0,0 +1 @@
+TODO: Add your license here.
diff --git a/packages/ccc_fplugin/README.rst b/packages/ccc_fplugin/README.rst
new file mode 100644
index 0000000..d20df17
--- /dev/null
+++ b/packages/ccc_fplugin/README.rst
@@ -0,0 +1,4 @@
+==================================
+Copius Cipher Chain Flutter Plugin
+==================================
+
diff --git a/packages/ccc_fplugin/android/.gitignore b/packages/ccc_fplugin/android/.gitignore
new file mode 100644
index 0000000..c6cbe56
--- /dev/null
+++ b/packages/ccc_fplugin/android/.gitignore
@@ -0,0 +1,8 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
diff --git a/packages/ccc_fplugin/android/build.gradle b/packages/ccc_fplugin/android/build.gradle
new file mode 100644
index 0000000..34e76ab
--- /dev/null
+++ b/packages/ccc_fplugin/android/build.gradle
@@ -0,0 +1,43 @@
+group 'io.malloc.ccc.ccc_fplugin'
+version '1.0-SNAPSHOT'
+
+buildscript {
+ repositories {
+ mavenLocal()
+ google()
+ jcenter()
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.2.1'
+ }
+}
+
+rootProject.allprojects {
+ repositories {
+ mavenLocal()
+ google()
+ jcenter()
+ }
+}
+
+apply plugin: 'com.android.library'
+android {
+ compileSdkVersion 28
+
+ defaultConfig {
+ minSdkVersion 23
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ lintOptions {
+ disable 'InvalidPackage'
+ }
+}
+
+dependencies {
+// implementation 'io.malloc.ccc:nc-jni:1.1@aar'
+ // yay, we can pull wolfssl-jni.aar into our project!!
+ implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
+ // doesn't work because google flutter team cascaded embedded spaghetti gradle dependencies
+ // implementation project(":nc-lib")
+}
\ No newline at end of file
diff --git a/packages/ccc_fplugin/android/gradle.properties b/packages/ccc_fplugin/android/gradle.properties
new file mode 100644
index 0000000..94adc3a
--- /dev/null
+++ b/packages/ccc_fplugin/android/gradle.properties
@@ -0,0 +1,3 @@
+org.gradle.jvmargs=-Xmx1536M
+android.useAndroidX=true
+android.enableJetifier=true
diff --git a/packages/ccc_fplugin/android/libs/wolfssl-jni.aar b/packages/ccc_fplugin/android/libs/wolfssl-jni.aar
new file mode 100644
index 0000000..67774fd
Binary files /dev/null and b/packages/ccc_fplugin/android/libs/wolfssl-jni.aar differ
diff --git a/packages/ccc_fplugin/android/settings.gradle b/packages/ccc_fplugin/android/settings.gradle
new file mode 100644
index 0000000..bbbf06d
--- /dev/null
+++ b/packages/ccc_fplugin/android/settings.gradle
@@ -0,0 +1,2 @@
+rootProject.name = 'ccc_fplugin'
+// include ':nc-lib'
diff --git a/packages/ccc_fplugin/android/src/main/AndroidManifest.xml b/packages/ccc_fplugin/android/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..c1dacb5
--- /dev/null
+++ b/packages/ccc_fplugin/android/src/main/AndroidManifest.xml
@@ -0,0 +1,3 @@
+
+
diff --git a/packages/ccc_fplugin/android/src/main/java/io/malloc/ccc/cc/AesCipher.java b/packages/ccc_fplugin/android/src/main/java/io/malloc/ccc/cc/AesCipher.java
new file mode 100644
index 0000000..8aca996
--- /dev/null
+++ b/packages/ccc_fplugin/android/src/main/java/io/malloc/ccc/cc/AesCipher.java
@@ -0,0 +1,108 @@
+package io.malloc.ccc.cc;
+
+import com.wolfssl.wolfcrypt.Aes;
+import io.malloc.ccc.nc.Util;
+
+
+public class AesCipher implements ICipher {
+
+ final int PADDING_SIZE = 16;
+
+ private Aes aes;
+ private byte[] iv;
+ private byte[] key;
+ private boolean isEnc;
+
+
+ public AesCipher(byte[] key, byte[] iv, boolean isEnc) throws NastySizeException {
+ init(key, iv, isEnc);
+ }
+
+ @Override
+ public void init(byte[] key, byte[] iv, boolean isEnc) throws NastySizeException {
+ checkSizes(key.length, iv.length);
+ this.iv = iv;
+ this.key = key;
+ this.isEnc = isEnc;
+ if(isEnc) {
+ System.out.println("Aes.ENCRYPT_MODE");
+ aes = new Aes(key, iv, Aes.ENCRYPT_MODE);
+// aes.setKey(iv, key, Aes.ENCRYPT_MODE);
+ }
+ else {
+ System.out.println("Aes.DECRYPT_MODE");
+ aes = new Aes(key, iv, Aes.DECRYPT_MODE);
+// aes.setKey(iv, key, Aes.DECRYPT_MODE);
+ }
+ System.out.println("iv=="+Util.b2h(iv));
+ System.out.println("key=="+Util.b2h(key));
+ }
+
+ @Override
+ public byte[] enc(byte[] data) throws NotPayingAttentionException {
+ byte[] result;
+ System.out.println("data=="+Util.b2h(data));
+ if(isEnc) {
+ byte[] newData = padData(data);
+ System.out.println("newData=="+Util.b2h(newData));
+ result = aes.update(newData, 0, newData.length);
+ System.out.println("result=="+Util.b2h(result));
+ }
+ else {
+ throw new NotPayingAttentionException("you are encrypting while in decrypting mode");
+ }
+ return result;
+ }
+
+ @Override
+ public byte[] dec(byte[] data) throws NotPayingAttentionException {
+ byte[] result;
+ if(data.length % 16 != 0)
+ throw new NotPayingAttentionException("data is not multiple of 16 bytes");
+ if(!isEnc) {
+ result = aes.update(data, 0, data.length);
+ System.out.println("dec() result=="+Util.b2h(result)+"; length=="+result.length);
+ result = unPadData(result);
+ System.out.println("dec() result=="+Util.b2h(result)+"; length=="+result.length);
+ }
+ else {
+ throw new NotPayingAttentionException("you are decrypting while in encrypting mode");
+ }
+ return result;
+ }
+
+ public void destroy() {
+ aes.releaseNativeStruct();
+ }
+
+ private void checkSizes(int keyLen, int ivLen) throws NastySizeException {
+ if (keyLen != 16 && keyLen != 24 && keyLen != 32)
+ throw new NastySizeException("Key isn't 16, 24, 32 bytes; length is "+keyLen+" bytes");
+ if (ivLen != 16 && ivLen != 24 && ivLen != 32)
+ throw new NastySizeException("IV isn't 16 bytes; IV is "+ivLen+" bytes");
+ }
+
+ private byte[] padData(byte[] data) {
+ int remainder = data.length % PADDING_SIZE;
+ System.out.println("[J3G] data.length % 16 == "+remainder);
+ if(remainder != 0) {
+ remainder = PADDING_SIZE - remainder;
+ byte[] newData = new byte[data.length+remainder+PADDING_SIZE];
+ System.arraycopy(data, 0, newData, 0, data.length);
+ for(int i=data.length; i>> 4];
+ hexChars[j * 2 + 1] = hexArray[v & 0x0F];
+ }
+
+ return new String(hexChars);
+ }
+}
diff --git a/packages/ccc_fplugin/ccc_fplugin.iml b/packages/ccc_fplugin/ccc_fplugin.iml
new file mode 100644
index 0000000..73e7ebd
--- /dev/null
+++ b/packages/ccc_fplugin/ccc_fplugin.iml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/ccc_fplugin/docs/build_mavenLocal.gradle b/packages/ccc_fplugin/docs/build_mavenLocal.gradle
new file mode 100644
index 0000000..84c3b66
--- /dev/null
+++ b/packages/ccc_fplugin/docs/build_mavenLocal.gradle
@@ -0,0 +1,161 @@
+group 'com.companyname.artifactname'
+version '1.0-SNAPSHOT'
+
+//////////////////////////////////////////////////////////////////////////////
+// THIS goes in the root build.gradle
+//
+buildscript {
+ repositories {
+ // put first to pull here first
+ mavenLocal()
+ google()
+ jcenter()
+ maven {
+ url "https://maven.google.com" // Google's Maven repository
+ }
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.0.1'
+ }
+}
+allprojects {
+ repositories {
+ // put first to pull here first
+ mavenLocal()
+ google()
+ jcenter()
+ maven {
+ url "https://maven.google.com" // Google's Maven repository
+ }
+ }
+}
+
+//
+// END
+//////////////////////////////////////////////////////////////////////////////
+
+
+//////////////////////////////////////////////////////////////////////////////
+// THIS goes in APP specific build.gradle
+//
+apply plugin: 'com.android.library'
+android {
+ compileSdkVersion 28
+ buildToolsVersion '28.0.3'
+
+ defaultConfig {
+ minSdkVersion 23
+ targetSdkVersion 28
+ versionCode 1
+ versionName "1.1"
+ }
+ lintOptions {
+ abortOnError false
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+ dependencies {
+ compile 'com.android.support:appcompat-v7:23.2.1'
+ compile 'com.android.support:support-v4:23.2.1'
+ }
+}
+
+dependencies {
+ // pull in everything from ./libs folder
+ compile fileTree(include: ['*.jar'], dir: 'libs')
+}
+
+
+//
+// This is the SIMPLE method to publish locally
+//
+apply plugin: 'maven-publish'
+project.afterEvaluate {
+ publishing {
+ publications {
+ library(MavenPublication) {
+ groupId 'io.malloc.ccc'
+ artifactId 'nc-jni'
+ version "1.1"
+ artifact(bundleReleaseAar)
+ }
+ }
+ }
+}
+// more complicated example (gen the XML explicitly)
+project.afterEvaluate {
+ publishing {
+ publications {
+ mavenDebugAAR(MavenPublication) {
+ artifact bundleDebugAar
+
+ pom.withXml {
+ def dependenciesNode = asNode().appendNode('dependencies')
+ configurations.api.allDependencies.each { ModuleDependency dp ->
+ def dependencyNode = dependenciesNode.appendNode('dependency')
+ dependencyNode.appendNode('groupId', dp.group)
+ dependencyNode.appendNode('artifactId', dp.name)
+ dependencyNode.appendNode('version', dp.version)
+
+ if (dp.excludeRules.size() > 0) {
+ def exclusions = dependencyNode.appendNode('exclusions')
+ dp.excludeRules.each { ExcludeRule ex ->
+ def exclusion = exclusions.appendNode('exclusion')
+ exclusion.appendNode('groupId', ex.group)
+ exclusion.appendNode('artifactId', ex.module)
+ }
+ }
+ }
+ }
+ }
+
+ mavenReleaseAAR(MavenPublication) {
+ artifact bundleReleaseAar
+
+ pom.withXml {
+ def dependenciesNode = asNode().appendNode('dependencies')
+ configurations.api.allDependencies.each { ModuleDependency dp ->
+ def dependencyNode = dependenciesNode.appendNode('dependency')
+ dependencyNode.appendNode('groupId', dp.group)
+ dependencyNode.appendNode('artifactId', dp.name)
+ dependencyNode.appendNode('version', dp.version)
+
+ if (dp.excludeRules.size() > 0) {
+ def exclusions = dependencyNode.appendNode('exclusions')
+ dp.excludeRules.each { ExcludeRule ex ->
+ def exclusion = exclusions.appendNode('exclusion')
+ exclusion.appendNode('groupId', ex.group)
+ exclusion.appendNode('artifactId', ex.module)
+ }
+ }
+ }
+ }
+ }
+ }
+
+ repositories {
+
+ maven {
+ name 'nexusSnapshot'
+ credentials {
+ username ''
+ password ''
+ }
+ url ''
+ }
+
+ maven {
+ name 'nexusRelease'
+ credentials {
+ username ''
+ password ''
+ }
+ url ''
+ }
+ }
+ }
\ No newline at end of file
diff --git a/packages/ccc_fplugin/docs/dev_flutter_ffi.rst b/packages/ccc_fplugin/docs/dev_flutter_ffi.rst
new file mode 100644
index 0000000..98933b3
--- /dev/null
+++ b/packages/ccc_fplugin/docs/dev_flutter_ffi.rst
@@ -0,0 +1,12 @@
+===========
+Flutter ffi
+===========
+
+
+dart:ffi
+--------
+* SQLite mini tutorial
+ - foreign function interface "dart:ffi"
+ - invokes C functions from navive SQLite library
+ - https://github.com/dart-lang/sdk/blob/master/samples/ffi/sqlite/docs/sqlite-tutorial.md
+
diff --git a/packages/ccc_fplugin/docs/dev_flutter_plugin.rst b/packages/ccc_fplugin/docs/dev_flutter_plugin.rst
new file mode 100644
index 0000000..3956178
--- /dev/null
+++ b/packages/ccc_fplugin/docs/dev_flutter_plugin.rst
@@ -0,0 +1,98 @@
+=====================
+Create Flutter Plugin
+=====================
+
+* https://flutter.dev/docs/development/platform-integration/platform-channels#codec
+
+From flutter.dev:
+ **"some specific steps are needed to ensure a smooth experience"**
+
+
+SOURCE CODE
+===========
+
+Plugin Implementation
+---------------------
+
+
+
+
+
+Init Project
+------------
+
+Generate Project:
+::
+
+ # generate flutter plugin project
+ $ flutter create --org io.malloc.ccc --template=plugin ccipherchain
+
+ # generate with kotlin and swift support
+ $ flutter create --org io.malloc.ccc --template=plugin -i swift -a kotline ccipherchain
+
+
+
+ DART plugin code is in: ccc_fplugin/lib/ccc_fplugin.dart
+ JAVA plugin code is in: android/
+ iOS plugin code is in: ios/
+
+ EXAMPLE code is in: ccc_fplugin/example/lib/main.dart
+ $ cd ccc_fplugin/example
+ $ flutter run
+
+
+
+Open Android Java Project to edit:
+ * **OPEN: ./example/android/build.gradle file in Android Studio**
+ * to edit platform code in an IDE see https://flutter.io/developing-packages/#edit-plugin-package.
+
+
+
+Notes
+=====
+
+WEB Info
+--------
+* FLUTTER
+ - https://flutter.dev/docs/development/packages-and-plugins/developing-packages
+* Good Example
+ - https://medium.com/flutter-io/writing-a-good-flutter-plugin-1a561b986c9c
+* How to Open Android Source Code Plugin Lib Inside Flutter Project
+ - https://github.com/flutter/flutter/issues/19830
+
+
+
+ISSUES
+======
+
+
+edit ./android && ./example/android
+-----------------------------------
+
+**OPEN: ./example/android/build.gradle file in Android Studio**
+
+the gradle file there also includes the flutter plugin project, which
+will also cascade to include the android project, etc...VERY convoluted!!
+BASTARDS!!
+
+* Flutter Trouble Tickets
+ - https://github.com/flutter/flutter/issues/19830
+ - https://github.com/flutter/flutter/issues/11632
+ - https://github.com/flutter/flutter/issues/9698
+
+* --or-- add flutter.jar to the project
+ - j3g/apps/flutter/bin/cache/artifacts/engine/android-x64/flutter.jar
+
+
+
+MISC
+====
+::
+
+ Host platform code is in the "android" and "ios" directories under ccc_fplugin.
+ To edit platform code in an IDE see https://flutter.io/developing-packages/#edit-plugin-package.
+
+ ISSUE -->
+ android: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#step-2b-add-android-platform-code-javakt
+ ios: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#step-2c-add-ios-platform-code-hmswift
+
diff --git a/packages/ccc_fplugin/docs/dev_fplugin_bugs.rst b/packages/ccc_fplugin/docs/dev_fplugin_bugs.rst
new file mode 100644
index 0000000..b367054
--- /dev/null
+++ b/packages/ccc_fplugin/docs/dev_fplugin_bugs.rst
@@ -0,0 +1,69 @@
+===================
+Flutter Plugin Bugs
+===================
+
+
+.aar android library issues fsck'n flutter
+------------------------------------------
+
+Flutter has a lot of cascading gradle build files and they are using black magic to get things workings. For example
+it is difficult to code for the flutter plugin because of all the gradle build depedencies. You cannot use another
+gradle file in the android project that is part of the plugin. So either add the library in ./libs or add it to Maven...
+either Maven local or Maven remote.
+
+mavenLocal():
+ * ISSUES: with using gradle to add the nextcrypto library "wolfssl-jni.aar"
+ - FIX: use ./libs/ locally pulled in by "implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])"
+ - FIX: use mavenLocal() and store in ~.m2/... pull using "implementation 'io.malloc.ccc:nc-jni:1.1@aar'"
+
+ * Solution
+ - https://stackoverflow.com/questions/50971022/how-to-use-local-aar-inside-flutter-plugin
+
+ * No solutions
+ - https://stackoverflow.com/questions/55475576/add-plain-android-library-to-a-flutter-plugin
+ - https://stackoverflow.com/questions/55005818/how-do-i-add-library-module-dependency-to-a-flutter-plugins-android-folder-corr
+
+ * for examples see
+ - --> dev_maven.rst
+ - --> build_mavenLocal.gradle
+
+
+
+.aar library bugs after ./libs and mavenLocal()
+-----------------------------------------------
+
+It is interesting that it "merges" the AndroidManifest.xml files. I did some reading and I discovered
+that all the resources within the library (.aar) are public. Therefore collisions will happen. So the
+string property of "@string/app_name" was colliding because it was defined twice. So after removing all
+resources (./src/main/res/..) from the library project ("wolfssl-jni"), then removed all stuff within the
+libraries AndroidManifest.xml file too...because of the merging. So with all resources removed and the
+AndroidManifest.xml cleaned...there will be no collisions.
+
+::
+
+ > Task :app:processDebugManifest FAILED
+ /Volumes/malloc-dev/nextcrypto/source/nc-ww/app/ccc_fplugin/example/android/app/src/debug/AndroidManifest.xml:11:9-44 Error:
+ Attribute application@label value=(ccc_fplugin_example) from AndroidManifest.xml:11:9-44
+ is also present at [wolfssl-jni.aar] AndroidManifest.xml:13:9-41 value=(@string/app_name).
+ Suggestion: add 'tools:replace="android:label"' to element at AndroidManifest.xml:9:5-32:19 to override.
+ /Volumes/malloc-dev/nextcrypto/source/nc-ww/app/ccc_fplugin/example/android/app/src/debug/AndroidManifest.xml Error:
+ uses-sdk:minSdkVersion 16 cannot be smaller than version 23 declared in library [wolfssl-jni.aar] /Users/j3g/.gradle/caches/transforms-2/files-2.1/d60f1db6c5cf298a03f176d7f25dc8f6/AndroidManifest.xml as the library might be using APIs not available in 16
+ Suggestion: use a compatible library with a minSdk of at most 16,
+ or increase this project's minSdk version to at least 23,
+ or use tools:overrideLibrary="io.malloc.ccc" to force usage (may lead to runtime failures)
+
+ See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
+
+ 10 actionable tasks: 1 executed, 9 up-to-date
+ ERROR: Manifest merger failed with multiple errors, see logs
+
+ WARNING: API 'variantOutput.getProcessResources()' is obsolete and has been replaced with 'variantOutput.getProcessResourcesProvider()'.
+ It will be removed at the end of 2019.
+ For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
+ To determine what is calling variantOutput.getProcessResources(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
+ Affected Modules: app
+
+
+
+
+
diff --git a/packages/ccc_fplugin/docs/dev_maven.rst b/packages/ccc_fplugin/docs/dev_maven.rst
new file mode 100644
index 0000000..deffd0c
--- /dev/null
+++ b/packages/ccc_fplugin/docs/dev_maven.rst
@@ -0,0 +1,77 @@
+=====
+Maven
+=====
+
+* https://proandroiddev.com/tip-work-with-third-party-projects-locally-with-gradle-961d6c9efb02
+* https://android.jlelse.eu/android-local-libraries-with-maven-b7456d4268cf
+
+
+
+Maven Local (publishToMavenLocal)
+----------------------------------
+
+STEP 1:
+ * push to maven local
+ - ADD: "mavenLocal()" to --> root/main build.gradle
+ - make sure it is first in the list
+ - EXE: $ ./gradlew publishToMavenLocal
+
+STEP 2:
+ * pull from maven local
+ - ADD: "mavenLocal()" to build.gradle
+ - ADD: implementation 'com.companyname.artifactname:libraryname:1.1@aar'
+ - ADD: implementation 'io.malloc.ccc:nc-jni:1.1@aar'
+
+::
+
+ # push the .jar/.aar to ~/.m2/
+ $ gradle publishToMavenLocal
+
+
+
+ //
+ // this is root build.gradle
+ //
+
+ buildscript {
+ repositories {
+ mavenLocal()
+ }
+ }
+
+ allprojects {
+ repositories {
+ mavenLocal()
+ }
+ }
+
+
+
+ //
+ // this is app LIBRARY project build.gradle
+ //
+
+ // we are going to "publish" to local maven repository
+ apply plugin: 'maven-publish'
+ project.afterEvaluate {
+ publishing {
+ publications {
+ library(MavenPublication) {
+ groupId 'io.malloc.ccc'
+ artifactId 'nc-jni'
+ version "1.1"
+ artifact(bundleReleaseAar)
+ }
+ }
+ }
+ }
+
+
+
+ //
+ // this is app project build.gradle
+ //
+
+ implementation 'com.companyname.artifactname:libraryname:1.1@aar'
+ implementation 'io.malloc.ccc:nc-jni:1.1@aar'
+
diff --git a/packages/ccc_fplugin/ios/.gitignore b/packages/ccc_fplugin/ios/.gitignore
new file mode 100644
index 0000000..710ec6c
--- /dev/null
+++ b/packages/ccc_fplugin/ios/.gitignore
@@ -0,0 +1,36 @@
+.idea/
+.vagrant/
+.sconsign.dblite
+.svn/
+
+.DS_Store
+*.swp
+profile
+
+DerivedData/
+build/
+GeneratedPluginRegistrant.h
+GeneratedPluginRegistrant.m
+
+.generated/
+
+*.pbxuser
+*.mode1v3
+*.mode2v3
+*.perspectivev3
+
+!default.pbxuser
+!default.mode1v3
+!default.mode2v3
+!default.perspectivev3
+
+xcuserdata
+
+*.moved-aside
+
+*.pyc
+*sync/
+Icon?
+.tags*
+
+/Flutter/Generated.xcconfig
diff --git a/packages/ccc_fplugin/ios/Assets/.gitkeep b/packages/ccc_fplugin/ios/Assets/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/packages/ccc_fplugin/ios/Classes/CccFpluginPlugin.h b/packages/ccc_fplugin/ios/Classes/CccFpluginPlugin.h
new file mode 100644
index 0000000..32efb0c
--- /dev/null
+++ b/packages/ccc_fplugin/ios/Classes/CccFpluginPlugin.h
@@ -0,0 +1,4 @@
+#import
+
+@interface CccFpluginPlugin : NSObject
+@end
diff --git a/packages/ccc_fplugin/ios/Classes/CccFpluginPlugin.m b/packages/ccc_fplugin/ios/Classes/CccFpluginPlugin.m
new file mode 100644
index 0000000..7e6db90
--- /dev/null
+++ b/packages/ccc_fplugin/ios/Classes/CccFpluginPlugin.m
@@ -0,0 +1,20 @@
+#import "CccFpluginPlugin.h"
+
+@implementation CccFpluginPlugin
++ (void)registerWithRegistrar:(NSObject*)registrar {
+ FlutterMethodChannel* channel = [FlutterMethodChannel
+ methodChannelWithName:@"ccc_fplugin"
+ binaryMessenger:[registrar messenger]];
+ CccFpluginPlugin* instance = [[CccFpluginPlugin alloc] init];
+ [registrar addMethodCallDelegate:instance channel:channel];
+}
+
+- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
+ if ([@"getPlatformVersion" isEqualToString:call.method]) {
+ result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]);
+ } else {
+ result(FlutterMethodNotImplemented);
+ }
+}
+
+@end
diff --git a/packages/ccc_fplugin/ios/ccc_fplugin.podspec b/packages/ccc_fplugin/ios/ccc_fplugin.podspec
new file mode 100644
index 0000000..18a4c33
--- /dev/null
+++ b/packages/ccc_fplugin/ios/ccc_fplugin.podspec
@@ -0,0 +1,21 @@
+#
+# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
+#
+Pod::Spec.new do |s|
+ s.name = 'ccc_fplugin'
+ s.version = '0.0.1'
+ s.summary = 'A new flutter plugin project.'
+ s.description = <<-DESC
+A new flutter plugin project.
+ DESC
+ s.homepage = 'http://example.com'
+ s.license = { :file => '../LICENSE' }
+ s.author = { 'Your Company' => 'email@example.com' }
+ s.source = { :path => '.' }
+ s.source_files = 'Classes/**/*'
+ s.public_header_files = 'Classes/**/*.h'
+ s.dependency 'Flutter'
+
+ s.ios.deployment_target = '8.0'
+end
+
diff --git a/packages/ccc_fplugin/lib/ccc_fplugin.dart b/packages/ccc_fplugin/lib/ccc_fplugin.dart
new file mode 100644
index 0000000..d5a6863
--- /dev/null
+++ b/packages/ccc_fplugin/lib/ccc_fplugin.dart
@@ -0,0 +1,33 @@
+import 'dart:async';
+import 'dart:typed_data';
+import 'package:flutter/services.dart';
+
+
+class CccFplugin {
+ static const MethodChannel _channel = const MethodChannel('ccc_fplugin');
+
+ static Future get platformVersion async {
+ final String version = await _channel.invokeMethod('getPlatformVersion');
+ return version;
+ }
+
+ static Future aesTest() async {
+ await _channel.invokeMethod('aesTest');
+ }
+
+ static Future aesEnc(Uint8List iv, Uint8List key, String pText) async {
+ final Uint8List eData = await _channel.invokeMethod('aesEnc', {"iv":iv, "key":key, "pText":pText});
+ return eData;
+ }
+
+ static Future aesEncUint(Uint8List iv, Uint8List key, Uint8List pData) async {
+ final Uint8List eData = await _channel.invokeMethod('aesEncUint', {"iv":iv, "key":key, "pData":pData});
+ return eData;
+ }
+
+ static Future aesDec(Uint8List iv, Uint8List key, Uint8List cData) async {
+ final Uint8List pData = await _channel.invokeMethod('aesDec', {"iv":iv, "key":key, "cData":cData});
+ return pData;
+ }
+
+}
diff --git a/packages/ccc_fplugin/lib/crypto_mixin.dart b/packages/ccc_fplugin/lib/crypto_mixin.dart
new file mode 100644
index 0000000..f331255
--- /dev/null
+++ b/packages/ccc_fplugin/lib/crypto_mixin.dart
@@ -0,0 +1,71 @@
+import "dart:convert";
+import "dart:typed_data";
+
+const String _ALPHABET = "0123456789abcdef";
+
+/// An instance of the default implementation of the [HexCodec].
+const HEX = const HexCodec();
+
+/// A codec for encoding and decoding byte arrays to and from
+/// hexadecimal strings.
+class HexCodec extends Codec, String> {
+
+ const HexCodec();
+
+ @override
+ Converter, String> get encoder => const HexEncoder();
+
+ @override
+ Converter> get decoder => const HexDecoder();
+
+}
+
+/// A converter to encode byte arrays into hexadecimal strings.
+class HexEncoder extends Converter, String> {
+
+ /// If true, the encoder will encode into uppercase hexadecimal strings.
+ final bool upperCase;
+
+ const HexEncoder({this.upperCase: false});
+
+ @override
+ String convert(List bytes) {
+ StringBuffer buffer = new StringBuffer();
+ for (int part in bytes) {
+ if (part & 0xff != part) {
+ throw new FormatException("Non-byte integer detected");
+ }
+ buffer.write('${part < 16 ? '0' : ''}${part.toRadixString(16)}');
+ }
+ if(upperCase) {
+ return buffer.toString().toUpperCase();
+ } else {
+ return buffer.toString();
+ }
+ }
+}
+
+/// A converter to decode hexadecimal strings into byte arrays.
+class HexDecoder extends Converter> {
+
+ const HexDecoder();
+
+ @override
+ List convert(String hex) {
+ String str = hex.replaceAll(" ", "");
+ str = str.toLowerCase();
+ if(str.length % 2 != 0) {
+ str = "0" + str;
+ }
+ Uint8List result = new Uint8List(str.length ~/ 2);
+ for(int i = 0 ; i < result.length ; i++) {
+ int firstDigit = _ALPHABET.indexOf(str[i*2]);
+ int secondDigit = _ALPHABET.indexOf(str[i*2+1]);
+ if (firstDigit == -1 || secondDigit == -1) {
+ throw new FormatException("Non-hex character detected in $hex");
+ }
+ result[i] = (firstDigit << 4) + secondDigit;
+ }
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/packages/ccc_fplugin/pubspec.yaml b/packages/ccc_fplugin/pubspec.yaml
new file mode 100644
index 0000000..3199082
--- /dev/null
+++ b/packages/ccc_fplugin/pubspec.yaml
@@ -0,0 +1,21 @@
+name: ccc_fplugin
+description: Copius Cipher Chain Plugin
+version: 0.0.1
+author: cto@malloc.io
+homepage:
+
+environment:
+ sdk: ">=2.1.0 <3.0.0"
+
+dependencies:
+ flutter:
+ sdk: flutter
+
+dev_dependencies:
+ flutter_test:
+ sdk: flutter
+
+flutter:
+ plugin:
+ androidPackage: io.malloc.ccc.ccc_fplugin
+ pluginClass: CccFpluginPlugin
diff --git a/packages/ccc_fplugin/test/ccc_fplugin_test.dart b/packages/ccc_fplugin/test/ccc_fplugin_test.dart
new file mode 100644
index 0000000..275c9ac
--- /dev/null
+++ b/packages/ccc_fplugin/test/ccc_fplugin_test.dart
@@ -0,0 +1,21 @@
+import 'package:flutter/services.dart';
+import 'package:flutter_test/flutter_test.dart';
+import 'package:ccc_fplugin/ccc_fplugin.dart';
+
+void main() {
+ const MethodChannel channel = MethodChannel('ccc_fplugin');
+
+ setUp(() {
+ channel.setMockMethodCallHandler((MethodCall methodCall) async {
+ return '42';
+ });
+ });
+
+ tearDown(() {
+ channel.setMockMethodCallHandler(null);
+ });
+
+ test('getPlatformVersion', () async {
+ expect(await CccFplugin.platformVersion, '42');
+ });
+}