Browse Source

初始化项目

#Suyghur 3 years ago
parent
commit
17d7dac55c
45 changed files with 1154 additions and 0 deletions
  1. 50 0
      build.gradle
  2. 1 0
      demo/.gitignore
  3. 72 0
      demo/build.gradle
  4. 21 0
      demo/proguard-rules.pro
  5. 40 0
      demo/src/main/AndroidManifest.xml
  6. 84 0
      demo/src/main/java/com/yyxx/columbus/demo/DemoActivity.kt
  7. 19 0
      demo/src/main/java/com/yyxx/columbus/demo/DemoApplication.kt
  8. 7 0
      demo/src/main/java/com/yyxx/columbus/demo/Item.kt
  9. 83 0
      demo/src/main/java/com/yyxx/columbus/demo/WelcomeActivity.kt
  10. BIN
      demo/src/main/res/drawable-xhdpi/yyxx_welcome.png
  11. BIN
      demo/src/main/res/mipmap-xhdpi/ic_launcher.png
  12. 10 0
      demo/src/main/res/values/colors.xml
  13. 13 0
      demo/src/main/res/values/strings.xml
  14. 5 0
      demo/src/main/res/values/styles.xml
  15. 21 0
      gradle.properties
  16. BIN
      gradle/wrapper/gradle-wrapper.jar
  17. 6 0
      gradle/wrapper/gradle-wrapper.properties
  18. 172 0
      gradlew
  19. 84 0
      gradlew.bat
  20. 5 0
      keystore.properties
  21. 1 0
      library_base/.gitignore
  22. 56 0
      library_base/build.gradle
  23. 21 0
      library_base/proguard-rules.pro
  24. 5 0
      library_base/src/main/AndroidManifest.xml
  25. 35 0
      library_base/src/main/java/cn/yyxx/columbus/base/Columbus.kt
  26. 19 0
      library_base/src/main/java/cn/yyxx/columbus/base/ColumbusApplication.kt
  27. 36 0
      library_base/src/main/java/cn/yyxx/columbus/base/entity/Function.kt
  28. 90 0
      library_base/src/main/java/cn/yyxx/columbus/base/utils/Logger.kt
  29. 2 0
      library_core/.gitignore
  30. 49 0
      library_core/CMakeLists.txt
  31. 67 0
      library_core/build.gradle
  32. 21 0
      library_core/proguard-rules.pro
  33. 5 0
      library_core/src/main/AndroidManifest.xml
  34. 22 0
      library_core/src/main/cpp/columbus.cpp
  35. 11 0
      library_core/src/main/java/cn/yyxx/columbus/Version.kt
  36. 8 0
      library_core/src/main/java/cn/yyxx/columbus/core/SdkBridge.kt
  37. 8 0
      library_core/src/main/java/cn/yyxx/columbus/core/SdkDrive.kt
  38. BIN
      library_core/src/main/jniLibs/arm64-v8a/libdolin-zap.so
  39. BIN
      library_core/src/main/jniLibs/armeabi-v7a/libdolin-zap.so
  40. BIN
      library_core/src/main/jniLibs/x86/libdolin-zap.so
  41. BIN
      library_core/src/main/jniLibs/x86_64/libdolin-zap.so
  42. BIN
      libs/dolin_zap_1.0.0.jar
  43. BIN
      libs/yyxx_support_1.0.1.jar
  44. 5 0
      settings.gradle
  45. BIN
      zkeystore/demo_yyxx.keystore

+ 50 - 0
build.gradle

@@ -0,0 +1,50 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+
+    // 混淆开关
+    ext.MINIFY_ENABLE = true
+    // ndk版本
+    ext.NDK_VERSION = '21.3.6528147'
+    // kotlin版本
+    ext.KOTLIN_VERSION = '1.4.20'
+    // compileSdkVersion
+    ext.COMPILE_SDK_VERSION = 30
+    // buildToolsVersion
+    ext.BUILD_TOOLS_VERSION = '30.0.3'
+    // minSdkVersion
+    ext.MIN_SDK_VERSION = 16
+    // targetSdkVersion
+    ext.TARGET_SDK_VERSION = 30
+
+    repositories {
+        google()
+        mavenCentral()
+        jcenter()
+    }
+    dependencies {
+        classpath 'com.android.tools.build:gradle:4.1.3'
+        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
+//        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
+        //jitpack
+        classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
+
+        // NOTE: Do not place your application dependencies here; they belong
+        // in the individual module build.gradle files
+
+    }
+}
+
+allprojects {
+    repositories {
+        google()
+        mavenCentral()
+        jcenter()
+        maven { url 'https://jitpack.io' }
+//        maven { url 'http://175.97.139.186:8081/repository/android-maven/' }
+
+    }
+}
+
+task clean(type: Delete) {
+    delete rootProject.buildDir
+}

