Hello, I find it a very interesting project and would like to give visibility to the tutorial in this post, the script works well with current APKs although of course improvable, I encourage whoever has knowledge to develop a new update of the script.
There are apps installed on Wear OS (especially those that come from Android) that have a giant interface and do not adapt well to the small size of the watch screen, which prevents to reach certain options from the watch. The guide allows you to change the density of a given app without affecting the density of the rest of the apps on the watch, WearModder was developed by user
@moneytoo. Unfortunately, the tool has not been updated for at least 2 years, however the WearModder source code is available
here (in java) for those who have knowledge and want to improve it, also another developer has ported the tool to Python, also available from
this other link.
Both the script and the steps to use it are simple, so anyone can try it with their favorite applications.
What does WearModder do?
The WearModder tool is a small script that modifies the density of an APK to fit the size of the watch. The script automatically does the following:
- Replaces all sizes (dip/sp in layouts, dimens, etc.).
- Sets centered alignment of the bottom tab layout
- Sets custom height for action bar (in ActionBarSize element)
- Set horizontal margin for toolbar (home screen only)
Prerequisites:
- Download and install the Java 8 tool (JRE 1.8) from here.
- Download APKTool from here (tool for decompiling APK files)
- Download WearModder from here in java or from here in Python (tool to modify the density of APK files).
- If you use WearModder for Python, download and install Python from here.
The Guide. How to change the density of an app or game on Wear OS
- Rename Apktool file you downloaded to "apktool.jar" (no version) and Wearmodder file you downloaded to "wearmodder.jar" (no version).
- Place in the same folder apktool.jar file, Wearmodder.jar file and APK file you want to modify its density.
- Now open a command line in that folder and enter the following to decompile APK file.
Code:
Java -jar apktool.jar d apk_name.apk
- Once decompiled, enter the following to modify apk resources:
Code:
- With Java version: java -jar WearModder.jar apk_name/res
- With Python version: python ./wearmodder.py ./apk_name/res
- According to the author of the guide additional manual adjustments must be made, however he does not give any guidelines nor has he developed this step, I suppose it is not always necessary.
- Build APK file again. The modified APK file will be saved in "/apk_name/dist/" folder.
Code:
java -jar apktool.jar b apk_name
- Ingrese los siguientes comandos para firmarlo . Le pedirá una nueva contraseña y alguna otra información.
[CÓDIGO]keytool -genkey -v -keystore my-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-key.keystore apk_name/dist/apk_name.apk alias_nombre[/CÓDIGO]
Consideraciones:
- Asegúrese de tener configurada la variable de entorno para Java para que Java se pueda ejecutar desde cualquier carpeta, lo mismo para Python si va a usar la versión Python de WearModder. Aquí hay una guía para agregar la variable de entorno para python y aquí para Java.
- En los pasos 3, 4, 6 y 7, reemplace el comando "apk_name" con el nombre del archivo APK que se modificará.
- En el paso 7, reemplace " my-key " y " alias_name " con el nombre de la contraseña y el alias de almacenamiento que desea.
- Si tiene problemas para usar WearModder en Java , puede usar WearModder portado a Python. Cuando probé con la aplicación Seven (apk de la captura), la versión de Java modificó el APK pero cuando volví a compilar el APK algo andaba mal, con la versión de Python modifiqué y construí con ApkTool la aplicación perfectamente.
- No ejecute WearModder más de una vez en el mismo archivo que ya ha modificado.