Skip to content

Instantly share code, notes, and snippets.

@adil192
Last active April 8, 2024 08:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adil192/ab95808fb66b6cde3d63ded6c19b0f1d to your computer and use it in GitHub Desktop.
Save adil192/ab95808fb66b6cde3d63ded6c19b0f1d to your computer and use it in GitHub Desktop.
Galaxy Wearable patch for Samsung phones with custom ROMs

Galaxy Wearable patch for Samsung phones with custom ROMs

See https://github.com/adil192/SamsungAppsPatcher for the updated version of this guide. This gist is now unmaintained, but may work on other operating systems.

Requirements

(Same as the above link.)

Generating a certificate

(Same as the above link. You are still welcome/encouraged to use the provided keystore.jks and ks-pass.txt.)

Patching the apps

  1. Download the apks of each of these (I got them from apkmirror.com, links for each app provided in the full guide). I also got the galaxy buds plugin (com.samsung.accessory.fridaymgr).

    1. Samsung Accessory (com.samsung.accessory)
    2. Galaxy Wearable (com.samsung.android.app.watchmanager)
    3. Galaxy Watch PlugIn (com.samsung.android.geargplugin)
    4. Samsung Health (com.sec.android.app.shealth)
  2. Rename each apk to something simpler (e.g. rename the Galaxy Watch PlugIn app to geargplugin.apk and so on) and move them to a samsungapps/apks folder. Additionally, create a samsungapps/patched folder to hold your patched apks.

  3. Open a terminal in the samsungapps folder. Do the following to patch wearable.apk (Galaxy Wearable):

    1. Install framework with apktool if apks/wearable.apk.

    2. Decompile with apktool d apks/wearable.apk.

    3. Change to the wearable folder with cd wearable.

    4. Use dansimko's command to remove the samsung check:

      find . -type f -name "*.smali" -exec sed -i 's/sget-object \(v\|p\)\(.\+\), Landroid\/os\/Build;->\(MANUFACTURER\|BRAND\):Ljava\/lang\/String;/const-string \1\2, \"letitbeheardthisphoneistobetreatedasifitwereofabranddifferentfromtheonestartingwiths\"/g' "{}" \;
    5. If this app needs patching (i.e. a patch for it exists in the patches folder), run the following with the right filename. I don't know if this works in Windows or macOS, so you might need to look up how to apply a patch with your OS.

      patch -p0 -d . < ../patches/wearable_remove_device_restrictions.patch
    6. Go back a directory with cd ../ and rebuild the apk with apktool b watchmanager --use-aapt2.

    7. In the samsungapps/wearable/dist folder, you should find a wearable.apk. We need to zipalign this and then sign it.

      zipalign -f -p 4 wearable/dist/wearable.apk patched/wearable.apk
      apksigner sign --ks keystore.jks --ks-pass file:ks-pass.txt patched/wearable.apk
  4. Repeat the above for the other apps.

  5. You should now have all your new patched apps in the samsungapps/patched folder. Install these apks to your phone, and go through the regular setup.

MEGA Drive

(Find the pre-made downloads on the main repo here.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment