Skip to content

Commit

Permalink
Remove Bugly.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirtyDegreesRay committed Mar 21, 2021
1 parent fac55c5 commit fcb9b42
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 179 deletions.
2 changes: 0 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ dependencies {
implementation "com.afollestad.material-dialogs:core:${MATERIAL_DIALOG_VERSION}"
implementation "com.afollestad.material-dialogs:commons:${MATERIAL_DIALOG_VERSION}"

implementation (name: 'bugly_crashreport_upgrade-1.3.4', ext: 'aar')
implementation "com.tencent.bugly:nativecrashreport:${BUGGLY_NATIVE_VERSION}"
implementation "com.zzhoujay.richtext:richtext:${RICKTEXT_VERSION}"
implementation 'com.zzhoujay.glideimagegetter:glideimagegetter:1.0.5'

Expand Down
Binary file removed app/libs/bugly_crashreport_upgrade-1.3.4.aar
Binary file not shown.
4 changes: 0 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.READ_LOGS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>

Expand All @@ -21,9 +20,6 @@
android:theme="@style/SplashTheme"
tools:replace="android:supportsRtl">

<meta-data
android:name="BUGLY_APP_CHANNEL"
android:value="${BUGLY_APP_CHANNEL_VALUE}" />

<receiver android:name=".service.NetBroadcastReceiver"/>
<receiver android:name=".service.ShareBroadcastReceiver"/>
Expand Down
26 changes: 0 additions & 26 deletions app/src/main/java/com/thirtydegreesray/openhub/AppApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,10 @@
import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.Logger;
import com.orhanobut.logger.PrettyFormatStrategy;
import com.tencent.bugly.Bugly;
import com.tencent.bugly.beta.Beta;
import com.tencent.bugly.crashreport.CrashReport;
import com.thirtydegreesray.openhub.inject.component.AppComponent;
import com.thirtydegreesray.openhub.inject.component.DaggerAppComponent;
import com.thirtydegreesray.openhub.inject.module.AppModule;
import com.thirtydegreesray.openhub.service.NetBroadcastReceiver;
import com.thirtydegreesray.openhub.ui.activity.AboutActivity;
import com.thirtydegreesray.openhub.ui.activity.LoginActivity;
import com.thirtydegreesray.openhub.ui.activity.MainActivity;
import com.thirtydegreesray.openhub.ui.widget.UpgradeDialog;
import com.thirtydegreesray.openhub.util.AppUtils;
import com.thirtydegreesray.openhub.util.NetHelper;

Expand Down Expand Up @@ -59,7 +52,6 @@ public void onCreate() {
.appModule(new AppModule(this))
.build();
initNetwork();
initBugly();
startTime = System.currentTimeMillis();
Logger.t(TAG).i("application ok:" + (System.currentTimeMillis() - startTime));

Expand All @@ -86,24 +78,6 @@ public void log(int priority, String tag, String message) {
});
}

private void initBugly(){

Beta.initDelay = 6 * 1000;
Beta.enableHotfix = false;
Beta.canShowUpgradeActs.add(LoginActivity.class);
Beta.canShowUpgradeActs.add(MainActivity.class);
Beta.canShowUpgradeActs.add(AboutActivity.class);
Beta.upgradeListener = UpgradeDialog.INSTANCE;

CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(getApplicationContext());
strategy.setAppVersion(BuildConfig.VERSION_NAME);
strategy.setAppChannel(getAppChannel());
strategy.setAppReportDelay(10 * 1000);
Bugly.init(getApplicationContext(), AppConfig.BUGLY_APPID, BuildConfig.DEBUG, strategy);
CrashReport.setIsDevelopmentDevice(getApplicationContext(), BuildConfig.DEBUG);

}

private void initNetwork(){
NetBroadcastReceiver receiver = new NetBroadcastReceiver();
IntentFilter filter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
import com.danielstone.materialaboutlibrary.items.MaterialAboutTitleItem;
import com.danielstone.materialaboutlibrary.model.MaterialAboutCard;
import com.danielstone.materialaboutlibrary.model.MaterialAboutList;
import com.tencent.bugly.beta.Beta;
import com.thirtydegreesray.openhub.BuildConfig;
import com.thirtydegreesray.openhub.R;
import com.thirtydegreesray.openhub.ui.widget.UpgradeDialog;
import com.thirtydegreesray.openhub.util.AppOpener;
import com.thirtydegreesray.openhub.util.AppUtils;
import com.thirtydegreesray.openhub.util.ThemeHelper;
Expand All @@ -40,7 +38,6 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
isAlive = true;
ThemeHelper.applyForAboutActivity(this);
super.onCreate(savedInstanceState);
UpgradeDialog.INSTANCE.setShowDialogActivity(this);
}

@NonNull
Expand Down Expand Up @@ -71,12 +68,6 @@ private void buildApp(MaterialAboutCard.Builder appBuilder, final Context contex
.text(R.string.version)
.subText(BuildConfig.VERSION_NAME)
.icon(R.drawable.ic_menu_about)
.setOnClickAction(new MaterialAboutItemOnClickAction() {
@Override
public void onClick() {
Beta.checkUpgrade(true, true);
}
})
.build());
appBuilder.addItem(new MaterialAboutActionItem.Builder()
.text(R.string.source_code)
Expand Down Expand Up @@ -173,7 +164,6 @@ public void onClick() {
@Override
protected void onDestroy() {
isAlive = false;
UpgradeDialog.INSTANCE.setShowDialogActivity(null);
super.onDestroy();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import android.widget.ImageView;
import android.widget.TextView;

import com.tencent.bugly.crashreport.CrashReport;
import com.thirtydegreesray.dataautoaccess.annotation.AutoAccess;
import com.thirtydegreesray.openhub.AppData;
import com.thirtydegreesray.openhub.R;
Expand Down Expand Up @@ -114,8 +113,6 @@ protected void setupActivityComponent(AppComponent appComponent) {
protected void initActivity() {
super.initActivity();
if (AppData.INSTANCE.getLoggedUser() != null)
CrashReport.putUserData(getApplicationContext(),
"GitHubId", AppData.INSTANCE.getLoggedUser().getLogin());

setStartDrawerEnable(true);
setEndDrawerEnable(true);
Expand Down

This file was deleted.

7 changes: 7 additions & 0 deletions app/src/main/res/xml/provider_paths.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<!-- /storage/emulated/0/Download/com.bugly.upgrade.demo/.beta/apk-->
<external-path name="beta_external_path" path="Download/"/>
<!--/storage/emulated/0/Android/data/com.bugly.upgrade.demo/files/apk/-->
<external-path name="beta_external_files_path" path="Android/data/"/>
</paths>
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ BUILD_TOOLS_VERSION = 29.0.3
MIN_SDK_VERSION = 21
TARGET_SDK_VERSION = 29

VERSION_CODE = 33
VERSION_NAME = 3.2.0
VERSION_CODE = 34
VERSION_NAME = 3.2.1

#library
ANDROID_SUPPORT_VERSION = 25.4.0
Expand Down

0 comments on commit fcb9b42

Please sign in to comment.