ManageEngine: Inline images dropped

In ManageEngine ServiceDeskPlus MSP it is notifying receipients and senders when an inline image is dropped/not processed. To disable this notification, perform the following steps to update the database.

Run the query on the database. If using Postgres bundled with ME SDP MSP, this is the query.

update GlobalConfig set paramvalue='false' where category like 'EMAIL_PROCESSING' and parameter like 'sendAttachmentStrippedNotification';

To use Postgres, navigate to your ME SDP MSP installation location in a command prompt, for example C:\ManageEngine\ServiceDeskPlus-MSP and into sub-folder pgsql\bin.

pgsql -h 127.0.0.1 -U sdpadmin -p 65432 -d servicedesk

It will prompt for the database password. If you do not know this password, you can decrypt it using ME tool found in your ME SDP MSP bin folder, for example, C:\ManageEngine\ServiceDeskPlus-MSP\bin\decryptPostgresPassword.bat. Make sure to record the password in a safe location.

How to Decompile, Modify, and Rebuild an APK File

If you’re interested in modifying Android APK files—whether to explore their inner workings or customize them for personal use—this guide will take you through the essential tools and steps needed to decompile, make changes, and recompile APKs. Below, we’ll cover the main tools involved in this process and give you step-by-step instructions.

Tools You’ll Need

  1. apktool: A tool for reverse engineering APK files. It’s used to extract and rebuild the APK after making changes.
  2. keytool: A Java tool for generating keys and certificates, included with the JDK.
  3. jarsigner: A Java tool for signing JAR and APK files, also included with the JDK.
  4. zipalign: An archive alignment tool from the Android SDK for optimizing APK files.
  5. JD-GUI: A graphical utility for viewing Java source code.
  6. dex2jar: Converts Android DEX files into Java class files.

Step-by-Step Instructions

Step 1: Decompile the APK

The first step in modifying an APK is to decompile it to access the resources, code, and assets. Use the apktool to decompile the APK.

Run the following command in your terminal:

apktool d -r -s application.apk

Alternatively, if you don’t need the resources and only want the code, you can use:

apktool d application.apk

This will create a folder named application, which contains the assets, resources, and compiled code of the APK.

Step 2: Convert DEX Files to Java Class Files (Optional)

If you want to inspect or modify the Java code, you can convert the DEX (Dalvik Executable) files to standard Java class files. Skip this part if you only want to edit resources or the manifest.

  1. Convert the DEX files to JAR files using dex2jar: dex2jar application/classes.dex
  2. Use JD-GUI to inspect the generated JAR file: jd-gui classes-dex2jar.jar

You can now view the Java code, make any necessary changes, or simply inspect it for your own knowledge.

Step 3: Modify the APK (Optional)

You can now make changes to the APK. For example:

  • Change the orientation of the main activity in the AndroidManifest.xml file.
  • Modify strings or other resources in strings.xml or the res folder.

Make the desired modifications before proceeding to the next step.

Step 4: Rebuild the APK

After making your changes, you need to recompile (rebuild) the APK using apktool.

Run the following command:

apktool b -f -d application

This will generate the modified APK in the Dist folder. The newly compiled APK will be named application.apk.

Step 5: Sign the APK

Before installing the APK on your device, you need to sign it to ensure its authenticity. If you don’t already have a key, you can generate one using keytool.

  1. Create a key using the following command: keytool -genkey -v -keystore my-release-key.keystore -alias alias_name \ -keyalg RSA -keysize 2048 -validity 10000 You’ll be prompted to set a password for the keystore.
  2. Sign the APK using jarsigner: jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore my-release-key.keystore my_application.apk alias_name
  3. To verify the APK, use this command:bashCopy codejarsigner -verify -verbose -certs my_application.apk

Step 6: Align the APK

For optimal performance when loading the APK on an Android device, you should align it using zipalign.

Run the following command:

zipalign -v 4 my_application.apk my_application-aligned.apk

This will create the aligned APK, named my_application-aligned.apk.

Note: If you use apksigner, the alignment must be done before signing. The recommended method is to use apksigner, not jarsigner.

Step 7: Install the APK

Now that you have the modified and signed APK, you can install it onto your Android device.

Final Thoughts

By following these steps, you can easily decompile, modify, and recompile an APK file to suit your needs. Whether you want to inspect the Java code, change resources, or just tweak settings, this process provides a comprehensive approach to working with Android APKs.

If you’re working on a project that requires in-depth APK modifications, these tools and steps will be indispensable. Happy decompiling!

Get Vendor from MAC Address

Here’s a quick snippet to get the IP, MAC address and Vendor using PowerShell in Windows with the native arp -a command and curl. It is based on accessing my MAC lookup tool.

$arpOutput = arp -a

foreach ($line in $arpOutput) {
if ($line -match '(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+([a-fA-F0-9:-]{17})') {
$ip = $matches[1]
$mac = $matches[2]
$vendor = curl https://techish.net/mac/$mac
Write-Output "IP: $ip, MAC: $mac, Vendor: $vendor"
}
}

Note: You could do a quick ping sweep of the network you’re on so that the arp cache is fresh:

for /l %x in (1,1,254) do @ping -n 1 -w 25 192.168.0.%x | find /I "bytes="

Note: I have setup a script you can use with PowerShell to do a scan and output the data in comma delimited format.

irm https://techish.net/mac/scan | iex

You can save to a CSV using something like this

irm https://techish.net/mac/scan | iex | out-file scan.csv -encoding UTF8

You could also output to clipboard

irm https://techish.net/mac/scan | iex | clip