Skip to content

Commit

Permalink
Merge pull request #57 from KuhakuPixel/feature
Browse files Browse the repository at this point in the history
ATG: add default port (56666) when connecting to ACE server
  • Loading branch information
KuhakuPixel authored Sep 7, 2023
2 parents f646d20 + 7af1102 commit cf14f24
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 6 deletions.
1 change: 1 addition & 0 deletions ATG/app/src/main/java/com/kuhakupixel/atg/backend/ACE.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ private synchronized void AssertNoAttachInARow() {
throw new AttachingInARowException("Cannot Attach without DeAttaching first");
}

// TODO: add statusPublisherPort as parameter
public synchronized void ConnectToACEServer(Integer port) throws IOException, InterruptedException {
AssertNoAttachInARow();
this.aceAttachClient = new ACEAttachClient(port);
Expand Down
12 changes: 12 additions & 0 deletions ATG/app/src/main/java/com/kuhakupixel/atg/backend/ACEPort.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.kuhakupixel.atg.backend;

public class ACEPort {
/*
* if we can, we start ACE server on port found by the apk
*
* however its not possible for non rooted method where the apk
* starts its own service via its own port
* */
public static int defaultPort = 56666;
public static int defaultStatusPublisherPort = 56667;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class OverlayInputDialog(
)
}

fun show(title: String, onConfirm: (input: String) -> Unit) {
fun show(title: String, defaultValue: String = "", onConfirm: (input: String) -> Unit) {
this.valueInput.value = defaultValue
super.show(
title = title,
onConfirm = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ fun onNextScanClicked(
onBeforeScanStart()
val statusPublisherPort = ace.getStatusPublisherPort()
CompletableFuture.supplyAsync<Unit> {
// This simulates an expensive operation
Thread.sleep(1000)
"Hello, world!"

// set the value type
if (!scanOptions.initialScanDone) ace.SetNumType(scanOptions.numType)
/**
Expand Down
2 changes: 2 additions & 0 deletions ATG/app/src/main/java/com/kuhakupixel/atg/ui/menu/Process.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.kuhakupixel.atg.R
import com.kuhakupixel.atg.backend.ACE
import com.kuhakupixel.atg.backend.ACEPort
import com.kuhakupixel.atg.backend.ProcInfo
import com.kuhakupixel.atg.ui.GlobalConf
import com.kuhakupixel.atg.ui.util.CreateTable
Expand Down Expand Up @@ -252,6 +253,7 @@ fun ProcessMenu(globalConf: GlobalConf?, overlayContext: OverlayContext?) {

OverlayInputDialog(overlayContext!!).show(
"Port: ",
defaultValue = ACEPort.defaultPort.toString(),
onConfirm = { input: String ->
val port = input.toInt()
if (ace.IsAttached())
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ after download, you should have folder called
`online.limitless.appleknight.free`
#### Attaching memory scanner
```
./modder patch online.limitless.appleknight.free/ true
./modder patch online.limitless.appleknight.free/
```
this will take a while since it has to recompile,
attach memory scanner, recompile and resign the apk
Expand Down
15 changes: 15 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# ChangeLog
## [0.1.1]

### Fixed
- [Modder] installation fails when Apk's `AndroidManifests.xml` 's `extractNativeLib=false`
- [Modder] patch fails with exception `can't find launchable activity` because of
using `aapt1` instead of `aapt2`

### Added
- [APK] add default port when pressing `Connect to ACE's server`
- [Modder] `sign` command to sign apk

### Changed
- [Modder] simplify `patch` command

### Removed

## [0.1.0]

Expand Down

0 comments on commit cf14f24

Please sign in to comment.