+ 1 - 0
demo/.gitignore

@@ -0,0 +1 @@
+/build

+ 72 - 0
demo/build.gradle

@@ -0,0 +1,72 @@
+plugins {
+    id 'com.android.application'
+    id 'kotlin-android'
+}
+
+def keystorePropertiesFile = rootProject.file("keystore.properties")
+def keystoreProperties = new Properties()
+keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
+
+android {
+    compileSdkVersion COMPILE_SDK_VERSION
+    buildToolsVersion BUILD_TOOLS_VERSION
+
+    defaultConfig {
+        applicationId "com.yyxx.columbus.demo"
+        minSdkVersion MIN_SDK_VERSION
+        targetSdkVersion TARGET_SDK_VERSION
+        versionCode 1
+        versionName "1.0"
+    }
+
+    signingConfigs {
+        config {
+            keyAlias keystoreProperties['keyAlias']
+            keyPassword keystoreProperties['keyPassword']
+            storeFile file(keystoreProperties['storeFile'])
+            storePassword keystoreProperties['storePassword']
+        }
+    }
+
+    buildTypes {
+        debug {
+            minifyEnabled false
+            signingConfig signingConfigs.config
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+
+        release {
+            minifyEnabled false
+            signingConfig signingConfigs.config
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+
+    lintOptions {
+        abortOnError false
+    }
+
+    repositories {
+        flatDir {
+            dirs 'libs'
+        }
+    }
+
+    dexOptions {
+        preDexLibraries = false
+    }
+
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
+
+    kotlinOptions {
+        jvmTarget = "1.8"
+    }
+}
+
+dependencies {
+
+    implementation project(':library_core')
+}

+ 21 - 0
demo/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 40 - 0
demo/src/main/AndroidManifest.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.yyxx.columbus.demo">
+
+    <application
+        android:name=".DemoApplication"
+        android:allowBackup="true"
+        android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name"
+        android:requestLegacyExternalStorage="false"
+        android:resizeableActivity="false"
+        android:supportsRtl="true"
+        android:theme="@style/AppTheme">
+
+        <activity
+            android:name=".WelcomeActivity"
+            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
+            android:launchMode="standard"
+            android:screenOrientation="portrait"
+            android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+        <activity
+            android:name=".DemoActivity"
+            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
+            android:exported="true"
+            android:launchMode="singleTask"
+            android:screenOrientation="portrait">
+            <intent-filter>
+                <action android:name="${applicationId}" />
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest>

+ 84 - 0
demo/src/main/java/com/yyxx/columbus/demo/DemoActivity.kt

@@ -0,0 +1,84 @@
+package com.yyxx.columbus.demo
+
+import android.app.Activity
+import android.os.Bundle
+import android.os.Handler
+import android.os.Looper
+import android.os.Message
+import android.view.View
+import android.widget.*
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/06/09
+ */
+class DemoActivity : Activity(), View.OnClickListener {
+
+    private val events = arrayListOf(
+        Item(0, "00 接口环境切换"),
+        Item(1, "01 登录"),
+        Item(2, "02 切换账号"),
+        Item(3, "03 角色创建上报"),
+        Item(4, "04 角色登录上报"),
+        Item(5, "05 角色升级上报"),
+        Item(6, "06 定额充值"),
+        Item(7, "07 绑定平台账号"),
+        Item(8, "08 打开客服中心"),
+        Item(9, "09 崩溃测试")
+    )
+
+
+    private lateinit var layout: LinearLayout
+    private lateinit var mTextView: TextView
+
+    private val handler = object : Handler(Looper.getMainLooper()) {
+        override fun handleMessage(msg: Message) {
+            when (msg.what) {
+                10001 -> {
+                    with(mTextView) {
+                        text = text.toString() + msg.obj.toString()
+                    }
+                }
+            }
+        }
+    }
+
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        initView()
+    }
+
+    private fun initView() {
+        layout = LinearLayout(this)
+        layout.orientation = LinearLayout.VERTICAL
+        initButton()
+        mTextView = TextView(this)
+        with(mTextView) {
+            text = ""
+            this@DemoActivity.layout.addView(this)
+        }
+        val scrollView = ScrollView(this)
+        scrollView.addView(layout)
+        setContentView(scrollView)
+    }
+
+
+    private fun initButton() {
+        for (event in events) {
+            with(Button(this)) {
+                text = event.name
+                tag = event.id
+                id = event.id
+                setOnClickListener(this@DemoActivity)
+                this@DemoActivity.layout.addView(this)
+            }
+        }
+    }
+
+    override fun onClick(v: View?) {
+        TODO("Not yet implemented")
+    }
+
+
+}

+ 19 - 0
demo/src/main/java/com/yyxx/columbus/demo/DemoApplication.kt

@@ -0,0 +1,19 @@
+package com.yyxx.columbus.demo
+
+import android.app.Application
+import android.content.Context
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/06/09
+ */
+class DemoApplication : Application() {
+
+    override fun attachBaseContext(base: Context?) {
+        super.attachBaseContext(base)
+    }
+
+    override fun onCreate() {
+        super.onCreate()
+    }
+}

+ 7 - 0
demo/src/main/java/com/yyxx/columbus/demo/Item.kt

@@ -0,0 +1,7 @@
+package com.yyxx.columbus.demo
+
+/**
+ * @author #Suyghur,
+ * Created on 2021/3/22
+ */
+class Item constructor(val id: Int, val name: String)

+ 83 - 0
demo/src/main/java/com/yyxx/columbus/demo/WelcomeActivity.kt

@@ -0,0 +1,83 @@
+package com.yyxx.columbus.demo
+
+import android.app.Activity
+import android.content.Intent
+import android.content.res.Configuration
+import android.os.Bundle
+import android.os.Handler
+import android.os.Looper
+import android.os.Message
+import android.view.animation.AlphaAnimation
+import android.view.animation.Animation
+import android.widget.LinearLayout
+import cn.yyxx.columbus.base.utils.Logger
+import cn.yyxx.support.ResUtils
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/06/09
+ */
+class WelcomeActivity : Activity() {
+
+    companion object {
+        private const val CODE_GO_INIT = 0x000003E8
+        private const val CODE_GO_GAME_ACTIVITY = 0x000003E9
+    }
+
+    private val handler = object : Handler(Looper.getMainLooper()) {
+        override fun handleMessage(msg: Message) {
+            when (msg.what) {
+                CODE_GO_INIT -> goInit()
+                CODE_GO_GAME_ACTIVITY -> goGameActivity()
+            }
+        }
+    }
+
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        handler.sendEmptyMessageDelayed(CODE_GO_INIT, 400)
+    }
+
+    private fun goInit() {
+        val animation = AlphaAnimation(0.3f, 1.0f)
+        animation.duration = 1500
+        animation.setAnimationListener(object : Animation.AnimationListener {
+            override fun onAnimationStart(animation: Animation?) {
+            }
+
+            override fun onAnimationEnd(animation: Animation?) {
+                handler.sendEmptyMessage(CODE_GO_GAME_ACTIVITY)
+            }
+
+            override fun onAnimationRepeat(animation: Animation?) {
+            }
+        })
+        setView(animation)
+    }
+
+    private fun goGameActivity() {
+        Logger.i("goGameActivity -> action = ${this.packageName}")
+        startActivity(Intent(this.packageName))
+        finish()
+    }
+
+
+    private fun setView(animation: Animation) {
+        val orientation = resources.configuration.orientation
+        val id = if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
+            ResUtils.getResId(this, "yyxx_welcome_land", "drawable")
+        } else {
+            ResUtils.getResId(this, "yyxx_welcome", "drawable")
+        }
+        if (id == 0) {
+            handler.sendEmptyMessage(CODE_GO_GAME_ACTIVITY)
+            return
+        }
+
+        val layout = LinearLayout(this)
+        layout.setBackgroundResource(id)
+        layout.animation = animation
+        setContentView(layout)
+
+    }
+}

