docs: add API integration documentation#1
Conversation
Added comprehensive documentation on how to integrate AxManager to third-party client applications for executing commands with elevated privileges. Included setup for: - Axerish with libsu - Direct Axeron API Updated website documentation and `api/README.md` in both English and Indonesian/Chinese respectively.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new 'API Integration' guide in both English and Chinese, detailing how third-party applications can interface with Axeron Manager using either Axerish with libsu or the direct Axeron API. The review feedback highlights several critical issues in the documentation's code examples: the Android provider authority is incorrectly specified, a necessary permission declaration is missing from the manifest example, and the Kotlin snippets perform blocking operations that could cause ANR errors if executed on the main thread.
| ```xml | ||
| <provider | ||
| android:name="frb.axeron.provider.AxeronProvider" | ||
| android:authorities="${applicationId}.axeron" |
There was a problem hiding this comment.
The authority specified here (${applicationId}.axeron) does not match the authority the server expects. According to the server implementation in AxeronService.kt (line 188), it looks for a provider with the authority ${packageName}.shizuku. Using the wrong authority will prevent the server from successfully connecting to your application.
| android:authorities="${applicationId}.axeron" | |
| android:authorities="${applicationId}.shizuku" |
| <provider | ||
| android:name="frb.axeron.provider.AxeronProvider" | ||
| android:authorities="${applicationId}.axeron" | ||
| android:exported="true" | ||
| android:multiprocess="false" /> | ||
| ``` |
There was a problem hiding this comment.
The documentation is missing the requirement to declare the necessary permission in the AndroidManifest.xml. The Axeron server (see AxeronService.kt, line 130) iterates through installed packages and only sends the binder to those that have requested the specific API permission. Without this declaration, the addBinderReceivedListenerSticky callback will never be triggered. Please add a <uses-permission> tag to the example.
| ```xml | ||
| <provider | ||
| android:name="frb.axeron.provider.AxeronProvider" | ||
| android:authorities="${applicationId}.axeron" |
There was a problem hiding this comment.
The authority specified here (${applicationId}.axeron) does not match the authority the server expects. According to the server implementation in AxeronService.kt (line 188), it looks for a provider with the authority ${packageName}.shizuku. Using the wrong authority will prevent the server from successfully connecting to your application.
| android:authorities="${applicationId}.axeron" | |
| android:authorities="${applicationId}.shizuku" |
| <provider | ||
| android:name="frb.axeron.provider.AxeronProvider" | ||
| android:authorities="${applicationId}.axeron" | ||
| android:exported="true" | ||
| android:multiprocess="false" /> | ||
| ``` |
There was a problem hiding this comment.
The documentation is missing the requirement to declare the necessary permission in the AndroidManifest.xml. The Axeron server (see AxeronService.kt, line 130) iterates through installed packages and only sends the binder to those that have requested the specific API permission. Without this declaration, the addBinderReceivedListenerSticky callback will never be triggered. Please add a <uses-permission> tag to the example.
| Axeron.addBinderReceivedListenerSticky { | ||
| // We are now connected to AxManager! | ||
|
|
||
| // Execute a command directly | ||
| val process = Axeron.newProcess("uname -r") | ||
|
|
||
| // Read the output | ||
| process.inputStream.bufferedReader().useLines { lines -> | ||
| lines.forEach { println("Output: $it") } | ||
| } | ||
|
|
||
| // Wait for the command to finish | ||
| val exitCode = process.waitFor() | ||
| println("Command finished with exit code: $exitCode") | ||
| } |
There was a problem hiding this comment.
The example code performs blocking operations (reading from an input stream and calling process.waitFor()) directly inside the addBinderReceivedListenerSticky callback. If this listener is executed on the main thread (which is common for default Android listeners), it will lead to an Application Not Responding (ANR) error. It is recommended to perform these operations on a background thread or using coroutines.
| Axeron.addBinderReceivedListenerSticky { | ||
| // 我们现在已连接到 AxManager! | ||
|
|
||
| // 直接执行命令 | ||
| val process = Axeron.newProcess("uname -r") | ||
|
|
||
| // 读取输出 | ||
| process.inputStream.bufferedReader().useLines { lines -> | ||
| lines.forEach { println("输出: $it") } | ||
| } | ||
|
|
||
| // 等待命令完成 | ||
| val exitCode = process.waitFor() | ||
| println("命令完成,退出码为: $exitCode") | ||
| } |
There was a problem hiding this comment.
The example code performs blocking operations (reading from an input stream and calling process.waitFor()) directly inside the addBinderReceivedListenerSticky callback. If this listener is executed on the main thread (which is common for default Android listeners), it will lead to an Application Not Responding (ANR) error. It is recommended to perform these operations on a background thread or using coroutines.
Replaced individual integration documents with a single comprehensive guide (`Panduan_Dokumentasi_Integrasi_AxManager.md`) as requested. This guide explains how to execute elevated commands using both `Axerish + libsu` and the `Direct Axeron API`.
Added comprehensive documentation for integrating AxManager API, covering both
Axerish + libsuand theDirect Axeron APIusage. Includes READMEs inside theapi/directory (English & Indonesian) and a new VitePress documentation page underwebsite/docs(English & Chinese) with proper navigation setup.PR created automatically by Jules for task 18112837169251585182 started by @kanaodnd