use of com.crashlytics.android.Crashlytics in project PhoneProfilesPlus by henrichg.
the class PPApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
PPApplication.logE("##### PPApplication.onCreate", "romManufacturer=" + romManufacturer);
if (checkAppReplacingState())
return;
// Set up Crashlytics, disabled for debug builds
Crashlytics crashlyticsKit = new Crashlytics.Builder().core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()).build();
Fabric.with(getApplicationContext(), crashlyticsKit);
try {
Crashlytics.setBool("DEBUG", BuildConfig.DEBUG);
} catch (Exception ignored) {
}
// if (BuildConfig.DEBUG) {
int actualVersionCode = 0;
try {
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
actualVersionCode = pInfo.versionCode;
} catch (Exception ignored) {
}
Thread.setDefaultUncaughtExceptionHandler(new TopExceptionHandler(getApplicationContext(), actualVersionCode));
// }
// Debug.startMethodTracing("phoneprofiles");
// resetLog();
// firstStartServiceStarted = false;
PACKAGE_NAME = this.getPackageName();
LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(PPApplication.dashClockBroadcastReceiver, new IntentFilter("DashClockBroadcastReceiver"));
LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(PPApplication.refreshGUIBroadcastReceiver, new IntentFilter("RefreshGUIBroadcastReceiver"));
startHandlerThread();
startHandlerThreadVolumes();
startHandlerThreadRadios();
startHandlerThreadAdaptiveBrightness();
startHandlerThreadWallpaper();
startHandlerThreadPowerSaveMode();
startHandlerThreadLockDevice();
startHandlerThreadRunApplication();
startHandlerThreadHeadsUpNotifications();
toastHandler = new Handler(getMainLooper());
brightnessHandler = new Handler(getMainLooper());
screenTimeoutHandler = new Handler(getMainLooper());
// https://github.com/evernote/android-job/issues/197
JobConfig.setForceAllowApi14(true);
JobManager.create(this).addJobCreator(new PPJobsCreator());
PPApplication.initRoot();
/*
try {
ViewConfiguration config = ViewConfiguration.get(this);
Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
if(menuKeyField != null) {
menuKeyField.setAccessible(true);
menuKeyField.setBoolean(config, false);
}
} catch (Exception ex) {
// Ignore
}
*/
// Log.d("PPApplication.onCreate", "memory usage (after create activateProfileHelper)=" + Debug.getNativeHeapAllocatedSize());
// Log.d("PPApplication.onCreate","xxx");
// Samsung Look initialization
sLook = new Slook();
try {
sLook.initialize(this);
// true = The Device supports Edge Single Mode, Edge Single Plus Mode, and Edge Feeds Mode.
sLookCocktailPanelEnabled = sLook.isFeatureEnabled(Slook.COCKTAIL_PANEL);
// true = The Device supports Edge Immersive Mode feature.
// sLookCocktailBarEnabled = sLook.isFeatureEnabled(Slook.COCKTAIL_BAR);
} catch (SsdkUnsupportedException e) {
sLook = null;
}
}
use of com.crashlytics.android.Crashlytics in project VirtualXposed by android-hacker.
the class XApp method onCreate.
@Override
public void onCreate() {
gApp = this;
super.onCreate();
VirtualCore virtualCore = VirtualCore.get();
virtualCore.initialize(new VirtualCore.VirtualInitializer() {
@Override
public void onMainProcess() {
Once.initialise(XApp.this);
Fabric.with(XApp.this, new Crashlytics());
boolean isXposedInstalled = false;
try {
isXposedInstalled = VirtualCore.get().isAppInstalled(XPOSED_INSTALLER_PACKAGE);
File oldXposedInstallerApk = getFileStreamPath("XposedInstaller_1_24.apk");
if (oldXposedInstallerApk.exists()) {
VirtualCore.get().uninstallPackage(XPOSED_INSTALLER_PACKAGE);
oldXposedInstallerApk.delete();
isXposedInstalled = false;
Log.d(TAG, "remove xposed installer success!");
}
} catch (Throwable e) {
VLog.d(TAG, "remove xposed install failed.", e);
}
if (!isXposedInstalled) {
File xposedInstallerApk = getFileStreamPath("XposedInstaller_1_31.apk");
if (!xposedInstallerApk.exists()) {
InputStream input = null;
OutputStream output = null;
try {
input = getApplicationContext().getAssets().open("XposedInstaller_3.1.5.apk_");
output = new FileOutputStream(xposedInstallerApk);
byte[] buffer = new byte[1024];
int length;
while ((length = input.read(buffer)) > 0) {
output.write(buffer, 0, length);
}
} catch (Throwable e) {
VLog.e(TAG, "copy file error", e);
} finally {
FileUtils.closeQuietly(input);
FileUtils.closeQuietly(output);
}
}
if (xposedInstallerApk.isFile() && !DeviceUtil.isMeizuBelowN()) {
try {
VirtualCore.get().installPackage(xposedInstallerApk.getPath(), InstallStrategy.TERMINATE_IF_EXIST);
} catch (Throwable ignored) {
}
}
}
}
@Override
public void onVirtualProcess() {
Fabric.with(XApp.this, new Crashlytics());
// listener components
virtualCore.setComponentDelegate(new MyComponentDelegate());
// fake phone imei,macAddress,BluetoothAddress
virtualCore.setPhoneInfoDelegate(new MyPhoneInfoDelegate());
// fake task description's icon and title
virtualCore.setTaskDescriptionDelegate(new MyTaskDescDelegate());
virtualCore.setCrashHandler(new MyCrashHandler());
// ensure the logcat service alive when every virtual process start.
LogcatService.start(XApp.this, VEnvironment.getDataUserPackageDirectory(0, XPOSED_INSTALLER_PACKAGE));
}
@Override
public void onServerProcess() {
virtualCore.setAppRequestListener(new MyAppRequestListener(XApp.this));
virtualCore.addVisibleOutsidePackage("com.tencent.mobileqq");
virtualCore.addVisibleOutsidePackage("com.tencent.mobileqqi");
virtualCore.addVisibleOutsidePackage("com.tencent.minihd.qq");
virtualCore.addVisibleOutsidePackage("com.tencent.qqlite");
virtualCore.addVisibleOutsidePackage("com.facebook.katana");
virtualCore.addVisibleOutsidePackage("com.whatsapp");
virtualCore.addVisibleOutsidePackage("com.tencent.mm");
virtualCore.addVisibleOutsidePackage("com.immomo.momo");
}
});
}
use of com.crashlytics.android.Crashlytics in project Applozic-Android-SDK by AppLozic.
the class ApplozicSampleApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
}
use of com.crashlytics.android.Crashlytics in project osm-contributor by jawg.
the class OsmTemplateApplication method onCreate.
/*=========================================*/
/*---------------OVERRIDE------------------*/
/*=========================================*/
@Override
public void onCreate() {
super.onCreate();
if (BuildConfig.DEBUG) {
Timber.plant(new Timber.DebugTree());
}
Fabric.with(this, new Crashlytics());
// Init Stetho for debug purpose (database)
Stetho.initializeWithDefaults(this);
// Init Dagger
osmTemplateComponent = DaggerOsmTemplateComponent.builder().osmTemplateModule(new OsmTemplateModule(this)).build();
osmTemplateComponent.inject(this);
// Init Flickr object
StoreConfigManager configManager = new StoreConfigManager();
flickr = new Flickr(configManager.getFlickrApiKey(), configManager.getFlickrApiKeySecret(), new REST());
// Cache Disk for Fresco
DiskCacheConfig diskCacheConfig = DiskCacheConfig.newBuilder(this).setBaseDirectoryPath(new File(Environment.getExternalStorageDirectory().getAbsoluteFile(), getPackageName())).setBaseDirectoryName("images").build();
// Cache Memory for Fresco
ImagePipelineConfig imagePipelineConfig = ImagePipelineConfig.newBuilder(this).setBitmapMemoryCacheParamsSupplier(new Supplier<MemoryCacheParams>() {
@Override
public MemoryCacheParams get() {
return new MemoryCacheParams(10485760, 100, 100, 100, 100);
}
}).setMainDiskCacheConfig(diskCacheConfig).build();
// Init Fresco
Fresco.initialize(this, imagePipelineConfig);
// Init event bus
EventBus bus = osmTemplateComponent.getEventBus();
bus.register(getOsmTemplateComponent().getLoginManager());
bus.register(getOsmTemplateComponent().getEditPoiManager());
bus.register(getOsmTemplateComponent().getPoiManager());
bus.register(getOsmTemplateComponent().getNoteManager());
bus.register(getOsmTemplateComponent().getSyncManager());
bus.register(getOsmTemplateComponent().getTypeManager());
bus.register(getOsmTemplateComponent().getPresetsManager());
bus.register(getOsmTemplateComponent().getGeocoder());
bus.register(getOsmTemplateComponent().getEditVectorialWayManager());
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
if (!PreferenceManager.getDefaultSharedPreferences(this).getBoolean(getString(R.string.shared_prefs_preset_default), false)) {
editor.putBoolean(getString(R.string.shared_prefs_preset_default), true);
}
editor.apply();
MapboxAccountManager.start(this, BuildConfig.MAPBOX_TOKEN);
}
use of com.crashlytics.android.Crashlytics in project BORED by invent2017.
the class Startup method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
setContentView(R.layout.activity_startup);
mDataRef = FirebaseDatabase.getInstance().getReference();
checkAppStatus();
}
Aggregations