BIN
demo/src/main/res/drawable-xhdpi/yyxx_welcome.png


BIN
demo/src/main/res/mipmap-xhdpi/ic_launcher.png


+ 10 - 0
demo/src/main/res/values/colors.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="purple_200">#FFBB86FC</color>
+    <color name="purple_500">#FF6200EE</color>
+    <color name="purple_700">#FF3700B3</color>
+    <color name="teal_200">#FF03DAC5</color>
+    <color name="teal_700">#FF018786</color>
+    <color name="black">#FF000000</color>
+    <color name="white">#FFFFFFFF</color>
+</resources>

+ 13 - 0
demo/src/main/res/values/strings.xml

@@ -0,0 +1,13 @@
+<resources>
+    <string name="app_name" translatable="false">Columbus-KTX</string>
+<!--    <string name="gcm_defaultSenderId" translatable="false">38153824010</string>-->
+<!--    <string name="google_api_key" translatable="false">AIzaSyAvNhYCtqGbzqd2aCLTxUAwCVSySDX7tng</string>-->
+<!--    <string name="google_app_id" translatable="false">1:38153824010:android:607f0f217d4cfa889dfcf3</string>-->
+<!--    <string name="google_crash_reporting_api_key" translatable="false">AIzaSyAvNhYCtqGbzqd2aCLTxUAwCVSySDX7tng</string>-->
+<!--    <string name="google_storage_bucket" translatable="false">api-project-82067969.appspot.com</string>-->
+<!--    <string name="project_id" translatable="false">api-project-82067969</string>-->
+<!--    <string name="default_web_client_id" translatable="false">38153824010-b2e01psqkkf8kfcr26d5l98pgana4pi2.apps.googleusercontent.com</string>-->
+<!--    <string name="com.crashlytics.RequireBuildId" translatable="false">true</string>-->
+<!--    <string name="com.google.firebase.crashlytics.mapping_file_id" translatable="false">00000000000000000000000000000000</string>-->
+<!--    <string name="title_feature_test">FeatureTest</string>-->
+</resources>

