hex/android/app/proguard-rules.pro
Ryan Vogel 71d87bf5d9 Android: keep Parakeet's JNI methods through R8, and debug-only ways to watch the faster model
- proguard-rules.pro keeps ly.anoma.hex.speech.Parakeet's native methods by name, as it does Whisper's;
  the preview build's dex has the class (dexdump).
- hexenglish.cpp logs, in debug builds only, the same kind of line hexspeech.cpp does: "english complete|
  abandoned|failed in N ms, N samples, N terms", never audio or words. It times ✕ and the decode on the
  emulator.
- Debug builds only: "adb shell setprop log.tag.HexLowMemory DEBUG" acts out a memory shortage, so the
  low-memory fallback and its note can be seen end to end. Release and preview builds never read it
  (BuildConfig.DEBUG, and R8 makes Log.isLoggable false there).

Verified: assembleDebug, assemblePreview and the unit tests pass.
2026-11-24 13:09:19 -05:00

19 lines
636 B
Prolog

# libhexspeech and libhexenglish resolve these classes and methods by their JNI names.
-keep class ly.anoma.hex.speech.Whisper {
native <methods>;
}
-keep class ly.anoma.hex.speech.Parakeet {
native <methods>;
}
# Drop diagnostic calls from managed release code, including dependencies.
-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int) return false;
public static int v(...);
public static int d(...);
public static int i(...);
public static int w(...);
public static int e(...);
public static int wtf(...);
public static int println(...);
}