leakcanary
leakcanary copied to clipboard
Add option to keep string contents in HprofPrimitiveArrayStripper
HprofPrimitiveArrayStripper clears all primitive arrays, erasing any and all PII. However strings can be super useful to analyze leak traces (e.g. thread name, scope name, etc). We could keep track of all byte or char arrays (depending on version), write down the string class id when we encounter it, then for every string mark the corresponding array, and at the end write down all arrays, keeping the string marked ones intact. This option can be used if you make sure to not keep sensitive information in strings in the app.