+ 5 - 0
demo/src/main/res/values/styles.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <!-- Base application theme. -->
+    <style name="AppTheme" parent="android:Theme.Light.NoTitleBar.Fullscreen" />
+</resources>

+ 21 - 0
gradle.properties

@@ -0,0 +1,21 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app"s APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.injected.testOnly=false
+android.useAndroidX=true
+android.enableJetifier=true
+# Kotlin code style for this project: "official" or "obsolete":
+kotlin.code.style=official

BIN
gradle/wrapper/gradle-wrapper.jar


+ 6 - 0
gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,6 @@
+#Wed Jun 09 15:49:46 CST 2021
+distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
+distributionPath=wrapper/dists
+zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME

+ 172 - 0
gradlew

@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+    echo "$*"
+}
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"

+ 84 - 0
gradlew.bat

@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega

+ 5 - 0
keystore.properties

@@ -0,0 +1,5 @@
+#demo
+storePassword=demo53ux_yyxx2021
+keyPassword=demo53ux_yyxx2021
+keyAlias=alias.demo_yyxx2021
+storeFile=../zkeystore/demo_yyxx.keystore

+ 1 - 0
library_base/.gitignore

@@ -0,0 +1 @@
+/build

+ 56 - 0
library_base/build.gradle

@@ -0,0 +1,56 @@
+plugins {
+    id 'com.android.library'
+    id 'kotlin-android'
+}
+
+android {
+
+    compileSdkVersion COMPILE_SDK_VERSION
+    buildToolsVersion BUILD_TOOLS_VERSION
+
+    defaultConfig {
+        minSdkVersion MIN_SDK_VERSION
+        targetSdkVersion TARGET_SDK_VERSION
+
+        ndk {
+            // 设置支持的SO库架构
+            abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
+        }
+    }
+
+
+    buildTypes {
+        release {
+            minifyEnabled MINIFY_ENABLE
+            proguardFiles 'proguard-rules.pro'
+        }
+    }
+
+    buildFeatures {
+        buildConfig = false
+    }
+
+    lintOptions {
+        abortOnError false
+    }
+
+    repositories {
+        flatDir {
+            dirs '../libs'
+        }
+    }
+
+    dexOptions {
+        preDexLibraries = false
+    }
+
+    compileOptions {
+        kotlinOptions.freeCompilerArgs += ['-module-name', "cn.yyxx.columbus.base"]
+    }
+}
+
+dependencies {
+    api files('../libs/dolin_zap_1.0.0.jar')
+    api files('../libs/yyxx_support_1.0.1.jar')
+    implementation 'androidx.core:core-ktx:1.3.2'
+}

