-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from lemondark/release/v4.9.1
release: v4.9.1
- Loading branch information
Showing
6 changed files
with
79 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/com/tencent/msdk/dns/base/bugly/SharedBugly.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.tencent.msdk.dns.base.bugly; | ||
|
||
import android.content.Context; | ||
import android.content.SharedPreferences; | ||
|
||
import com.tencent.msdk.dns.BuildConfig; | ||
import com.tencent.msdk.dns.DnsService; | ||
import com.tencent.msdk.dns.base.log.DnsLog; | ||
|
||
public class SharedBugly { | ||
private static String appId = BuildConfig.BUGLY_ID; | ||
private static String appVersion = BuildConfig.VERSION_NAME; | ||
|
||
public static void init(Context context) { | ||
try { | ||
if (DnsService.getDnsConfig().experimentalBuglyEnable) { | ||
SharedPreferences sharedPreferences = context.getSharedPreferences("BuglySdkInfos", Context.MODE_PRIVATE); | ||
SharedPreferences.Editor editor = sharedPreferences.edit(); | ||
editor.putString(appId, appVersion); //必填信息 | ||
editor.commit(); | ||
DnsLog.d("shared bugly inited success"); | ||
} else { | ||
SharedPreferences sharedPreferences = context.getSharedPreferences("BuglySdkInfos", | ||
Context.MODE_PRIVATE); | ||
if (sharedPreferences.contains(appId)) { | ||
SharedPreferences.Editor editor = sharedPreferences.edit(); | ||
editor.remove(appId); | ||
editor.apply(); | ||
} | ||
} | ||
} catch (Exception e) { | ||
DnsLog.d("shared bugly inited error " + e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters