use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.
the class IdManager method createAndStoreIid.
private synchronized String createAndStoreIid(String fidToCache, SharedPreferences prefs) {
String iid;
iid = formatId(UUID.randomUUID().toString());
Logger logger = Logger.getLogger();
logger.d("Created new Crashlytics IID: " + iid);
prefs.edit().putString("crashlytics.installation.id", iid).putString(PREFKEY_FIREBASE_IID, fidToCache).apply();
return iid;
}
use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.
the class AnalyticsConnectorReceiver method onMessageTriggered.
// com.google.firebase.analytics.connector.AnalyticsConnector.AnalyticsConnectorListener
@Override
public void onMessageTriggered(int id, Bundle extras) {
Logger logger = Logger.getLogger();
logger.d("AnalyticsConnectorReceiver received message: " + id + " " + extras);
if (extras != null) {
Bundle params = extras.getBundle(EVENT_PARAMS_KEY);
if (params == null) {
params = new Bundle();
}
String origin = params.getString(EVENT_ORIGIN_KEY);
if (CRASHLYTICS_ORIGIN.equals(origin)) {
dispatchCrashlyticsOriginEvent(id, extras);
return;
}
String name = extras.getString("name");
if (name != null) {
dispatchBreadcrumbEvent(name, params);
}
}
}
use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.
the class CommonUtils method getAppIconHashOrNull.
public static String getAppIconHashOrNull(Context context) {
InputStream is = null;
String str = null;
try {
is = context.getResources().openRawResource(getAppIconResourceId(context));
String sha1 = sha1(is);
if (!isNullOrEmpty(sha1)) {
str = sha1;
}
return str;
} catch (Exception e) {
Logger logger = Logger.getLogger();
logger.w("Could not calculate hash for app icon:" + e.getMessage());
return null;
} finally {
closeOrLog(is, "Failed to close icon input stream.");
}
}
use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.
the class DefaultSettingsSpiCall method invoke.
// com.google.firebase.crashlytics.internal.settings.network.SettingsSpiCall
@Override
public JSONObject invoke(SettingsRequest requestData, boolean dataCollectionToken) {
if (dataCollectionToken) {
try {
Map<String, String> queryParams = getQueryParamsFor(requestData);
HttpRequest httpRequest = getHttpRequest(queryParams);
HttpRequest httpRequest2 = applyHeadersTo(httpRequest, requestData);
Logger logger = this.logger;
logger.d("Requesting settings from " + getUrl());
Logger logger2 = this.logger;
logger2.d("Settings query params were: " + queryParams);
HttpResponse httpResponse = httpRequest2.execute();
Logger logger3 = this.logger;
logger3.d("Settings request ID: " + httpResponse.header(AbstractSpiCall.HEADER_REQUEST_ID));
JSONObject toReturn = handleResponse(httpResponse);
return toReturn;
} catch (IOException e) {
this.logger.e("Settings request failed.", e);
return null;
}
} else {
throw new RuntimeException("An invalid data collection token was used.");
}
}
use of com.google.firebase.crashlytics.internal.Logger in project GreenHouse by utsanjan.
the class CrashlyticsController method finalizePreviousNativeSession.
private void finalizePreviousNativeSession(String previousSessionId) {
Logger logger = Logger.getLogger();
logger.d("Finalizing native report for session " + previousSessionId);
NativeSessionFileProvider nativeSessionFileProvider = this.nativeComponent.getSessionFileProvider(previousSessionId);
File minidumpFile = nativeSessionFileProvider.getMinidumpFile();
if (minidumpFile == null || !minidumpFile.exists()) {
Logger logger2 = Logger.getLogger();
logger2.w("No minidump data found for session " + previousSessionId);
return;
}
LogFileManager previousSessionLogManager = new LogFileManager(this.context, this.logFileDirectoryProvider, previousSessionId);
File nativeSessionDirectory = new File(getNativeSessionFilesDir(), previousSessionId);
if (!nativeSessionDirectory.mkdirs()) {
Logger.getLogger().d("Couldn't create native sessions directory");
return;
}
List<NativeSessionFile> nativeSessionFiles = getNativeSessionFiles(nativeSessionFileProvider, previousSessionId, getContext(), getFilesDir(), previousSessionLogManager.getBytesForLog());
NativeSessionFileGzipper.processNativeSessions(nativeSessionDirectory, nativeSessionFiles);
this.reportingCoordinator.finalizeSessionWithNativeEvent(makeFirebaseSessionIdentifier(previousSessionId), nativeSessionFiles);
previousSessionLogManager.clearLog();
}
Aggregations