Skip to content

Commit 209dfd4

Browse files
committed
first commit
0 parents  commit 209dfd4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4941
-0
lines changed

.github/workflows/release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Manisec Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
build-release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up JDK
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: temurin
22+
java-version: '21'
23+
24+
- name: Bump version
25+
id: bump
26+
run: |
27+
python - <<'PY'
28+
import os
29+
import re
30+
from pathlib import Path
31+
32+
pom = Path("pom.xml")
33+
text = pom.read_text(encoding="utf-8")
34+
m = re.search(r"(<version>)(\d+\.\d+\.\d+)(</version>)", text)
35+
if not m:
36+
raise SystemExit("Version not found in pom.xml")
37+
major, minor, patch = map(int, m.group(2).split("."))
38+
patch += 1
39+
new_version = f"{major}.{minor}.{patch}"
40+
text = text[:m.start(2)] + new_version + text[m.end(2):]
41+
pom.write_text(text, encoding="utf-8")
42+
print(new_version)
43+
out = os.environ.get("GITHUB_OUTPUT")
44+
if out:
45+
with open(out, "a", encoding="utf-8") as f:
46+
f.write(f"version={new_version}\n")
47+
PY
48+
49+
- name: Build
50+
run: mvn -DskipTests package
51+
52+
- name: Commit version bump
53+
run: |
54+
git config user.name "github-actions[bot]"
55+
git config user.email "github-actions[bot]@users.noreply.github.com"
56+
git add pom.xml
57+
git commit -m "chore: bump version to ${{ steps.bump.outputs.version }}" || exit 0
58+
git tag "manisec-${{ steps.bump.outputs.version }}"
59+
git push origin HEAD --tags
60+
61+
- name: Release
62+
uses: softprops/action-gh-release@v2
63+
with:
64+
tag_name: manisec-${{ steps.bump.outputs.version }}
65+
name: Manisec ${{ steps.bump.outputs.version }}
66+
files: target/manisec-${{ steps.bump.outputs.version }}.jar

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Maven
2+
/target/
3+
4+
# JVM
5+
*.class
6+
*.log
7+
hs_err_pid*
8+
9+
# IDEs
10+
.idea/
11+
*.iml
12+
.classpath
13+
.project
14+
.settings/
15+
.vscode/
16+
17+
# OS
18+
.DS_Store
19+
Thumbs.db

AGENTS.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
- `src/main/java/com/manifestsecurity/`: Java sources for the Jadx GUI plugin (scanner logic, UI, models).
5+
- `src/main/resources/`: plugin metadata and services registration (e.g., `META-INF/services/jadx.api.plugins.JadxPlugin`).
6+
- `pom.xml`: Maven build configuration and dependencies.
7+
- `target/`: build output (generated by Maven).
8+
9+
## Build, Test, and Development Commands
10+
- `mvn -DskipTests package`: Build the plugin JAR without tests. Output: `target/manisec-<version>.jar`.
11+
- `mvn package`: Standard build; use once tests are added.
12+
- `mvn -q -DskipTests package`: Quiet build for CI logs.
13+
14+
## Coding Style & Naming Conventions
15+
- Java 8 source/target (see `pom.xml`).
16+
- Indentation: 4 spaces; no tabs.
17+
- Naming: `PascalCase` for classes (e.g., `ManifestSecurityScanner`), `camelCase` for methods/fields, `UPPER_SNAKE_CASE` for constants.
18+
- Packages follow reverse-domain style: `com.manifestsecurity.*`.
19+
20+
## Testing Guidelines
21+
- No automated test framework is configured yet.
22+
- If adding tests, place them under `src/test/java` and name classes `*Test` (e.g., `ManifestSecurityScannerTest`).
23+
- Prefer JUnit 5 for new tests unless project requirements change.
24+
25+
## Commit & Pull Request Guidelines
26+
- No Git history is available in this workspace. Use concise, imperative commit messages (e.g., `Add exported component checks`).
27+
- PRs should include: a clear description, build instructions if changed, and screenshots for UI updates (e.g., report window changes).
28+
29+
## Security & Configuration Tips
30+
- This plugin analyzes `AndroidManifest.xml` for security-relevant signals; keep new checks fast and deterministic.
31+
- When adding new findings, update both the scanner and UI rendering to keep results aligned.

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Manisec
2+
3+
Jadx plugin that scans `AndroidManifest.xml` for security-relevant signals
4+
5+
## Showcase
6+
![](assets/report.png)
7+
8+
## Build
9+
```
10+
mvn -DskipTests package
11+
```
12+
Jar output:
13+
```
14+
target/manisec-<version>.jar
15+
```
16+
17+
## Install (Jadx GUI)
18+
- **Plugins → Install plugin** and pick the jar.
19+
- Or install **Manisec** directly from the Jadx plugin store.
20+
21+
## Usage
22+
- **Plugins → Manisec Report**

