Booty Calls v1.2.156版本的 MD5 值为:919c7e4dc831ea1adbaf506a3cc1a198
以下内容为反编译后的 HSDebugActivity.java 源代码,内容仅作参考
package com.helpshift.activities;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.broadcom.bt.util.io.IOUtils;
import com.broadcom.bt.util.mime4j.field.ContentTypeField;
import com.helpshift.R;
import com.helpshift.log.LogCollector;
import com.helpshift.storage.HSPersistentStorage;
import com.helpshift.storage.SharedPreferencesStore;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.Arrays;
public class HSDebugActivity extends AppCompatActivity {
private static final String TAG = "Helpshift_DebugAct";
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.hs__debug_layout);
}
@Override
public void onResume() {
super.onResume();
TextView textView = (TextView) findViewById(R.id.debug_log_message);
textView.setText("Preparing logs...");
try {
HSPersistentStorage hSPersistentStorage = new HSPersistentStorage(new SharedPreferencesStore(this, HSPersistentStorage.FILE_NAME, 0));
String str = hSPersistentStorage.getDomain() + "." + hSPersistentStorage.getHost();
String appName = getAppName();
File file = new File(getFilesDir() + File.separator + LogCollector.logDirPath);
StringBuilder sb = new StringBuilder();
File[] listFiles = file.listFiles();
if (file.exists() && listFiles != null && listFiles.length > 0) {
Arrays.sort(listFiles);
for (File file2 : listFiles) {
sb.append("Log File: ");
sb.append(file2.getName());
sb.append("\n \n");
BufferedReader bufferedReader = new BufferedReader(new FileReader(file2));
while (true) {
String readLine = bufferedReader.readLine();
if (readLine != null) {
sb.append(readLine);
sb.append(IOUtils.LINE_SEPARATOR_UNIX);
}
}
sb.append("\n \n");
}
}
Intent intent = new Intent("android.intent.action.SEND");
intent.setType(ContentTypeField.TYPE_TEXT_PLAIN);
intent.putExtra("android.intent.extra.EMAIL", new String[]{"bugs@helpshift.com"});
intent.putExtra("android.intent.extra.TEXT", sb.toString());
intent.putExtra("android.intent.extra.SUBJECT", str + " / " + appName + " / " + getPackageName());
startActivity(Intent.createChooser(intent, "Send email..."));
finish();
} catch (Exception e) {
Log.e(TAG, "Error when sharing/reading log", e);
textView.setText("Error preparing logs: " + e.getMessage());
}
}
private String getAppName() {
try {
return getApplicationInfo().loadLabel(getPackageManager()).toString();
} catch (Exception unused) {
return "";
}
}
}