Compare commits

...

8 Commits

Author SHA1 Message Date
bef6cbb212 tinker_base 4.0.2-183 2020-07-15 17:00:17 +08:00
032a89e0cd versionCode 改为183 2020-07-15 16:48:28 +08:00
c9afb6df02 Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev 2020-07-15 16:30:50 +08:00
b8092447ff 游戏列表默认不显示评分 2020-07-15 16:30:43 +08:00
bff20bea49 修复 7.1.1 系统上 toast 可能出现的闪退问题 2020-07-15 16:29:34 +08:00
87f2d9c85f Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2020-07-15 15:04:43 +08:00
154dfc8538 DsBridge原生Api支持无参方法 2020-07-15 15:03:56 +08:00
fddcdfb3aa 更改今日头条SDK的初始化位置 2020-07-15 09:41:29 +08:00
7 changed files with 44 additions and 26 deletions

View File

@ -75,6 +75,12 @@ public class DWebView extends WebView {
}
}
@Keep
@JavascriptInterface
public String call(String methodName) {
return call(methodName, "");
}
@Keep
@JavascriptInterface
public String call(String methodName, String argStr) {
@ -93,7 +99,7 @@ public class DWebView extends WebView {
PrintDebugInfo(error);
return ret.toString();
}
Object arg=null;
Object arg = null;
Method method = null;
String callback = null;
@ -102,7 +108,7 @@ public class DWebView extends WebView {
if (args.has("_dscbstub")) {
callback = args.getString("_dscbstub");
}
if(args.has("data")) {
if (args.has("data")) {
arg = args.get("data");
}
} catch (JSONException e) {
@ -123,7 +129,10 @@ public class DWebView extends WebView {
try {
method = cls.getMethod(methodName, new Class[]{Object.class});
} catch (Exception ex) {
try {
method = cls.getMethod(methodName, new Class[]{});
} catch (Exception ignore) {
}
}
}
@ -187,7 +196,12 @@ public class DWebView extends WebView {
}
});
} else {
retData = method.invoke(jsb, arg);
Class<?>[] methodParameterTypes = method.getParameterTypes();
if (methodParameterTypes.length == 0) {
retData = method.invoke(jsb);
} else {
retData = method.invoke(jsb, arg);
}
ret.put("code", 0);
ret.put("data", retData);
return ret.toString();
@ -307,7 +321,10 @@ public class DWebView extends WebView {
try {
method = cls.getMethod(nameStr[1], new Class[]{Object.class});
} catch (Exception ex) {
try {
method = cls.getMethod(nameStr[1], new Class[]{});
} catch (Exception ignore) {
}
}
}
if (method != null) {
@ -336,7 +353,7 @@ public class DWebView extends WebView {
|| javascriptCloseWindowListener.onClose()) {
Context context = getContext();
if (context instanceof Activity) {
((Activity)context).onBackPressed();
((Activity) context).onBackPressed();
}
}
}
@ -359,7 +376,7 @@ public class DWebView extends WebView {
@Keep
@JavascriptInterface
public void returnValue(final Object obj){
public void returnValue(final Object obj) {
runOnMainThread(new Runnable() {
@Override
public void run() {
@ -422,9 +439,9 @@ public class DWebView extends WebView {
runOnMainThread(new Runnable() {
@Override
public void run() {
if (url != null && url.startsWith("javascript:")){
if (url != null && url.startsWith("javascript:")) {
DWebView.super.loadUrl(url);
}else{
} else {
callInfoList = new ArrayList<>();
DWebView.super.loadUrl(url);
}
@ -444,9 +461,9 @@ public class DWebView extends WebView {
runOnMainThread(new Runnable() {
@Override
public void run() {
if (url != null && url.startsWith("javascript:")){
if (url != null && url.startsWith("javascript:")) {
DWebView.super.loadUrl(url, additionalHttpHeaders);
}else{
} else {
callInfoList = new ArrayList<>();
DWebView.super.loadUrl(url, additionalHttpHeaders);
}
@ -996,7 +1013,4 @@ public class DWebView extends WebView {
mainHandler.post(runnable);
}
}

View File

@ -15,6 +15,12 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.g00fy2.versioncompare.Version;
import com.gh.base.BaseActivity;
import com.gh.common.AppExecutor;
@ -33,6 +39,7 @@ import com.gh.common.util.PackageUtils;
import com.gh.common.util.PlatformUtils;
import com.gh.common.util.SPUtils;
import com.gh.common.util.TagUtils;
import com.gh.common.util.TeaHelper;
import com.gh.common.util.UsageStatsHelper;
import com.gh.download.DownloadManager;
import com.gh.gamecenter.entity.AuthDialogEntity;
@ -56,11 +63,6 @@ import java.util.Date;
import java.util.List;
import java.util.Locale;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import pub.devrel.easypermissions.AfterPermissionGranted;
@ -276,6 +278,9 @@ public class SplashScreenActivity extends BaseActivity {
private void launchMainActivity() {
getUniqueId();
// 在可能获取了相关权限后才初始化今日头条SDK
TeaHelper.init(getApplication(), HaloApp.getInstance().getChannel());
Bundle bundle = getIntent().getExtras();
Intent intent = new Intent(SplashScreenActivity.this, MainActivity.class);
if (bundle != null) intent.putExtras(bundle);

View File

@ -28,7 +28,6 @@ import com.gh.common.util.DownloadObserver;
import com.gh.common.util.GdtHelper;
import com.gh.common.util.HomeBottomBarHelper;
import com.gh.common.util.PackageHelper;
import com.gh.common.util.TeaHelper;
import com.gh.common.util.TimestampUtils;
import com.gh.common.videolog.VideoRecordUtils;
import com.gh.gamecenter.BuildConfig;
@ -138,7 +137,6 @@ public class HaloApp extends TinkerAppLike {
PushManager.init(mChannel);
TeaHelper.init(getApplication(), mChannel);
DataUtils.init(getApplication(), mChannel);
GidHelper.getInstance().init(getApplication());
// TTAdSdk.init(getApplication(), new TTAdConfig.Builder().appId(Config.TTAD_APPID)

View File

@ -121,7 +121,8 @@
android:paddingRight="8dp"
android:text="@{game.commentCount > 3?game.star + ``: `评分过少`}"
android:textColor="@{Color.parseColor(game.commentCount > 3?`#1383EB`:`#2496FF`)}"
android:textStyle="bold" />
android:textStyle="bold"
android:visibility="gone" />
<TextView
android:id="@+id/game_des"

View File

@ -7,7 +7,7 @@ ext {
targetSdkVersion = 26
// application info
versionCode = 182
versionCode = 183
versionName = "4.0.2"
applicationId = "com.gh.gamecenter"

View File

@ -51,8 +51,8 @@ SENSITIVE_API_HOST=https\://and-core-api.ghzs.com/v4d0d2/
# 请不要手动改动下面的值除非你明确需要以某个apk作为基准包需要打包请以scripts/tinker*.sh为准
TINKER_ENABLE=
TINKER_ID=58b1cd4
TINKER_BASE_APK_DIR=app-0713-16-50-31_58b1cd4
TINKER_ID=032a89e
TINKER_BASE_APK_DIR=app-0715-16-52-39_032a89e
android.useAndroidX=true
android.enableJetifier=true