mirror of
https://github.com/TonyJiangWJ/Auto.js.git
synced 2026-06-24 21:33:16 +08:00
替换bugly的key用于统计错误信息。修复偶发的并发错误
This commit is contained in:
parent
54eb93ea9d
commit
fa0a16dee3
@ -46,6 +46,7 @@ android {
|
||||
]
|
||||
}
|
||||
}
|
||||
ndk { }
|
||||
}
|
||||
buildTypes {
|
||||
debug {
|
||||
@ -197,7 +198,8 @@ dependencies {
|
||||
// Flurry
|
||||
implementation 'com.flurry.android:analytics:7.0.0@aar'
|
||||
// Bugly
|
||||
implementation 'com.tencent.bugly:crashreport:2.6.6'
|
||||
implementation 'com.tencent.bugly:crashreport:3.2.3'
|
||||
implementation 'com.tencent.bugly:nativecrashreport:3.7.47'
|
||||
// MaterialDialogCommon
|
||||
implementation('com.afollestad.material-dialogs:commons:0.9.2.3', {
|
||||
exclude group: 'com.android.support'
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.READ_LOGS"/>
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||
|
||||
@ -53,7 +53,7 @@ class App : MultiDexApplication() {
|
||||
return
|
||||
FlurryAgent.Builder()
|
||||
.withLogEnabled(BuildConfig.DEBUG)
|
||||
.build(this, "D42MH48ZN4PJC5TKNYZD")
|
||||
.build(this, "V5B5VT5NP6TT5F78PZXR")
|
||||
}
|
||||
|
||||
private fun setUpDebugEnvironment() {
|
||||
@ -164,7 +164,7 @@ class App : MultiDexApplication() {
|
||||
companion object {
|
||||
|
||||
private val TAG = "App"
|
||||
private val BUGLY_APP_ID = "19b3607b53"
|
||||
private val BUGLY_APP_ID = "e020acad30"
|
||||
|
||||
private lateinit var instance: WeakReference<App>
|
||||
|
||||
|
||||
@ -26,10 +26,10 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
import static com.stardust.autojs.runtime.exception.ScriptInterruptedException.causedByInterrupted;
|
||||
|
||||
@ -227,7 +227,7 @@ public class ScriptEngineService {
|
||||
|
||||
private static class EngineLifecycleObserver implements ScriptEngineManager.EngineLifecycleCallback {
|
||||
|
||||
private final Set<ScriptEngineManager.EngineLifecycleCallback> mEngineLifecycleCallbacks = new LinkedHashSet<>();
|
||||
private final Set<ScriptEngineManager.EngineLifecycleCallback> mEngineLifecycleCallbacks = new CopyOnWriteArraySet<>();
|
||||
|
||||
@Override
|
||||
public void onEngineCreate(ScriptEngine engine) {
|
||||
|
||||
@ -190,7 +190,7 @@ public class TemplateMatching {
|
||||
private static int selectPyramidLevel(Mat img, Mat template) {
|
||||
int minDim = Nath.min(img.rows(), img.cols(), template.rows(), template.cols());
|
||||
//这里选取16为图像缩小后的最小宽高,从而用log(2, minDim / 16)得到最多可以经过几次缩小。
|
||||
int maxLevel = (int) (Math.log(minDim / 16) / Math.log(2));
|
||||
int maxLevel = (int) (Math.log(minDim / 16.0) / Math.log(2));
|
||||
if (maxLevel < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -227,6 +227,8 @@ public class Loopers implements MessageQueue.IdleHandler {
|
||||
Log.d(LOG_TAG, "notifyThreadExit: " + thread);
|
||||
//当子线程退成时,主线程需要检查自身是否退出(主线程在所有子线程执行完成后才能退出,如果主线程已经执行完任务仍然要等待所有子线程),
|
||||
//此时通过向主线程发送一个空的Runnable,主线程执行完这个Runnable后会触发IdleHandler,从而检查自身是否退出
|
||||
mMainHandler.post(EMPTY_RUNNABLE);
|
||||
if (mMainHandler != null) {
|
||||
mMainHandler.post(EMPTY_RUNNABLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,8 +50,13 @@ public class RhinoAndroidHelper {
|
||||
* @return a context prepared for android
|
||||
*/
|
||||
public Context enterContext() {
|
||||
if (!SecurityController.hasGlobal())
|
||||
SecurityController.initGlobal(new NoSecurityController());
|
||||
if (!SecurityController.hasGlobal()) {
|
||||
synchronized (RhinoAndroidHelper.class) {
|
||||
if (!SecurityController.hasGlobal()) {
|
||||
SecurityController.initGlobal(new NoSecurityController());
|
||||
}
|
||||
}
|
||||
}
|
||||
return getContextFactory().enterContext();
|
||||
}
|
||||
|
||||
@ -59,7 +64,7 @@ public class RhinoAndroidHelper {
|
||||
* @return The Context factory which has to be used on android.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
public AndroidContextFactory getContextFactory() {
|
||||
public synchronized AndroidContextFactory getContextFactory() {
|
||||
AndroidContextFactory factory;
|
||||
if (!ContextFactory.hasExplicitGlobal()) {
|
||||
factory = new AndroidContextFactory(cacheDirectory);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user