修改目录结构

This commit is contained in:
TonyJiangWJ 2022-01-08 01:55:11 +08:00
parent 4444401fad
commit af235f3775
53 changed files with 57 additions and 83 deletions

View File

@ -0,0 +1,2 @@
configurations.maybeCreate("default")
artifacts.add("default", file('emulatorview-release.aar'))

Binary file not shown.

View File

@ -0,0 +1,2 @@
configurations.maybeCreate("default")
artifacts.add("default", file('libtermexec-release.aar'))

Binary file not shown.

View File

@ -0,0 +1,2 @@
configurations.maybeCreate("default")
artifacts.add("default", file('opencv-4.5.5.aar'))

Binary file not shown.

View File

@ -0,0 +1,2 @@
configurations.maybeCreate("default")
artifacts.add("default", file('term-debug.aar'))

Binary file not shown.

View File

@ -1 +0,0 @@
/build

View File

@ -1,21 +0,0 @@
# 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

View File

@ -1 +0,0 @@
/build

View File

@ -1 +0,0 @@
/build

View File

@ -1,21 +0,0 @@
# 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

View File

@ -1 +0,0 @@
/build

View File

@ -1 +0,0 @@
/build

1
js-supports/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
build/

View File

@ -9,14 +9,11 @@ android {
targetSdkVersion versions.target
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
@ -33,7 +30,8 @@ task makeColorCenterJar(type: Copy) {
//
delete 'build/libs/color-center-sdk.jar'
//
from('build/intermediates/packaged-classes/release/')
// from('build/intermediates/packaged-classes/release/')
from('build/intermediates/aar_main_jar/release/')
// jar包后的文件目录
into('build/libs/')
// classes.jar放入build/libs/
@ -47,7 +45,7 @@ task makeColorCenterJar(type: Copy) {
makeColorCenterJar.dependsOn(build)
dependencies {
api project(path: ':autojs')
testImplementation 'junit:junit:4.12'
implementation project(path: ':autojs')
testImplementation "junit:junit:$junit_version"
implementation 'com.rmtheis:tess-two:9.1.0'
}

View File

@ -27,7 +27,8 @@ task makeAutojsCommonJar(type: Copy) {
//
delete 'build/libs/autojs-common-sdk.jar'
//
from('build/intermediates/packaged-classes/release/')
// from('build/intermediates/packaged-classes/release/')
from('build/intermediates/aar_main_jar/release/')
// jar包后的文件目录
into('build/libs/')
// classes.jar放入build/libs/
@ -41,8 +42,5 @@ task makeAutojsCommonJar(type: Copy) {
makeAutojsCommonJar.dependsOn(build)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api project(path: ':autojs')
// implementation project(path: ':autojs')
implementation project(path: ':autojs')
}

View File

@ -14,6 +14,7 @@ import java.lang.reflect.Method;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.TimeUnit;
/**
* 基于文件的单向通信
@ -211,7 +212,7 @@ public class ProcessMappedShare {
* @param data
* @throws IOException
*/
public void postInfo(String data) throws IOException {
public void postInfo(String data) throws Exception {
if (isSubscriber) {
throw new IllegalStateException("当前是订阅模式,无法发送消息");
}
@ -219,24 +220,43 @@ public class ProcessMappedShare {
throw new IllegalArgumentException("不能发送空内容");
}
FileChannel fc = randomAccessFile.getChannel();
MappedByteBuffer mbb = fc.map(FileChannel.MapMode.READ_WRITE, 0, bufferSize);
final MappedByteBuffer mbb = fc.map(FileChannel.MapMode.READ_WRITE, 0, bufferSize);
byte[] bytes = data.getBytes();
final byte[] bytes = data.getBytes();
int length = bytes.length;
if (length > bufferSize) {
throw new IllegalArgumentException(String.format("发送字节大小[%d]大于缓冲区最大大小[%d]", length, bufferSize));
}
byte marker = mbb.get(0);
if (marker == 1) {
throw new IllegalStateException("文件正在被写入,无法发送消息");
}
mbb.put(0, (byte) 1);
int index = 1;
for (byte b : bytes) {
mbb.put(index++, b);
}
// 标记可读取
mbb.put(0, (byte) 2);
start(new Runnable() {
@Override
public void run() {
byte marker = mbb.get(0);
synchronized (this) {
long maxWait = interval / 10 + 1;
while (marker != TERMINATE) {
// 文件正在被写入或者未被读取 等待
marker = mbb.get(0);
try {
this.wait(10);
if (--maxWait <= 0) {
// 等待最大时间后 表示没有被读取 即可能根本没有监听线程存活
break;
}
} catch (InterruptedException e) {
// 等待上一个操作完成 文件写入完毕或者被读取完毕
}
}
}
mbb.put(0, (byte) 1);
int index = 1;
for (byte b : bytes) {
mbb.put(index++, b);
}
// 标记可读取
mbb.put(0, (byte) 2);
}
});
}
/**

View File

@ -11,13 +11,11 @@ android {
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
@ -45,6 +43,6 @@ task makeDownloadJar(type: Copy) {
}
dependencies {
api project(path: ':autojs')
testImplementation 'junit:junit:4.12'
implementation project(path: ':autojs')
testImplementation "junit:junit:$junit_version"
}

View File

@ -9,15 +9,11 @@ android {
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
@ -32,7 +28,8 @@ task makeEncryptJar(type: Copy) {
//
delete 'build/libs/encrypt-sdk.jar'
//
from('build/intermediates/packaged-classes/release/')
// from('build/intermediates/packaged-classes/release/')
from('build/intermediates/aar_main_jar/release/')
// jar包后的文件目录
into('build/libs/')
// classes.jar放入build/libs/
@ -45,5 +42,5 @@ task makeEncryptJar(type: Copy) {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api project(path: ':autojs')
implementation project(path: ':autojs')
}

View File

@ -29,7 +29,8 @@ task makeJar(type: Copy) {
//
delete 'build/libs/web-bridge-sdk.jar'
//
from('build/intermediates/packaged-classes/release/')
// from('build/intermediates/packaged-classes/release/')
from('build/intermediates/aar_main_jar/release/')
// jar包后的文件目录
into('build/libs/')
// classes.jar放入build/libs/