diff --git a/apk-viewer/build.gradle.kts b/apk-viewer/build.gradle.kts
index 3160d133..765f3bd1 100644
--- a/apk-viewer/build.gradle.kts
+++ b/apk-viewer/build.gradle.kts
@@ -7,7 +7,7 @@ plugins {
}
pluginBuilder {
- pluginName = "apk-viewer"
+ pluginName = "apk-analyzer"
}
android {
diff --git a/apk-viewer/settings.gradle.kts b/apk-viewer/settings.gradle.kts
index 2745fcaf..f85c0c44 100644
--- a/apk-viewer/settings.gradle.kts
+++ b/apk-viewer/settings.gradle.kts
@@ -27,4 +27,4 @@ dependencyResolutionManagement {
}
}
-rootProject.name = "apk-viewer"
+rootProject.name = "apk-analyzer"
diff --git a/apk-viewer/src/main/AndroidManifest.xml b/apk-viewer/src/main/AndroidManifest.xml
index 0aa054e1..0f2f4642 100644
--- a/apk-viewer/src/main/AndroidManifest.xml
+++ b/apk-viewer/src/main/AndroidManifest.xml
@@ -8,11 +8,11 @@
+ android:value="com.example.apkanalyzer" />
+ android:value="APK Analyzer" />
+ android:value="See a structural analysis of your APK." />
+ android:value="com.example.sampleplugin.ApkAnalyzer" />
+
diff --git a/apk-viewer/src/main/kotlin/com/example/sampleplugin/ApkViewer.kt b/apk-viewer/src/main/kotlin/com/example/sampleplugin/ApkAnalyzer.kt
similarity index 75%
rename from apk-viewer/src/main/kotlin/com/example/sampleplugin/ApkViewer.kt
rename to apk-viewer/src/main/kotlin/com/example/sampleplugin/ApkAnalyzer.kt
index 7f2d1033..0537d590 100644
--- a/apk-viewer/src/main/kotlin/com/example/sampleplugin/ApkViewer.kt
+++ b/apk-viewer/src/main/kotlin/com/example/sampleplugin/ApkAnalyzer.kt
@@ -11,47 +11,51 @@ import com.itsaky.androidide.plugins.extensions.EditorTabItem
import com.itsaky.androidide.plugins.extensions.NavigationItem
import com.itsaky.androidide.plugins.extensions.FileOpenExtension
import com.itsaky.androidide.plugins.extensions.FileTabMenuItem
+import com.itsaky.androidide.plugins.extensions.DocumentationExtension
+import com.itsaky.androidide.plugins.extensions.PluginTooltipEntry
+import com.itsaky.androidide.plugins.extensions.PluginTooltipButton
import com.itsaky.androidide.plugins.services.IdeEditorTabService
import com.example.sampleplugin.R
import com.example.sampleplugin.fragments.ApkAnalyzerFragment
import java.io.File
/**
- * APK Viewer Plugin
- * Provides APK analysis functionality via main menu toolbar and bottom sheet
+ * APK Analyzer plugin entry point. Provides APK structural analysis via the
+ * main editor tab, the bottom sheet, the sidebar, and the toolbar menu.
*/
-class ApkViewer : IPlugin, UIExtension, EditorTabExtension, FileOpenExtension {
+class ApkAnalyzer : IPlugin, UIExtension, EditorTabExtension, FileOpenExtension, DocumentationExtension {
private lateinit var context: PluginContext
private var pendingAnalysisFile: File? = null
companion object {
private const val TAB_ID = "apk_analyzer_main_tab"
+ private const val HELP_TOOLTIP_TAG = "apk_analyzer.help"
}
override fun initialize(context: PluginContext): Boolean {
return try {
this.context = context
- context.logger.info("ApkViewer: Plugin initialized successfully")
+ context.logger.info("ApkAnalyzer: Plugin initialized successfully")
true
} catch (e: Exception) {
- context.logger.error("ApkViewer: Plugin initialization failed", e)
+ context.logger.error("ApkAnalyzer: Plugin initialization failed", e)
false
}
}
override fun activate(): Boolean {
- context.logger.info("ApkViewer: Activating plugin")
+ context.logger.info("ApkAnalyzer: Activating plugin")
return true
}
override fun deactivate(): Boolean {
- context.logger.info("ApkViewer: Deactivating plugin")
+ context.logger.info("ApkAnalyzer: Deactivating plugin")
return true
}
override fun dispose() {
- context.logger.info("ApkViewer: Disposing plugin")
+ context.logger.info("ApkAnalyzer: Disposing plugin")
}
// UIExtension - Main menu toolbar item
@@ -62,6 +66,7 @@ class ApkViewer : IPlugin, UIExtension, EditorTabExtension, FileOpenExtension {
title = "APK Analyzer",
isEnabled = true,
isVisible = true,
+ tooltipTag = HELP_TOOLTIP_TAG,
action = {
context.logger.info("APK Analyzer menu item clicked")
openApkAnalyzerTab()
@@ -72,14 +77,14 @@ class ApkViewer : IPlugin, UIExtension, EditorTabExtension, FileOpenExtension {
// UIExtension - Bottom sheet tab
override fun getEditorTabs(): List {
- context.logger.debug("ApkViewer: getEditorTabs() called")
+ context.logger.debug("ApkAnalyzer: getEditorTabs() called")
return listOf(
TabItem(
- id = "apk_viewer_tab",
+ id = "apk_analyzer_tab",
title = "APK Analyzer",
fragmentFactory = {
- context.logger.debug("ApkViewer: Creating ApkAnalyzerFragment for bottom sheet")
+ context.logger.debug("ApkAnalyzer: Creating ApkAnalyzerFragment for bottom sheet")
ApkAnalyzerFragment()
},
isEnabled = true,
@@ -100,11 +105,30 @@ class ApkViewer : IPlugin, UIExtension, EditorTabExtension, FileOpenExtension {
isVisible = true,
group = "tools",
order = 0,
+ tooltipTag = HELP_TOOLTIP_TAG,
action = { openApkAnalyzerTab() }
)
)
}
+ override fun getTooltipCategory(): String = "plugin_${context.pluginId}"
+
+ override fun getTooltipEntries(): List {
+ return listOf(
+ PluginTooltipEntry(
+ tag = HELP_TOOLTIP_TAG,
+ summary = "This plugin provides detailed structural analysis of an APK within Code on the Go without requiring additional external tools.",
+ buttons = listOf(
+ PluginTooltipButton(
+ description = "Learn More",
+ uri = "i/plugins-adfa.html",
+ directPath = true,
+ )
+ )
+ )
+ )
+ }
+
// EditorTabExtension - Main editor tab to display the analyzer
override fun getMainEditorTabs(): List {
return listOf(
@@ -165,7 +189,7 @@ class ApkViewer : IPlugin, UIExtension, EditorTabExtension, FileOpenExtension {
return listOf(
FileTabMenuItem(
- id = "apk_viewer.analyze",
+ id = "apk_analyzer.analyze",
title = "Analyze APK",
order = 0,
action = {
diff --git a/apk-viewer/src/main/kotlin/com/example/sampleplugin/fragments/ApkAnalyzerFragment.kt b/apk-viewer/src/main/kotlin/com/example/sampleplugin/fragments/ApkAnalyzerFragment.kt
index a2da07cf..2053327e 100644
--- a/apk-viewer/src/main/kotlin/com/example/sampleplugin/fragments/ApkAnalyzerFragment.kt
+++ b/apk-viewer/src/main/kotlin/com/example/sampleplugin/fragments/ApkAnalyzerFragment.kt
@@ -37,7 +37,7 @@ data class TableSection(
class ApkAnalyzerFragment : Fragment() {
companion object {
- private const val PLUGIN_ID = "com.example.apkviewer"
+ private const val PLUGIN_ID = "com.example.apkanalyzer"
private const val MAX_LARGE_FILES_DISPLAYED = 10
private const val FALLBACK_SURFACE = 0xFFFFFBFE.toInt()
private const val FALLBACK_SURFACE_VARIANT = 0xFFE7E0EC.toInt()