+ 21 - 0
library_base/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 5 - 0
library_base/src/main/AndroidManifest.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="cn.yyxx.columbus.base">
+
+</manifest>

+ 35 - 0
library_base/src/main/java/cn/yyxx/columbus/base/Columbus.kt

@@ -0,0 +1,35 @@
+package cn.yyxx.columbus.base
+
+import androidx.annotation.Keep
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/06/09
+ */
+class Columbus private constructor() {
+
+
+
+
+
+    companion object {
+        @JvmStatic
+        @Keep
+        fun getInstance(): Columbus {
+            return ColumbusHolder.INSTANCE
+        }
+
+        private const val CLICK_INTERVAL: Int = 1500
+
+        private object ColumbusHolder {
+            val INSTANCE: Columbus = Columbus()
+        }
+
+        /**
+         * 防止单例对象在反序列化时重新生成对象
+         */
+        private fun readResolve(): Any {
+            return ColumbusHolder.INSTANCE
+        }
+    }
+}

+ 19 - 0
library_base/src/main/java/cn/yyxx/columbus/base/ColumbusApplication.kt

@@ -0,0 +1,19 @@
+package cn.yyxx.columbus.base
+
+import android.app.Application
+import android.content.Context
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/06/09
+ */
+class ColumbusApplication : Application() {
+
+    override fun attachBaseContext(base: Context?) {
+        super.attachBaseContext(base)
+    }
+
+    override fun onCreate() {
+        super.onCreate()
+    }
+}

+ 36 - 0
library_base/src/main/java/cn/yyxx/columbus/base/entity/Function.kt

@@ -0,0 +1,36 @@
+package cn.yyxx.columbus.base.entity
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/06/09
+ */
+object Function {
+
+    const val ATTACH_BASE_CONTEXT = "attachBaseContext"
+    const val INIT_APPLICATION = "initApplication"
+    const val INITIALIZE = "initialize"
+    const val LOGIN = "login"
+    const val LOGOUT = "logout"
+    const val CHARGE = "charge"
+    const val OPEN_EXIT_VIEW = "openExitView"
+    const val OPEN_BIND_ACCOUNT = "openBindAccount"
+    const val OPEN_GM_CENTER = "openGmCenter"
+    const val ROLE_CREATE = "roleCreate"
+    const val ROLE_LAUNCHER = "roleLauncher"
+    const val ROLE_UPGRADE = "roleUpgrade"
+    const val ON_START = "onStart"
+    const val ON_RESUME = "onResume"
+    const val ON_RESTART = "onRestart"
+    const val ON_PAUSE = "onPause"
+    const val ON_STOP = "onStop"
+    const val ON_DESTROY = "onDestroy"
+    const val ON_NEW_INTENT = "onNewIntent"
+    const val ON_ACTIVITY_RESULT = "onActivityResult"
+    const val ON_CONFIGURATION_CHANGED = "onConfigurationChanged"
+    const val ON_REQUEST_PERMISSIONS_RESULT = "onRequestPermissionsResult"
+    const val GET_CURRENT_USER_ID = "getCurrentUserId"
+    const val GET_CURRENT_SDK_VERSION = "getCurrentSdkVersion"
+    const val HAS_BIND_ACCOUNT = "hasBindAccount"
+    const val IS_GM_CENTER_ENABLE = "isGmCenterEnable"
+    const val INVOKE_SDK_SHARING = "invokeSdkSharing"
+}

+ 90 - 0
library_base/src/main/java/cn/yyxx/columbus/base/utils/Logger.kt

