Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/build_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build --no-daemon

- name: Upload artifacts
uses: actions/upload-artifact@v6
with:
name: morphe-patches
path: build/libs/morphe-cli-*-all.jar

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ google-services.json

# Android Profiling
*.hprof

# NPM modules
node_modules/
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}
],
[
"@saithodev/semantic-release-backmerge",
"@cleyrop-org/semantic-release-backmerge",
{
backmergeBranches: [{"from": "main", "to": "dev"}],
clearWorkspace: true
Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
# [1.4.0-dev.6](https://github.com/MorpheApp/morphe-cli/compare/v1.4.0-dev.5...v1.4.0-dev.6) (2026-02-19)


### Features

* Add `--options-file` json patch/option configuration ([#53](https://github.com/MorpheApp/morphe-cli/issues/53)) ([44943da](https://github.com/MorpheApp/morphe-cli/commit/44943da5f40f8ec37364d4f67b9d2e82d2b5e98f))

# [1.4.0-dev.5](https://github.com/MorpheApp/morphe-cli/compare/v1.4.0-dev.4...v1.4.0-dev.5) (2026-02-14)


### Bug Fixes

* Do not log patch name more than once if disabled ([#49](https://github.com/MorpheApp/morphe-cli/issues/49)) ([b980bb8](https://github.com/MorpheApp/morphe-cli/commit/b980bb8e0b3bf8eb4c7af1fe289ff1b63c437fa3))

# [1.4.0-dev.4](https://github.com/MorpheApp/morphe-cli/compare/v1.4.0-dev.3...v1.4.0-dev.4) (2026-02-14)


### Bug Fixes

* Allow enabling/disabling patches using case insensitive patch names ([#48](https://github.com/MorpheApp/morphe-cli/issues/48)) ([03a280a](https://github.com/MorpheApp/morphe-cli/commit/03a280abea6c9187eec22548707eb889b0252c3f))

# [1.4.0-dev.3](https://github.com/MorpheApp/morphe-cli/compare/v1.4.0-dev.2...v1.4.0-dev.3) (2026-02-12)


### Features

* Add `--continue-on-error` argument, return non zero exit code if patching fails ([#47](https://github.com/MorpheApp/morphe-cli/issues/47)) ([255646b](https://github.com/MorpheApp/morphe-cli/commit/255646b250237087ab7d7f9733daa6751b7e4016))

# [1.4.0-dev.2](https://github.com/MorpheApp/morphe-cli/compare/v1.4.0-dev.1...v1.4.0-dev.2) (2026-02-10)


### Features

* Add `--striplibs` argument to strip unwanted architectures ([#46](https://github.com/MorpheApp/morphe-cli/issues/46)) ([7442d94](https://github.com/MorpheApp/morphe-cli/commit/7442d942d392b3e1e9ce959c30db8460bffee8d6))

# [1.4.0-dev.1](https://github.com/MorpheApp/morphe-cli/compare/v1.3.0...v1.4.0-dev.1) (2026-02-07)


### Features

* Support patching APKM bundles ([#40](https://github.com/MorpheApp/morphe-cli/issues/40)) ([bfe43d0](https://github.com/MorpheApp/morphe-cli/commit/bfe43d0b747d0e336a3f36f048e85907a140f1fc))

# [1.3.0](https://github.com/MorpheApp/morphe-cli/compare/v1.2.0...v1.3.0) (2026-02-04)


Expand Down
8 changes: 8 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ outside this repository, and do not change the terms of the GPLv3 license.
For the full license text, see the LICENSE file or:
https://www.gnu.org/licenses/gpl-3.0.html

7b. Attribution Requirement
---------------------------

Any distributed source code that incorporates Morphe CLI,
including modified versions and derivative works, must retain this NOTICE file.

https://morphe.software

7c. Project Name Restriction
----------------------------

Expand Down
27 changes: 26 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,33 @@ repositories {
maven { url = uri("https://jitpack.io") }
}

val apkEditorLib by configurations.creating

val strippedApkEditorLib by tasks.registering(org.gradle.jvm.tasks.Jar::class) {
archiveFileName.set("APKEditor-cli.jar")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
doFirst {
from(apkEditorLib.resolve().map { zipTree(it) })
}
exclude(
"org/xmlpull/**",
"antlr/**",
"org/antlr/**",
"com/beust/jcommander/**",
"javax/annotation/**",
"smali.properties",
"baksmali.properties"
)
}

dependencies {
implementation(libs.morphe.patcher)
implementation(libs.morphe.library)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.serialization.json)
implementation(libs.picocli)
apkEditorLib(files("$rootDir/libs/APKEditor-1.4.7.jar"))
implementation(files(strippedApkEditorLib))

testImplementation(libs.kotlin.test)
}
Expand Down Expand Up @@ -65,7 +86,11 @@ tasks {
}

shadowJar {
exclude("/prebuilt/linux/aapt", "/prebuilt/windows/aapt.exe", "/prebuilt/*/aapt_*")
exclude(
"/prebuilt/linux/aapt",
"/prebuilt/windows/aapt.exe",
"/prebuilt/*/aapt_*",
)
minimize {
exclude(dependency("org.bouncycastle:.*"))
exclude(dependency("app.morphe:morphe-patcher"))
Expand Down
45 changes: 31 additions & 14 deletions docs/1_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ You can list patches, patch an app, uninstall, and install an app.
## 🚀 Show all commands

```bash
java -jar morphe-cli.jar -h
java -jar morphe-cli.jar --help
```

## 📃 List patches
Expand All @@ -21,13 +21,7 @@ java -jar morphe-cli.jar list-patches --with-packages --with-versions --with-opt
To patch an app using the default list of patches, use the `patch` command:

```bash
java -jar morphe-cli.jar patch -p patches.mpp input.apk
```

You can also use multiple MPP files:

```bash
java -jar morphe-cli.jar patch -p patches.mpp -p another-patches.mpp input.apk
java -jar morphe-cli.jar patch --patches patches.mpp input.apk
```

To change the default set of enabled or disabled patches, use the option `-e` or `-d` to enable or disable specific patches.
Expand All @@ -37,7 +31,7 @@ To only enable specific patches, you can use the option `--exclusive` combined w
Remember that the options `-e` and `-d` match the patch's name exactly. Here is an example:

```bash
java -jar morphe-cli.jar patch -p patches.mpp --exclusive -e "Patch name" -e "Another patch name" input.apk
java -jar morphe-cli.jar patch --patches patches.mpp --exclusive -e "Patch name" -e "Another patch name" input.apk
```

You can also use the options `--ei` or `--di` to enable or disable patches by their index.
Expand All @@ -51,13 +45,13 @@ java -jar morphe-cli.jar list-patches patches.mpp
Then you can use the indices to enable or disable patches:

```bash
java -jar morphe-cli.jar patch -p patches.mpp --ei 123 --di 456 input.apk
java -jar morphe-cli.jar patch --patches patches.mpp --ei 123 --di 456 input.apk
```

You can combine the option `-e`, `-d`, `--ei`, `--di` and `--exclusive`. Here is an example:

```bash
java -jar morphe-cli.jar patch -p patches.mpp --exclusive -e "Patch name" --ei 123 input.apk
java -jar morphe-cli.jar patch --patches patches.mpp --exclusive -e "Patch name" --ei 123 input.apk
```


Expand All @@ -79,6 +73,8 @@ java -jar morphe-cli.jar patch -p patches.mpp --exclusive -e "Patch name" --ei 1
> adb install input.apk
> ```

## 📃 Patch options

Patches can have options you can set using the option `-O` alongside the option to include the patch by name or index.
To know the options of a patch, use the option `--with-options` when listing patches:

Expand All @@ -91,15 +87,36 @@ For example, to set the options for the patch with the name `Patch name`
with the key `key1` and `key2` to `value1` and `value2` respectively, use the following command:

```bash
java -jar morphe-cli.jar patch -p patches.mpp -e "Patch name" -Okey1=value1 -Okey2=value2 input.apk
java -jar morphe-cli.jar patch --patches patches.mpp -e "Patch name" -Okey1=value1 -Okey2=value2 input.apk
```

If you want to set the option value to `null`, you can omit the value:

```bash
java -jar morphe-cli.jar patch -p patches.mpp -i "Patch name" -Okey1 input.apk
java -jar morphe-cli.jar patch --patches patches.mpp -i "Patch name" -Okey1 input.apk
```

## 📃 Patch option json

Generate a template patch options file, or update your existing file (remove invalid json, add missing json):
```bash
java -jar morphe-cli.jar options-create --patches patches.mpp --out options.json
```

After modifying the json file to include/exclude patches or set any patch options, use the file with `--options-file`:
```bash
java -jar morphe-cli.jar patch --patches patches.mpp --options-file options.json input.apk
```

To patch with an options.json and update the json (same functionality as `options-create` above),
then add parameter `--options-update`:
```bash
java -jar morphe-cli.jar patch --patches patches.mpp --options-file options.json --options-update input.apk
```


## 📃 List patches

> [!WARNING]
> Option values are usually typed. If you set a value with the wrong type, the patch can fail.
> The value types can be seen when listing patches with the option `--with-options`.
Expand Down Expand Up @@ -131,7 +148,7 @@ java -jar morphe-cli.jar patch -p patches.mpp -i "Patch name" -Okey1 input.apk
> Example command with an escaped integer as a string:
>
> ```bash
> java -jar morphe-cli.jar -p patches.mpp -e "Patch name" -OstringKey=\'1\' input.apk
> java -jar morphe-cli.jar --patches patches.mpp -e "Patch name" -OstringKey=\'1\' input.apk
> ```
## 📦 Install an app manually

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 1.3.0
version = 1.4.0-dev.6
Binary file added libs/APKEditor-1.4.7.jar
Binary file not shown.
Loading
Loading