assets/report.png

157 KB
Loading

pom.xml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.manifestsecurity</groupId>
8+
<artifactId>manisec</artifactId>
9+
<version>0.1.0</version>
10+
<name>Manisec</name>
11+
12+
<properties>
13+
<maven.compiler.source>1.8</maven.compiler.source>
14+
<maven.compiler.target>1.8</maven.compiler.target>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16+
</properties>
17+
18+
<dependencies>
19+
<dependency>
20+
<groupId>io.github.skylot</groupId>
21+
<artifactId>jadx-core</artifactId>
22+
<version>1.5.3</version>
23+
<scope>provided</scope>
24+
</dependency>
25+
<dependency>
26+
<groupId>io.github.skylot</groupId>
27+
<artifactId>jadx-gui</artifactId>
28+
<version>1.5.3</version>
29+
<scope>provided</scope>
30+
</dependency>
31+
</dependencies>
32+
33+
<repositories>
34+
<repository>
35+
<id>google</id>
36+
<url>https://dl.google.com/android/maven2/</url>
37+
</repository>
38+
</repositories>
39+
40+
<build>
41+
<finalName>manisec-${project.version}</finalName>
42+
<resources>
43+
<resource>
44+
<directory>src/main/resources</directory>
45+
</resource>
46+
</resources>
47+
<plugins>
48+
<plugin>
49+
<groupId>org.apache.maven.plugins</groupId>
50+
<artifactId>maven-compiler-plugin</artifactId>
51+
<version>3.11.0</version>
52+
<configuration>
53+
<source>${maven.compiler.source}</source>
54+
<target>${maven.compiler.target}</target>
55+
</configuration>
56+
</plugin>
57+
<plugin>
58+
<groupId>org.apache.maven.plugins</groupId>
59+
<artifactId>maven-jar-plugin</artifactId>
60+
<version>3.3.0</version>
61+
<configuration>
62+
<archive>
63+
<manifest>
64+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
65+
</manifest>
66+
<manifestEntries>
67+
<Implementation-Title>Manisec</Implementation-Title>
68+
<Implementation-Version>${project.version}</Implementation-Version>
69+
</manifestEntries>
70+
</archive>
71+
</configuration>
72+
</plugin>
73+
</plugins>
74+
</build>
75+
</project>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package com.manifestsecurity;
2+
3+
import com.manifestsecurity.report.ReportModel;
4+
import com.manifestsecurity.ui.ManifestNavigator;
5+
import com.manifestsecurity.ui.ManifestSecurityDialog;
6+
import jadx.api.JadxDecompiler;
7+
import jadx.api.plugins.JadxPlugin;
8+
import jadx.api.plugins.JadxPluginContext;
9+
import jadx.api.plugins.JadxPluginInfo;
10+
import jadx.api.plugins.JadxPluginInfoBuilder;
11+
import jadx.api.plugins.gui.JadxGuiContext;
12+
13+
import javax.swing.JFrame;
14+
import javax.swing.SwingWorker;
15+
public class ManifestSecurityPlugin implements JadxPlugin {
16+
private final ManifestSecurityService service = new ManifestSecurityService();
17+
private JadxDecompiler decompiler;
18+
private JadxGuiContext guiContext;
19+
private ManifestSecurityDialog dialog;
20+
21+
@Override
22+
public JadxPluginInfo getPluginInfo() {
23+
return JadxPluginInfoBuilder.pluginId("manisec")
24+
.name("Manisec")
25+
.description("Manifest security analysis with navigable findings")
26+
.build();
27+
}
28+
29+
@Override
30+
public void init(JadxPluginContext context) {
31+
this.decompiler = context.getDecompiler();
32+
this.guiContext = context.getGuiContext();
33+
if (guiContext != null) {
34+
guiContext.addMenuAction("Manisec Report", this::openReport);
35+
}
36+
}
37+
38+
private void openReport() {
39+
if (decompiler == null || guiContext == null) {
40+
return;
41+
}
42+
JFrame frame = guiContext.getMainFrame();
43+
SwingWorker<ReportModel, Void> worker = new SwingWorker<ReportModel, Void>() {
44+
@Override
45+
protected ReportModel doInBackground() {
46+
return service.analyze(decompiler);
47+
}
48+
49+
@Override
50+
protected void done() {
51+
try {
52+
ReportModel report = get();
53+
if (dialog != null) {
54+
dialog.setVisible(false);
55+
dialog.dispose();
56+
}
57+
ManifestNavigator navigator = new ManifestNavigator(decompiler, guiContext, report.getManifestSource());
58+
dialog = new ManifestSecurityDialog(frame, report, navigator);
59+
dialog.showWindow();
60+
} catch (Exception ignored) {
61+
}
62+
}
63+
};
64+
worker.execute();
65+
}
66+
67+
}

0 commit comments

Comments
 (0)