mirror of
https://github.com/TonyJiangWJ/Auto.js.git
synced 2026-06-24 21:33:16 +08:00
修改目录结构
This commit is contained in:
parent
4444401fad
commit
af235f3775
2
autojs-aar/emulatorview/build.gradle
Normal file
2
autojs-aar/emulatorview/build.gradle
Normal file
@ -0,0 +1,2 @@
|
||||
configurations.maybeCreate("default")
|
||||
artifacts.add("default", file('emulatorview-release.aar'))
|
||||
BIN
autojs-aar/emulatorview/emulatorview-release.aar
Normal file
BIN
autojs-aar/emulatorview/emulatorview-release.aar
Normal file
Binary file not shown.
2
autojs-aar/libtermexec/build.gradle
Normal file
2
autojs-aar/libtermexec/build.gradle
Normal file
@ -0,0 +1,2 @@
|
||||
configurations.maybeCreate("default")
|
||||
artifacts.add("default", file('libtermexec-release.aar'))
|
||||
BIN
autojs-aar/libtermexec/libtermexec-release.aar
Normal file
BIN
autojs-aar/libtermexec/libtermexec-release.aar
Normal file
Binary file not shown.
2
autojs-aar/opencv/build.gradle
Normal file
2
autojs-aar/opencv/build.gradle
Normal file
@ -0,0 +1,2 @@
|
||||
configurations.maybeCreate("default")
|
||||
artifacts.add("default", file('opencv-4.5.5.aar'))
|
||||
BIN
autojs-aar/opencv/opencv-4.5.5.aar
Normal file
BIN
autojs-aar/opencv/opencv-4.5.5.aar
Normal file
Binary file not shown.
2
autojs-aar/term/build.gradle
Normal file
2
autojs-aar/term/build.gradle
Normal file
@ -0,0 +1,2 @@
|
||||
configurations.maybeCreate("default")
|
||||
artifacts.add("default", file('term-debug.aar'))
|
||||
BIN
autojs-aar/term/term-debug.aar
Normal file
BIN
autojs-aar/term/term-debug.aar
Normal file
Binary file not shown.
1
autojs-tool-color-center/.gitignore
vendored
1
autojs-tool-color-center/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
||||
21
autojs-tool-color-center/proguard-rules.pro
vendored
21
autojs-tool-color-center/proguard-rules.pro
vendored
@ -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
|
||||
1
autojs-tool-common/.gitignore
vendored
1
autojs-tool-common/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
||||
1
autojs-tool-download/.gitignore
vendored
1
autojs-tool-download/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
||||
21
autojs-tool-download/proguard-rules.pro
vendored
21
autojs-tool-download/proguard-rules.pro
vendored
@ -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
|
||||
1
autojs-tool-encrypt/.gitignore
vendored
1
autojs-tool-encrypt/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
||||
1
autojs-tool-webview/.gitignore
vendored
1
autojs-tool-webview/.gitignore
vendored
@ -1 +0,0 @@
|
||||
/build
|
||||
1
js-supports/.gitignore
vendored
Normal file
1
js-supports/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
build/
|
||||
@ -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'
|
||||
}
|
||||
@ -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')
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -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"
|
||||
}
|
||||
@ -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')
|
||||
}
|
||||
@ -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/目录下
|
||||
Loading…
Reference in New Issue
Block a user