@@ -0,0 +1,90 @@
+package cn.yyxx.columbus.base.utils
+
+import android.app.Application
+import cn.yyxx.support.hawkeye.LogUtils
+import com.dolin.zap.Zap
+import com.dolin.zap.entity.Config
+import com.dolin.zap.entity.Level
+
+/**
+ * @author #Suyghur.
+ * Created on 2020/11/30
+ */
+object Logger {
+
+    private const val TAG: String = "columbus_sdk"
+
+    private var hasZapInit = false
+
+    fun initZap(application: Application) {
+        val level = if (LogUtils.DEBUG) {
+            Level.DEBUG
+        } else {
+            Level.INFO
+        }
+
+        //初始化Zap日志框架
+        val config = Config.Builder()
+            //logcat输出最低等级
+            .setLogcatLevel(level)
+            //是否开启缓存日志
+            .setRecordEnable(true)
+            //缓存日志最低等级
+            .setRecordLevel(Level.DEBUG)
+            //是否开启压缩缓存日志内容
+            .setCompressEnable(true)
+            //缓存文件的过期时间
+            .setOverdueDay(3)
+            //缓存文件大小限制,超过则会自动扩容新文件
+            .setFileSizeLimitDay(15)
+            .create()
+        Zap.initialize(application, config)
+        hasZapInit = true
+    }
+
+    @JvmStatic
+    fun d(any: Any?) {
+        d(TAG, any)
+    }
+
+    @JvmStatic
+    fun d(tag: String, any: Any?) {
+        if (hasZapInit) {
+            Zap.d(tag, any)
+        } else {
+            LogUtils.d(tag, any)
+        }
+    }
+
+    @JvmStatic
+    fun i(any: Any?) {
+        i(TAG, any)
+    }
+
+    @JvmStatic
+    fun i(tag: String, any: Any?) {
+        if (hasZapInit) {
+            Zap.i(tag, any)
+        } else {
+            LogUtils.i(tag, any)
+        }
+    }
+
+    @JvmStatic
+    fun e(any: Any?) {
+        d(TAG, any)
+    }
+
+    @JvmStatic
+    fun e(tag: String, any: Any?) {
+        if (hasZapInit) {
+            Zap.e(tag, any)
+        } else {
+            LogUtils.e(tag, any)
+        }
+    }
+
+    fun logHandler(msg: String) {
+        LogUtils.logHandler(msg)
+    }
+}

+ 2 - 0
library_core/.gitignore

@@ -0,0 +1,2 @@
+/build
+/.cxx

+ 49 - 0
library_core/CMakeLists.txt

@@ -0,0 +1,49 @@
+# For more information about using CMake with Android Studio, read the
+# documentation: https://d.android.com/studio/projects/add-native-code.html
+
+# Sets the minimum version of CMake required to build the native library.
+
+cmake_minimum_required(VERSION 3.4.1)
+
+# Creates and names a library, sets it as either STATIC
+# or SHARED, and provides the relative paths to its source code.
+# You can define multiple libraries, and CMake builds them for you.
+# Gradle automatically packages shared libraries with your APK.
+
+
+#include_directories(src/main/cpp/includes)
+#include_directories(src/main/cpp/json)
+#include_directories(src/main/cpp/encrypt)
+aux_source_directory(src/main/cpp/ DIR_SOURCE)
+#aux_source_directory(src/main/cpp/json JSON_SOURCE)
+#aux_source_directory(src/main/cpp/encrypt ENCRYPT_SOURCE)
+
+add_library(
+        columbus
+        SHARED
+        ${DIR_SOURCE}
+#        ${JSON_SOURCE}
+#        ${ENCRYPT_SOURCE}
+)
+
+# Searches for a specified prebuilt library and stores the path as a
+# variable. Because CMake includes system libraries in the search path by
+# default, you only need to specify the name of the public NDK library
+# you want to add. CMake verifies that the library exists before
+# completing its build.
+
+find_library( # Sets the name of the path variable.
+        log-lib
+        # Specifies the name of the NDK library that
+        # you want CMake to locate.
+        log)
+
+# Specifies libraries CMake should link to your target library. You
+# can link multiple libraries, such as libraries you define in this
+# build script, prebuilt third-party libraries, or system libraries.
+
+target_link_libraries( # Specifies the target library.
+        columbus
+        # Links the target library to the log library
+        # included in the NDK.
+        ${log-lib})

