Skip to content

docs: add API integration documentation#1

Draft
kanaodnd wants to merge 2 commits into
mainfrom
docs/add-api-integration-18112837169251585182
Draft

docs: add API integration documentation#1
kanaodnd wants to merge 2 commits into
mainfrom
docs/add-api-integration-18112837169251585182

Conversation

@kanaodnd
Copy link
Copy Markdown
Owner

Added comprehensive documentation for integrating AxManager API, covering both Axerish + libsu and the Direct Axeron API usage. Includes READMEs inside the api/ directory (English & Indonesian) and a new VitePress documentation page under website/docs (English & Chinese) with proper navigation setup.


PR created automatically by Jules for task 18112837169251585182 started by @kanaodnd

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.
@google-labs-jules
Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread website/docs/guide/api-integration.md Outdated
```xml
<provider
android:name="frb.axeron.provider.AxeronProvider"
android:authorities="${applicationId}.axeron"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
android:authorities="${applicationId}.axeron"
android:authorities="${applicationId}.shizuku"

Comment thread website/docs/guide/api-integration.md Outdated
Comment on lines +89 to +94
<provider
android:name="frb.axeron.provider.AxeronProvider"
android:authorities="${applicationId}.axeron"
android:exported="true"
android:multiprocess="false" />
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
android:authorities="${applicationId}.axeron"
android:authorities="${applicationId}.shizuku"

Comment on lines +89 to +94
<provider
android:name="frb.axeron.provider.AxeronProvider"
android:authorities="${applicationId}.axeron"
android:exported="true"
android:multiprocess="false" />
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Comment thread website/docs/guide/api-integration.md Outdated
Comment on lines +104 to +118
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")
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Comment on lines +104 to +118
Axeron.addBinderReceivedListenerSticky {
// 我们现在已连接到 AxManager!

// 直接执行命令
val process = Axeron.newProcess("uname -r")

// 读取输出
process.inputStream.bufferedReader().useLines { lines ->
lines.forEach { println("输出: $it") }
}

// 等待命令完成
val exitCode = process.waitFor()
println("命令完成,退出码为: $exitCode")
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant