-
-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Add desktop GUI #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
Maybe we relocate the 'Code Preview' and the 'Suggested Deselected Patches' sections to the TopBar in the Patch Selection Screen? It's kinda looks ugly and cramped right now I feel. Will try to figure something out for this soon. |
|
If code preview you mean the CLI command, then yes it can be at the top of the screen. It can be show if "expert mode" is enabled. The simplified mode setting can be inverted to "expert mode" and it's default off, to match Android Manager app. Suggested deselected patches can be removed entirely. Patches already declare if they are default included, and we don't want hard coded patch preferences or anything else. Ideally the only hard coded thing we should use, is a package name to app name lookup, so a human readable app name is shown and not the ugly package name. Eventually this will change so it's not needed, but for now it's ok. |
|
The simple mode progress UI stub can be removed too since it's not easy to use with CLI text usage. |
Got it. I'll remove the suggested patches thingy entirely. Will integrate it into the patch card iteslf just like how mobile manager does it. |
Do I do what the normal mode does and show the progress bar just spinning but no actual number? |
|
Was looking at adding this #26 . Saw your comment https://github.com/MorpheApp/morphe-patches/issues/336 on keeping them separate for the manager and the CLI. So, we add a flag that keeps only our needed lib and deletes other libs right? Or we could make this a GUI only option too and the Expert Mode gets the option to do this now since we are able to track the user device's architecture if they are connected over ADB (or give them an option to choose). |
|
Rip-libs can be a cli argument. Can be something like
I think this should be do-able by deleting subdirectories before apktool recompiles the app. Or remove before zipping the files into the final apk, or possibly even remove from the apk after it's created. Deleting before APKTool would be preferred if possible, but whatever is simplest may be the best. |
|
If a patch is not recommended the patches.mpp file sets "use" to false right? For youtube, only 2 out of the 61 patches have this field set to false,so naturally the gui auto selects the rest 59 and unselects those 2 and then lets the user decide what they want to do. However on the mobile patcher seems to deselect many more patches and shows only 54/61 selected. How is it doing that? |
|
The Android Manager still auto selects all patches with But it will remember the last selected patches if using expert mode. Maybe you already patched using expert mode and excluded some patches? |
Ah, that's probably it. |
Added --riplibs like you said here. Right as it re-aligns the apk and before the signing it, it rips the libs that the user doesn't want. Right now it does it only for youtube. Will test and add reddit too since reddit says universal too. Size seems to be dropping by 50% for youtube. |
|
Please make a separate PR with riplibs. Can merge that now. |
9f434b7 to
089d21f
Compare
|
Add the CLI changes to the new PR, this PR has those changes and the GUI changes that riplibs needs. I am hoping I did it right here too? Those files won't cause nay conflicts in the future when this merges with dev branch right? |
|
Correct there shouldn't be problems after riplibs PR is merged. |
Added a device indicator on the top which allows to see if a device is connected or not. Other minor UI and logic fixes.
No more hardcoded disabled patches, directly read from the patches files Made a bunch of UI improvements for the patch screen. Simplified mode loading now shows a circular icon instead of making up progress numbers.
User can remove libs if they do not need it
We can now generate a single cross platform jar file. Fixed an issue where cache wasn't clearing on windows
No more code duplication. The patching logic is present in a central engine that both the cli and the gui can call to make it run however they want.
c972045 to
512f6f5
Compare
|
I had to rebase and force push to resolve conflicts. Reset your local repo to origin. Or delete your local branch and checkout your |
|
Yup, done. |
|
|
||
| // Important notice about APK handling | ||
| Text( | ||
| text = "Download the exact version from APKMirror and drop it here directly. Do not rename or modify the file.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this works if the APK has been renamed. This text could be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text = "Download the exact version from APKMirror and drop it here directly."
It just says this now. Maybe it could say something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Do not rename or modify the file. Could be removed.
Download the exact version from APKMirror and drop it here directly is good.
| modifier = Modifier.size(18.dp) | ||
| ) | ||
| Text( | ||
| text = "$count patch${if (count > 1) "es are" else " is"} unselected by default as they may cause issues or are not recommended by the patches team.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this "patches unselected" text is needed.
The patch selections screen only shows in expert mode, and it can be left to users to pick.
It seems the expert mode cannot deselect patches? I only see universal patches as an option to include. I cannot find a way to exclude Reddit patches during the patching UI flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patch selections screen only shows in expert mode, and it can be left to users to pick.
It just shows an info card just in case the users are curious about the default unselected patches. That can be removed if you want, no issues.
It seems the expert mode cannot deselect patches? I only see universal patches as an option to include. I cannot find a way to exclude Reddit patches during the patching UI flow.
Ahh, this is problem when you rename the apk. Will fix this now by asking the gui to read the package name from file's manifest instead.
| object YouTube { | ||
| const val DISPLAY_NAME = "YouTube" | ||
| const val PACKAGE_NAME = "com.google.android.youtube" | ||
| const val SUGGESTED_VERSION = "20.40.45" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested version can be parsed from the patches mpp file so it's not hard coded.
If needed can add a method PatchEngine or somewhere else if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It gets the info from the patches file itself. This is more of a fallback. But will change it to instead say app version not found if it fails.
| // ------------------------------------------------------------------------- | ||
| // Shadow JAR — the only distribution artifact | ||
| // ------------------------------------------------------------------------- | ||
| shadowJar { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional, but ideally we try to add Proguard to this to strip out unused code/libraries, because with the GUI CLI grows from ~55MB to ~170MB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main problem with the size is coming from having skiko libs for all the OS. But will add ProGuard tomorrow
| Spacer(modifier = Modifier.width(8.dp)) | ||
| Text( | ||
| when { | ||
| !allowCacheClear -> "Clear Cache (disabled during patching)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's optional, but we could extract all of these strings into string resource files. So if we later want to localize the GUI we can.
String files can be json or java property files. I think property files are better because they are easier to integrate into Crowdin and are friendlier to edit by hand.
Another option is using Kotlin localized strings with xml files.
We could do this now, later, or never.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add this a bit later. Seems like something that would really improve QoL
Minor fixes for various stuff
| // Show full architecture names for clarity | ||
| val formatted = archs.map { arch -> | ||
| when (arch) { | ||
| "arm64-v8a" -> "arm64-v8a" | ||
| "armeabi-v7a" -> "armeabi-v7a" | ||
| "x86_64" -> "x86_64" | ||
| "x86" -> "x86" | ||
| else -> arch | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove this left over code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the App Info Card rework in the pipelines. But will remove this code for now
|
this is an good idea, btw it won't be morphe cli anymore. there would be an method to use cli instead of gui? |
|
Existing terminal CLI still works exactly how it always has. The GUI is shown if the CLI jar is opened like an app (double click from file explorer). |
How about showing log text in a multi lines text box like RVX Builder?
Currently, there is still a lack of information on the patching screen. Benefits of showing logs:
|
|
It already does this in the expert mode. I had made that change only for the simplified mode |
|
Oh, I didn't know expert mode. I'm sorry. Btw, "Rebuilding APK..." log is not shown in Quick Patch mode |
|
Ok, I see this issue. Will fix this. If a patch takes longer than like 5 secs, I plan to put a message that says "Hold on.... this is taking longer than usual" but you are right on rebulding part. I'll fix that part |
|
Do any patches take more than 5 seconds? On my somewhat newish mid grade laptop every patch runs in less than 2 seconds. Some patches are less than 1/10 of a second. The majority of the patching time is APK processing itself (decoding, compiling, signing). |
|
None do, it's just the last rebuilding that takes a bit of time. Maybe adding that message might give the user assurance that it is still running. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Better patching logging Simplified version. Added --force for unsupported versions. Added a button for --continue-on-error to allow gui users to continue patching even when if a patch throws an error.
try patching now. It should properly show the stages in the simplified version |


The GUI update with most of the stuff. Some stuff might be broken, will keep fixing them as they appear. Also, please check the build.gradle.kts file once just to make sure I didn't mess up anything that the team might have added there.
Tired of using the old CLI? Not sure where to get what files to get the CLI running? Too busy to read the documentation? Worry not ladies and gentlemen, we present to you the Morphe GUI!
We got shiny new look coat of paint to suit your needs with more coming on the way!
Select the patch you want to use, including stable and dev patches!
See all the patches that will be applied even before they are applied! Are you a power user and want to make small tweak to the final command? With one click copy, your command will be all yours to experiment with! Also, see the morphe team's most deselected patches and decide if you want to listen to them :)
See the patch getting applied in real time just like how it does on the mobile patcher!
Directly install the app to your phone over ADB if you are plugged in to your computer and not worry about transferring the app and installting it again!
And in case you happen to be in a hurry want the entire process to be done ASAP, we got your back there too!
Visit your nearest morphe github to grab your CLI's GUI