Skip to content

Instantly share code, notes, and snippets.

@keewon
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keewon/9920785f5cfcb2c82f88 to your computer and use it in GitHub Desktop.
Save keewon/9920785f5cfcb2c82f88 to your computer and use it in GitHub Desktop.
Fixing crash of Crema app on Android 5.0

In short, open the source, change Security.addProvider(something); to Security.insertProviderAt(something, 1);

Background

Android 5.0 (and 5.0.1) has a problem with SpongyCastle (https://code.google.com/p/android/issues/detail?id=68562)

Crema Android App also has this problem, but it can be avoided by following instruction on the Spongy Castle home.

I already fixed mine, but can't share it due to legal issue. Instead, I share DIY fix instruction.

How to fix

  1. Get crema APK using any tool. Let me call it crema.apk.
  2. Install apktool
  3. Decompile it: apktool d crema.apk
  4. Edit crema/smali/kr/co/hancom/ebook/drm/client/keph/KEPHDRMClientAgentFactory.smali
  5. Find
invoke-static/range {v21 .. v21}, Ljava/security/Security;->addProvider(Ljava/security/Provider;)I
  1. Change it to following:
const v22, 0x1
invoke-static/range {v21 .. v22}, Ljava/security/Security;->insertProviderAt(Ljava/security/Provider;I)I
  1. Recompile: apktool b crema
  2. New APK is in crema/dist/crema.apk
  3. Sign it: http://developer.android.com/tools/publishing/app-signing.html#signing-manually
  4. (Optional) Uninstall previous one: adb uninstall co.kr.kepub.crema
  5. Install new one: adb install crema/dist/crema.apk
  6. Run the app.
  7. Enjoy!

Tags

크레마, 안드로이드, 롤리팝, 크래시, 에러

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