Skip to content

Commit db7b105

Browse files
committed
feat(assists): 添加 Web支持模块
- 新增 assists-web 模块,实现 Accessibility与 Web 的交互功能 - 添加 AXWebView 组件,支持 JavaScript调用 Android API - 实现 Node 类和 NodeCacheManager,用于管理Accessibility节点信息 - 新增 CallMethod、CallRequest 和 CallResponse 类,用于定义和处理 JavaScript 调用 - 添加 UniqueIdGenerator 工具类,用于生成唯一标识符 - 在 settings.gradle 中包含 assists-web 模块
1 parent 2a5a5f3 commit db7b105

File tree

17 files changed

+886
-0
lines changed

17 files changed

+886
-0
lines changed

assists-web/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

assists-web/build.gradle

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
plugins {
2+
id 'com.android.library'
3+
id 'org.jetbrains.kotlin.android'
4+
id 'maven-publish'
5+
}
6+
7+
android {
8+
namespace 'com.ven.assists_web'
9+
compileSdk rootProject.ext.compileSdk
10+
11+
defaultConfig {
12+
minSdk rootProject.ext.minSdk
13+
versionCode rootProject.ext.versionCode
14+
versionName rootProject.ext.versionName
15+
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
consumerProguardFiles "consumer-rules.pro"
18+
}
19+
20+
buildTypes {
21+
release {
22+
minifyEnabled false
23+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24+
}
25+
}
26+
27+
compileOptions {
28+
sourceCompatibility JavaVersion.VERSION_17
29+
targetCompatibility JavaVersion.VERSION_17
30+
}
31+
}
32+
33+
dependencies {
34+
implementation "androidx.activity:activity-ktx:${rootProject.ext.activityKtxVersion}"
35+
implementation "androidx.core:core-ktx:${rootProject.ext.coreKtxVersion}"
36+
implementation "com.google.code.gson:gson:2.11.0"
37+
implementation project(':assists')
38+
implementation project(':assists-mp')
39+
}
40+
41+
afterEvaluate {
42+
publishing {
43+
publications {
44+
release(MavenPublication) {
45+
from components.release
46+
groupId = 'com.github.ven-coder'
47+
artifactId = 'assists-web'
48+
version = rootProject.ext.mavenVersion
49+
}
50+
}
51+
}
52+
}

assists-web/consumer-rules.pro

Whitespace-only changes.

assists-web/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.ven.assists_web">
4+
5+
<application>
6+
<provider
7+
android:name="com.ven.assists.web.CustomFileProvider"
8+
android:authorities="${applicationId}.assistsweb.fileprovider"
9+
android:exported="false"
10+
android:grantUriPermissions="true">
11+
<meta-data
12+
android:name="android.support.FILE_PROVIDER_PATHS"
13+
android:resource="@xml/assists_web_provider_paths" />
14+
</provider>
15+
16+
</application>
17+
18+
</manifest>

0 commit comments

Comments
 (0)