here is some code sample to have a clear stack when your app is encrypted with proguard :
private static void trace(String txt) {
if (ENABLE_TRACE) {
Trace.trace(txt);
Trace.trace("\n");
System.out.println(txt);
}
}
public static String retrieveProguardStackInternal(String stack, File proguardFile,String sdkPath,String javaPath) {
String ret = stack;
trace("trying to uncrypt stack");
trace("==== raw stack ====");
trace(stack);
if ((stack == null) || (stack.length() == 0) || (proguardFile == null) || (!proguardFile.exists()) || (sdkPath == null) || (javaPath == null)) {
if ((stack == null) || (stack.length() == 0)) {
trace("empty stack => abort");
}
if (!proguardFile.exists()) {
trace("proguard file does not exists "+proguardFile.getAbsolutePath());
}
if (sdkPath == null) {
trace("sdk path not defined");
}
if (javaPath == null) {
trace("java path not defined");
}
return ret;
}
trace("sdk : "+sdkPath);
trace("jdk : "+javaPath);
StringBuilder sb = new StringBuilder();
sb.append(sdkPath);
sb.append(File.separatorChar);
sb.append("tools");
sb.append(File.separatorChar);
sb.append("proguard");
sb.append(File.separatorChar);
sb.append("lib");
sb.append(File.separatorChar);
sb.append("retrace.jar");
String retraceJarPath = sb.toString();
File retraceJar = new File(retraceJarPath);
if (!retraceJar.exists()) {
trace("proguard lib not found at "+retraceJarPath);
return ret;
}
sb = new StringBuilder();
sb.append(javaPath);
sb.append(File.separatorChar);
sb.append("java");
String javaexePath = sb.toString();
sb = new StringBuilder();
try {
// using the Runtime exec method:
Process p = Runtime.getRuntime().exec(new String[] {javaexePath,"-jar",retraceJarPath,proguardFile.getAbsolutePath()});
OutputStream out = p.getOutputStream();
out.write(stack.getBytes());
out.close();
BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
// read the output from the command
String line = null;
String lineSeparator = System.getProperty("line.separator");
while ((line = stdInput.readLine()) != null) {
sb.append(line);
sb.append(lineSeparator);
}
// read any errors from the attempted command
StringBuilder error = new StringBuilder();
while ((line = stdError.readLine()) != null) {
error.append(line);
}
trace("error trace :"+error);
p.waitFor();
} catch (Throwable e) {
trace("exception happened - here's what I know: ");
trace(e.toString());
}
ret = sb.toString();
trace("=== final stack ===");
trace(ret);
trace("===================");
return ret;
}
you need to provide the raw stack + the map file generated by proguard during compilation