use kotlin for core

This commit is contained in:
Kr328 committed 2019-11-19 09:30:41 +08:00
1 parent fe194eac76
commit 9987a83334
5 files changed
+12 -18

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.3.60'
repositories {
google()
jcenter()
+1 -1
View File
@@ -2,7 +2,7 @@ apply plugin: 'java'
apply plugin: 'kotlin'
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.3.60'
repositories {
mavenCentral()
}
+7 -1
View File
@@ -1,4 +1,6 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 29
@@ -28,7 +30,8 @@ android {
}
dependencies {
implementation "androidx.core:core-ktx:1.1.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
@@ -46,4 +49,7 @@ afterEvaluate {
if ( task.name.contains("JniLib") )
task.dependsOn(ts)
}
}
repositories {
mavenCentral()
}
@@ -1,14 +1,9 @@
package com.github.kr328.clash.core;
import android.content.Context;
public final class Clash {
public static native void init(String clashLibrary, String home);
public static native void loadDefault();
public static native void loadProfileFromPath(String path) throws ClashException;
public static native void startTun(int fd, int mtu) throws ClashException;
public static native void stopTun() throws ClashException;
public Clash(Context context) {
static {
System.loadLibrary("clash");
System.loadLibrary("bridge");
}
}
@@ -1,7 +0,0 @@
package com.github.kr328.clash.core;
public class ClashException extends RuntimeException {
public ClashException(String message) {
super(message);
}
}