AhMyth v1.0-beta.5a #369
Replies: 1 comment
-
Had to create this manually as I forgot to check the box to create a discussion for this release. Users can expect AhMyth to look a little bit different for the next release as I plan to make some major updates to the UI in order to give it a more modern look. I'll also be making a few client updates that quite a few users have requested for the next release as well. |
Beta Was this translation helpful? Give feedback.
-
This release is a Revision of v1.0-beta.5 which contained breaking bugs, these bugs have since been fixed, and a few new other updates were added to. This uses the same update information as the v1.0-beta.5 release, with the only changes to the info being where the bugs have been fixed.
See the Changelog below for more Update Information on this release.
Changelog
On Boot
&On Launch
checkbox names in the UI when binding is enabled, toBoot Method
&Activity Method
."$appCtrl.copyPermissions"
function to"$appCtrl.modifyManifest"
and Completely rewrote the function to utilise the"xml2js"
library when copying over permissions, it also now handles the injection of the payload service and receiver for the Activity and Boot methods for binding. This contains a lot more useful features than the legacy"$appCtrl.copyPermissions"
function. Click the dropdown tab below to see what the rewrite of this function does.What Does This new Update do
"$appCtrl.copyPermissions"
.data
andcallback
.CONSTANTS.permissions
.selectedPermissions
to store selected permissions.selectedPermissions
array.selectedPermissions
to default permissions array.selectedPermissions
to default permissions array.data
to a string if it's not already a string.xml2js.parseString
.callback
with an error message.manifest
object from the parsed XML result.manifestObj.application.receiver
is an array and convert it to an array if necessary.manifestObj.application.service
is an array and convert it to an array if necessary.Set
calledexistingPermissions
to store existing permissions.existingPermissions
set.existingPermissions
set.selectedPermissions
array to exclude duplicates and existing permissions.selectedPermissions
.manifestObj.application.receiver
andmanifestObj.application.service
arrays.xml2js.Builder
and modified manifest object.</application>
tag.</manifest>
tag with a new closing tag without extra newline.callback
with null (no error) and the final modified XML as the result."GetLauncherActivity"
function utilised by the"$appCtrl.BindOnLauncher"
function to make use of the"xml2js"
library to help in finding a suitable main class file for hooking from the manifest file data, this aids in solving Binding problems for Issue #315 When using the On Launch method for binding. Click the dropdown tab below for a step by step explanation of what the rewrite for this function does:What Does This new Update do?
It attempts to extract the
<application>
tag from the manifest object by accessingmanifest['manifest']['application'][0]
. This assumes that the manifest object has a structure wheremanifest
contains amanifest
property, which contains anapplication
property that is an array (hence the[0]
index).It then checks if the extracted
application
object exists and if it has anandroid:name
attribute (application['$']['android:name']
). Theandroid:name
attribute typically specifies the fully qualified class name of the main application class in the AndroidManifest.xml file.If the
android:name
attribute exists and the class name doesn't start with "android.app", it performs some manipulation on the class name. It splits the class name by the dot (.
) separator and takes the last part (i.e., the class name without the package). If the class name starts with a dot (.
), it removes the dot. Then it logs a message indicating that it has scoped the main application class for hooking and returns the manipulated class name appended with the ".smali" extension.If the previous step doesn't find the main application class, the function proceeds to search for the launcher activity. It looks for an
activity
object within theapplication
object that contains an intent filter with the action"android.intent.action.MAIN"
and category"android.intent.category.LAUNCHER"
or"android.intent.category.DEFAULT"
.It iterates over the
activity
objects in the manifest using theArray.prototype.find()
method and checks if any of them have an intent filter that matches the launcher conditions mentioned in the previous step. If it finds a matching activity, it retrieves theandroid:name
attribute of that activity.Similar to step 3, if the retrieved activity class name doesn't start with "android.app", it performs the same manipulation to get the class name without the package. If the class name starts with a dot (
.
), it removes the dot. Then it logs a message indicating that it has scoped the main launcher activity class for hooking and returns the manipulated class name with the ".smali" extension.If no launcher activity is found in the activities, the function checks for activity aliases (
activity-alias
objects) that have the same intent filter conditions as in step 4.It iterates over the
activity-alias
objects in the manifest and checks if any of them have an intent filter that matches the launcher conditions. If it finds a matching activity alias, it retrieves theandroid:targetActivity
attribute, which specifies the target activity of the alias.The target activity name is then manipulated in the same way as before (without the package and without a leading dot), logged as a message indicating that it has scoped the main launcher activity class in an alias for hooking, and returned with the
.smali
extension.If none of the above conditions match (no main application class, no launcher activity, and no launcher activity alias), the function returns -1 to indicate that the launcher activity couldn't be found.
"autoinstall"
file used for installing AhMyth from source on Linux so it correctly installs the needed dependencies, if they're already installed then the script will do nothing, the"autoinstall"
file for Linux has also been renamed from"autoinstall"
to"autoinstall_linux"
, the file has also been upgraded to correctly install AhMyth and its needed dependencies for Debian & APT Based Linux Distro's as well as Arch Linux & pacman based Linux Distro's"install.bat"
file for installing electron v11 for AhMyth on Windows to"autoinstall_win.bat"
"start_linux"
script for Linux Users that starts AhMyth correctly based on the users Privilege Level (i.e root | non-root)"start.bat"
file for starting AhMyth on Windows, to start and then minimize, so that the command prompt can start AhMyth in the background, the file has also been renamed from"start.bat"
to"start_win.bat"
"xml2js"
library."GetLauncherPath"
function utilized by the"$appCtrl.BindOnLauncher"
function to use readdirp, a cross platform recursive version of nodeJS'sfs.readdir()
, this allows AhMyth to recursively search an entire APK for a hookable class file when using the On Launch method for binding regardless of the platform it's running on! This function takes its namesake from the original"GetLauncherActivity"
function. This rewrite completely eliminates the need for installing external dependencies to run the Binding Features such as PowerShell for Windows, and findutils for macOS & Linux.$appCtrl.CopyAhmythFilesAndGenerateApk
to$appCtrl.copyAhmythFilesAndGenerateApk
.$appCtrl.BindOnLauncher
&$appCtrl.BindOnBoot
functions and instances to$appCtrl.bindOnActivity
&$appCtrl.bindOnBoot
.GetLauncherActivity
togetLauncherActivity
.GetLauncherPath
togetLauncherPath
.WriteErrorLog
towriteErrorLog
.[!] WARNING:
Deprecation message for 32bit users stating the AhMyth will cease support for Operating Systems running 32bit architecture as soon as Apktool reaches v3.0.0, the function also greets 64bit users with a green[★] Welcome to AhMyth
message.$appCtrl.generateApk
function so that certain functions for building standalone APK payload files dont interfere when the user is Binding with an original APK, such functions that did this included the following:The checkbox code in the generateApk function which is used for selecting and applying certain permissions for Standalone Payloads, this has now been updated to to apply permissions for Standalone Payloads only, the updated function also makes use of async/await to make sure everything runs smoothly and in order instead like buggy shit lol.
The checkbox code in the modifyManifest function which is used when binding to modify and original apk manifest.
Permissions for Bound and Standalone payloads are both taken care of seperately now and will no longer interfere with other functions, which fixes further performance bottlenecks.
"$appCtrl.createPayloadDirectory"
function which is now called inside the"$appCtrl.CopyAhmythFilesAndGenerateApk(apkFolder)"
function, which is called when using either the Activity or Boot methods for binding. This helps in solving"Unsigned Short Value Out of Range"
errors with Apktool when binding with original applications and also further aids in solving the binding problems with Issue #315. Click the drop down tab below for a step-by-step explanation of what the new function does.What Does This new Update do?
Reads the contents of the target APK folder, then filters and sorts the directories, excluding specific ones.
Determines what the last smali directory in the sorted list is. If the last directory is titled
smali
, then it creates a new directory namedsmali_classes2
, however if the last directory is not titledsmali
, the function then extracts the number from the name of the lastsmali_classesX
directory (where "X" is the number that's being extracted), then increments the extracted number by 1 to get a new number, which is then used to create a new directory namedsmali_classesX
(where "X" is the new number).Copies the payload files from the AhMyth payload's
smali
directory over to the newly created payload directory in the original APK.Removes specific subdirectories from the newly created directory to help bypass the 64k Dalvik Method when Building.
Then finally calls the
generateApk
function to build and sign the payload APK.Message log Attributes
Added the
[★]
attribute to all of the main Blue messages that get printed to the AhMyth GUI's black message box when a process is running.Added the
[¡]
information attribute to all of the Yellow information messages that get printed to the AhMyth GUI's message box to indicate that the corresponding text being shown in the message box is informative.Added the
[x]
attribute to all of the Red error messages that get printed to the AhMyth GUI's message box screen when something goes wrong.Added the
[✓]
attribute to all of the Green Success messages that get printed to the AhMyth GUI's message box screen when something goes has successfully finished doing what it's doing such asBuilding
, or when something has initiated successfully such asListening
"delayedLog"
function that delays the main logs printed to the black message box in the AhMyth GUI by0o500 seconds
(500 milliseconds)."WriteErrorLog"
function for better handling of logging errors to text files when errors such as"Building Failed!"
,"Signing Failed!"
, etc, arise."Stop"
button with the function that allows users to disconnect the AhMyth Server from EVERY active/connected client on specific ports, this is located next to theListen
button."clearLogs()"
function that clears the black Message Box of its logs each time the "Build", "Bind", "Browse APK", "Listen" & "Stop" buttons are clicked.Beta Was this translation helpful? Give feedback.
All reactions