+ 67 - 0
library_core/build.gradle

@@ -0,0 +1,67 @@
+plugins {
+    id 'com.android.library'
+    id 'kotlin-android'
+}
+
+android {
+
+    compileSdkVersion COMPILE_SDK_VERSION
+    buildToolsVersion BUILD_TOOLS_VERSION
+
+    defaultConfig {
+        minSdkVersion MIN_SDK_VERSION
+        targetSdkVersion TARGET_SDK_VERSION
+
+        externalNativeBuild {
+            cmake {
+                cppFlags '-std=c++11 -frtti -fexceptions -lz'
+                abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
+            }
+        }
+
+        ndk {
+            // 设置支持的SO库架构
+            abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
+        }
+    }
+
+
+    buildTypes {
+        release {
+            minifyEnabled MINIFY_ENABLE
+            proguardFiles 'proguard-rules.pro'
+        }
+    }
+
+    buildFeatures {
+        buildConfig = false
+    }
+
+    lintOptions {
+        abortOnError false
+    }
+
+    repositories {
+        flatDir {
+            dirs '../libs'
+        }
+    }
+
+    dexOptions {
+        preDexLibraries = false
+    }
+
+    compileOptions {
+        kotlinOptions.freeCompilerArgs += ['-module-name', "cn.yyxx.columbus.core"]
+    }
+
+    externalNativeBuild {
+        cmake {
+            path "CMakeLists.txt"
+        }
+    }
+}
+
+dependencies {
+    api project(':library_base')
+}

+ 21 - 0
library_core/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 5 - 0
library_core/src/main/AndroidManifest.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="cn.yyxx.columbus.core">
+
+</manifest>

+ 22 - 0
library_core/src/main/cpp/columbus.cpp

@@ -0,0 +1,22 @@
+//
+// Created by #Suyghur, on 2021/06/09.
+//
+
+
+
+#include <jni.h>
+
+static JNINativeMethod gMethod[] = {
+};
+
+extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
+    JNIEnv *env = nullptr;
+    if (vm->GetEnv((void **) &env, JNI_VERSION_1_6) != JNI_OK) {
+        return JNI_ERR;
+    }
+    jclass clz = env->FindClass("cn/yyxx/columbus/core/SdkDrive");
+    if (env->RegisterNatives(clz, gMethod, sizeof(gMethod) / sizeof(gMethod[0])) < 0) {
+        return JNI_ERR;
+    }
+    return JNI_VERSION_1_6;
+}

+ 11 - 0
library_core/src/main/java/cn/yyxx/columbus/Version.kt

@@ -0,0 +1,11 @@
+package cn.yyxx.columbus
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/06/09
+ */
+object Version {
+    const val CORE_VERSION_NAME = "1.0.0"
+    const val CORE_VERSION_CODE = 100
+    const val SERVER_VERSION_NAME = "1.0.0"
+}

+ 8 - 0
library_core/src/main/java/cn/yyxx/columbus/core/SdkBridge.kt

@@ -0,0 +1,8 @@
+package cn.yyxx.columbus.core
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/06/09
+ */
+class SdkBridge {
+}

+ 8 - 0
library_core/src/main/java/cn/yyxx/columbus/core/SdkDrive.kt

@@ -0,0 +1,8 @@
+package cn.yyxx.columbus.core
+
+/**
+ * @author #Suyghur.
+ * Created on 2021/06/09
+ */
+class SdkDrive {
+}

BIN
library_core/src/main/jniLibs/arm64-v8a/libdolin-zap.so


BIN
library_core/src/main/jniLibs/armeabi-v7a/libdolin-zap.so


BIN
library_core/src/main/jniLibs/x86/libdolin-zap.so


BIN
library_core/src/main/jniLibs/x86_64/libdolin-zap.so


BIN
libs/dolin_zap_1.0.0.jar


BIN
libs/yyxx_support_1.0.1.jar


+ 5 - 0
settings.gradle

@@ -0,0 +1,5 @@
+rootProject.name = "Columbus"
+include ':demo'
+include ':library_base'
+include ':library_core'
+

BIN
zkeystore/demo_yyxx.keystore