- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
80 lines
3.3 KiB
Java
80 lines
3.3 KiB
Java
package com.helpshift.activities;
|
|
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.util.Log;
|
|
import android.widget.TextView;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
import com.helpshift.R$id;
|
|
import com.helpshift.R$layout;
|
|
import com.helpshift.log.LogCollector;
|
|
import com.helpshift.storage.HSPersistentStorage;
|
|
import com.helpshift.storage.SharedPreferencesStore;
|
|
import csdk.gluads.Consts;
|
|
import java.io.BufferedReader;
|
|
import java.io.File;
|
|
import java.io.FileReader;
|
|
import java.util.Arrays;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public class HSDebugActivity extends AppCompatActivity {
|
|
private static final String TAG = "Helpshift_DebugAct";
|
|
|
|
@Override // androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, android.app.Activity
|
|
public void onCreate(@Nullable Bundle bundle) {
|
|
super.onCreate(bundle);
|
|
setContentView(R$layout.hs__debug_layout);
|
|
}
|
|
|
|
@Override // androidx.fragment.app.FragmentActivity, android.app.Activity
|
|
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, "__hs_lite_sdk_store", 0));
|
|
String str = hSPersistentStorage.getDomain() + Consts.STRING_PERIOD + 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("\n");
|
|
}
|
|
}
|
|
sb.append("\n \n");
|
|
}
|
|
}
|
|
Intent intent = new Intent("android.intent.action.SEND");
|
|
intent.setType("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 "";
|
|
}
|
|
}
|
|
}
|