refactor!: 移除 flutter 相关代码
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -2,9 +2,6 @@
|
||||
path = libraries/LGLibrary
|
||||
url = git@git.shanqu.cc:android/common-library.git
|
||||
branch = master
|
||||
[submodule "assistant_flutter"]
|
||||
path = assistant_flutter
|
||||
url = git@git.shanqu.cc:halo/android/flutter-module.git
|
||||
[submodule "vspace-bridge"]
|
||||
path = vspace-bridge
|
||||
url = git@git.shanqu.cc:cwzs/android/vspace-bridge.git
|
||||
|
||||
@ -178,11 +178,6 @@ android {
|
||||
manifestPlaceholders.put("APPLOG_SCHEME", "rangersapplog.byAx6uYt".toLowerCase())
|
||||
}
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
// For flutter release build, see https://github.com/flutter/flutter/issues/58247
|
||||
checkReleaseBuilds false
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@ -39,7 +39,6 @@ object ConcernUtils {
|
||||
super.onResponse(response)
|
||||
listener?.onSuccess()
|
||||
EventBus.getDefault().post(EBConcernChanged(gameId, true))
|
||||
dispatchFollowChangeEventToFlutter(gameId, true)
|
||||
}
|
||||
|
||||
override fun onFailure(e: HttpException?) {
|
||||
@ -59,7 +58,6 @@ object ConcernUtils {
|
||||
super.onResponse(response)
|
||||
listener?.onSuccess()
|
||||
EventBus.getDefault().post(EBConcernChanged(gameId, false))
|
||||
dispatchFollowChangeEventToFlutter(gameId, false)
|
||||
}
|
||||
|
||||
override fun onFailure(e: HttpException?) {
|
||||
@ -133,18 +131,6 @@ object ConcernUtils {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 通知Flutter游戏关注状态发生变化
|
||||
* 请不要随意修改方法名
|
||||
* @param gameId 游戏ID
|
||||
* @param follow 关注状态
|
||||
*/
|
||||
@JvmStatic
|
||||
fun dispatchFollowChangeEventToFlutter(gameId: String, follow: Boolean) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
interface onConcernListener {
|
||||
fun onSuccess()
|
||||
fun onError()
|
||||
|
||||
@ -490,7 +490,6 @@ public class LibaoUtils {
|
||||
initLibaoCode(libaoEntity, me);
|
||||
if (adapter != null) adapter.initLibaoCode(me);
|
||||
EventBus.getDefault().post(new EBReuse("libaoChanged"));
|
||||
dispatchLiBaoChangeEventToFlutter(libaoEntity.getId(), "linged", GsonUtils.toJson(me));
|
||||
if (listener != null) listener.onLibaoStatusChange();
|
||||
uploadEvent(libaoEntity, true, entrance);
|
||||
String des;
|
||||
@ -601,7 +600,6 @@ public class LibaoUtils {
|
||||
initLibaoCode(libaoEntity, me);
|
||||
if (listener != null) listener.onLibaoStatusChange();
|
||||
EventBus.getDefault().post(new EBReuse("libaoChanged"));
|
||||
dispatchLiBaoChangeEventToFlutter(libaoEntity.getId(), "linged", GsonUtils.toJson(me));
|
||||
uploadEvent(libaoEntity, false, entrance);
|
||||
|
||||
if (adapter != null) {
|
||||
@ -694,15 +692,6 @@ public class LibaoUtils {
|
||||
}, captchaCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送礼包领取状态变化事件给Flutter
|
||||
* 请不要随意修改方法名
|
||||
* @param libaoId 礼包ID
|
||||
* @param status 礼包状态
|
||||
* @param meJson 礼包领取信息
|
||||
*/
|
||||
public static void dispatchLiBaoChangeEventToFlutter(String libaoId, String status, String meJson) {}
|
||||
|
||||
public static void initLibaoCode(LibaoEntity libaoEntity, UserDataLibaoEntity userDataLibaoEntity) {
|
||||
MeEntity userData = libaoEntity.getMe();
|
||||
if (userData == null) {
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
package com.gh.flutter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.gh.common.util.AdHelper;
|
||||
import com.gh.common.util.DirectUtils;
|
||||
import com.gh.gamecenter.core.utils.MtaHelper;
|
||||
import com.gh.gamecenter.entity.SettingsEntity;
|
||||
|
||||
import me.ele.lancet.base.annotations.Insert;
|
||||
import me.ele.lancet.base.annotations.TargetClass;
|
||||
|
||||
public class FlutterAdServiceImplAop {
|
||||
private static final String TARGET_CLASS = FlutterConstants.SERVICE_PACKAGE + ".FlutterAdServiceImpl";
|
||||
private static final String METHOD_GET_AD_HINT = "getAdHint";
|
||||
private static final String METHOD_OPEN_AD = "openAd";
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_AD_HINT)
|
||||
public String getAdHint(String location) {
|
||||
SettingsEntity.AD ad = AdHelper.INSTANCE.getAd(location);
|
||||
return ad == null ? "" : ad.getTitle();
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_OPEN_AD)
|
||||
public void openAd(Context context, String location) {
|
||||
SettingsEntity.AD ad = AdHelper.INSTANCE.getAd(location);
|
||||
MtaHelper.onEvent("广告位统计", "意见反馈_功能收录", ad.getTitle());
|
||||
DirectUtils.directToLinkPage(context,
|
||||
ad.toLinkEntity(),
|
||||
"(意见反馈-功能收录-广告位)",
|
||||
"");
|
||||
}
|
||||
}
|
||||
@ -1,169 +0,0 @@
|
||||
package com.gh.flutter;
|
||||
|
||||
import static com.gh.gamecenter.info.ConcernFragment.NEWS_MESSAGE_ARTICLE_REQUEST;
|
||||
import static com.gh.gamecenter.libao.LibaoNewFragment.LIBAO_NEW_REQUEST;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.gh.common.DefaultUrlHandler;
|
||||
import com.gh.common.util.DataCollectionUtils;
|
||||
import com.gh.common.util.DirectUtils;
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts;
|
||||
import com.gh.gamecenter.GameDetailActivity;
|
||||
import com.gh.gamecenter.LibaoDetailActivity;
|
||||
import com.gh.gamecenter.MessageDetailActivity;
|
||||
import com.gh.gamecenter.NewsDetailActivity;
|
||||
import com.gh.gamecenter.ShareCardActivity;
|
||||
import com.gh.gamecenter.ShareCardPicActivity;
|
||||
import com.gh.gamecenter.WebActivity;
|
||||
import com.gh.gamecenter.entity.ConcernEntity;
|
||||
import com.gh.gamecenter.entity.GameEntity;
|
||||
import com.gh.gamecenter.entity.LibaoEntity;
|
||||
import com.gh.gamecenter.suggest.SuggestType;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import me.ele.lancet.base.annotations.Insert;
|
||||
import me.ele.lancet.base.annotations.TargetClass;
|
||||
|
||||
public class FlutterBoostRouteServiceImplAop {
|
||||
private static final String TARGET_CLASS = FlutterConstants.SERVICE_PACKAGE + ".FlutterBoostRouteServiceImpl";
|
||||
private static final String METHOD_HANDLE_HELP_DETAIL = "handleHelpDetail";
|
||||
private static final String METHOD_HANDLE_HELP_SUGGESTION = "handleHelpSuggestion";
|
||||
private static final String METHOD_HANDLE_QQ_GROUP = "handleQQGroup";
|
||||
private static final String METHOD_HANDLE_GIFT_DETAIL = "handleGiftDetail";
|
||||
private static final String METHOD_HANDLE_COMMENT_DETAIL = "handleGameMomentCommentDetail";
|
||||
private static final String METHOD_HANDLE_SHARE_CARD = "handleShareCard";
|
||||
private static final String METHOD_HANDLE_GAME_MOMENT_DETAIL = "handleGameMomentDetail";
|
||||
private static final String METHOD_HANDLE_GAME_DETAIL = "handleGameDetail";
|
||||
private static final String METHOD_HANDLE_WEB = "handleWeb";
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_HANDLE_HELP_DETAIL)
|
||||
public void handleHelpDetail(Context context, Map<String, Object> params) {
|
||||
StringBuilder builder = new StringBuilder("ghzhushou://" + EntranceConsts.HOST_HELP_DETAIL);
|
||||
String url = (String) params.get("url");
|
||||
if (url != null && !url.isEmpty()) {
|
||||
builder.append("?url=").append(params.get("url"));
|
||||
} else {
|
||||
builder.append("?id=").append(params.get("id"));
|
||||
builder.append("&name=").append(params.get("name"));
|
||||
builder.append("&collection_id=").append(params.get("collection_id"));
|
||||
}
|
||||
DefaultUrlHandler.interceptUrl(context, builder.toString(), "");
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_HANDLE_HELP_SUGGESTION)
|
||||
public void handleHelpSuggestion(Context context, Map<String, Object> params) {
|
||||
String type = (String) params.get("type");
|
||||
DirectUtils.directToSuggestion(context, SuggestType.valueOf(type));
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_HANDLE_QQ_GROUP)
|
||||
public void handleQQGroup(Context context, Map<String, Object> params) {
|
||||
String url = "ghzhushou://" + EntranceConsts.HOST_QQ_QUN + "?key=" + params.get("key");
|
||||
DefaultUrlHandler.interceptUrl(context, url, "");
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_HANDLE_GIFT_DETAIL)
|
||||
public void handleGiftDetail(Context context, Map<String, Object> params) {
|
||||
String entrance = (String) params.get("entrance");
|
||||
Map<String, Object> libaoStatus = (Map<String, Object>) params.get("libaoStatus");
|
||||
Gson gson = new Gson();
|
||||
JsonElement element = gson.toJsonTree(params.get("libao"));
|
||||
LibaoEntity libaoEntity = new Gson().fromJson(element, LibaoEntity.class);
|
||||
libaoEntity.setBeforeStatus((String) libaoStatus.get("status"));
|
||||
libaoEntity.setAvailable((Integer) libaoStatus.get("available"));
|
||||
libaoEntity.setTotal(Integer.parseInt((String) libaoStatus.get("total")));
|
||||
libaoEntity.setCode((String) libaoStatus.get("code"));
|
||||
Intent intent = LibaoDetailActivity.getIntent(context, libaoEntity, false, entrance + "+(礼包中心:最新)");
|
||||
((Activity) context).startActivityForResult(intent, LIBAO_NEW_REQUEST);
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_HANDLE_COMMENT_DETAIL)
|
||||
public void handleGameMomentCommentDetail(Context context, Map<String, Object> params) {
|
||||
String entrance = (String) params.get("entrance");
|
||||
Integer views = (Integer) params.get("views");
|
||||
Integer commentNum = (Integer) params.get("commentnum");
|
||||
Gson gson = new Gson();
|
||||
JsonElement element = gson.toJsonTree(params.get("concern"));
|
||||
ConcernEntity concern = new Gson().fromJson(element, ConcernEntity.class);
|
||||
if (views != null) concern.setViews(views);
|
||||
if (commentNum != null) concern.setCommentnum(commentNum);
|
||||
Intent intent = MessageDetailActivity.getIntentByEntity(context, concern, entrance);
|
||||
((Activity) context).startActivityForResult(intent, NEWS_MESSAGE_ARTICLE_REQUEST);
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_HANDLE_SHARE_CARD)
|
||||
public void handleShareCard(Context context, Map<String, Object> params) {
|
||||
String entrance = (String) params.get("entrance");
|
||||
Gson gson = new Gson();
|
||||
JsonElement element = gson.toJsonTree(params.get("concern"));
|
||||
ConcernEntity concern = new Gson().fromJson(element, ConcernEntity.class);
|
||||
if (concern.getImg() != null && concern.getImg().size() > 0) {
|
||||
ShareCardPicActivity.startShareCardPicActivity(context, concern, entrance);
|
||||
} else {
|
||||
String shareContent;
|
||||
if (concern.getBrief() != null) {
|
||||
shareContent = concern.getBrief();
|
||||
} else {
|
||||
shareContent = concern.getContent();
|
||||
}
|
||||
context.startActivity(ShareCardActivity.getIntent(context, concern, shareContent));
|
||||
}
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_HANDLE_GAME_MOMENT_DETAIL)
|
||||
public void handleGameMomentDetail(Context context, Map<String, Object> params) {
|
||||
String entrance = (String) params.get("entrance");
|
||||
Gson gson = new Gson();
|
||||
JsonElement element = gson.toJsonTree(params.get("concern"));
|
||||
ConcernEntity concern = new Gson().fromJson(element, ConcernEntity.class);
|
||||
DataCollectionUtils.uploadClick(context, "列表", "资讯-关注", concern.getTitle());
|
||||
//统计阅读量
|
||||
if (concern.getLink() != null) {
|
||||
Intent intent = WebActivity.getIntentByNews(context, concern, entrance);
|
||||
((Activity) context).startActivityForResult(intent, NEWS_MESSAGE_ARTICLE_REQUEST);
|
||||
} else {
|
||||
Intent intent = NewsDetailActivity.getIntentById(context, concern.getId(), entrance);
|
||||
((Activity) context).startActivityForResult(intent, NEWS_MESSAGE_ARTICLE_REQUEST);
|
||||
}
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_HANDLE_GAME_DETAIL)
|
||||
public void handleGameDetail(Context context, Map<String, Object> params) {
|
||||
String entrance = (String) params.get("entrance");
|
||||
String gameId = (String) params.get("gameId");
|
||||
if (gameId != null) {
|
||||
GameDetailActivity.startGameDetailActivity(context, gameId, entrance, null);
|
||||
} else {
|
||||
Gson gson = new Gson();
|
||||
JsonElement element = gson.toJsonTree(params.get("game"));
|
||||
GameEntity game = new Gson().fromJson(element, GameEntity.class);
|
||||
DataCollectionUtils.uploadClick(context, "列表", "我的关注", game.getName());
|
||||
GameDetailActivity.startGameDetailActivity(context, game, entrance, null);
|
||||
}
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_HANDLE_WEB)
|
||||
public void handleWeb(Context context, Map<String, Object> params) {
|
||||
String title = (String) params.get("title");
|
||||
String url = (String) params.get("url");
|
||||
if (title != null && url != null) {
|
||||
Intent intent = WebActivity.getWebIntent(context, title, url);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,17 +0,0 @@
|
||||
package com.gh.flutter;
|
||||
|
||||
import com.gh.common.constant.Config;
|
||||
|
||||
import me.ele.lancet.base.annotations.Insert;
|
||||
import me.ele.lancet.base.annotations.TargetClass;
|
||||
|
||||
public class FlutterConfigServiceImplAop {
|
||||
private static final String TARGET_CLASS = FlutterConstants.SERVICE_PACKAGE + ".FlutterConfigServiceImpl";
|
||||
private static final String METHOD_IS_SHOW_PLUGIN = "isShowPlugin";
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_IS_SHOW_PLUGIN)
|
||||
public boolean isShowPlugin(String id) {
|
||||
return Config.isShowPlugin(id);
|
||||
}
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
package com.gh.flutter;
|
||||
|
||||
public class FlutterConstants {
|
||||
private FlutterConstants() {}
|
||||
|
||||
public static final String SERVICE_PACKAGE = "com.halo.assistant.flutter.messenger.service";
|
||||
}
|
||||
@ -1,93 +0,0 @@
|
||||
package com.gh.flutter;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.gh.common.constant.Config;
|
||||
import com.gh.gamecenter.common.BuildConfig;
|
||||
import com.gh.gamecenter.common.exposure.meta.MetaUtil;
|
||||
import com.gh.gamecenter.common.utils.EnvHelper;
|
||||
import com.gh.gamecenter.common.utils.TimestampUtils;
|
||||
import com.gh.gamecenter.entity.SettingsEntity;
|
||||
import com.halo.assistant.HaloApp;
|
||||
|
||||
import me.ele.lancet.base.annotations.Insert;
|
||||
import me.ele.lancet.base.annotations.TargetClass;
|
||||
|
||||
|
||||
public class FlutterContextServiceImplAop {
|
||||
private static final String TARGET_CLASS = FlutterConstants.SERVICE_PACKAGE + ".FlutterContextServiceImpl";
|
||||
private static final String METHOD_GET_USER_AGENT = "getUserAgent";
|
||||
private static final String METHOD_GET_CHANNEL = "getChannel";
|
||||
private static final String METHOD_ADD_TIMESTAMP = "addTimeStamp";
|
||||
private static final String METHOD_GET_OAID = "getOAID";
|
||||
private static final String METHOD_GET_HOST = "getHost";
|
||||
private static final String METHOD_GET_QQ_QUN = "getQQQun";
|
||||
private static final String METHOD_GET_QQ_QUN_KEY = "getQQQunKey";
|
||||
private static final String METHOD_GET_BASE64_ENCODED_IMEI = "getBase64EncodedIMEI";
|
||||
private static final String METHOD_GET_BUILD_TIME = "getBuildTime";
|
||||
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_USER_AGENT)
|
||||
public String getUserAgent() {
|
||||
return HaloApp.getInstance().getUserAgent();
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_CHANNEL)
|
||||
public String getChannel() {
|
||||
return HaloApp.getInstance().getChannel();
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_ADD_TIMESTAMP)
|
||||
public String addTimeStamp(String url) {
|
||||
return TimestampUtils.addTimestamp(url);
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_OAID)
|
||||
public String getOAID() {
|
||||
return HaloApp.getInstance().getOAID();
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_HOST)
|
||||
public String getHost() {
|
||||
return EnvHelper.getHost();
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_QQ_QUN)
|
||||
public String getQQQun() {
|
||||
SettingsEntity mSettings = Config.getSettings();
|
||||
if (mSettings != null && mSettings.getSupport() != null &&
|
||||
!TextUtils.isEmpty(mSettings.getSupport().getQQun())) {
|
||||
return mSettings.getSupport().getQQun();
|
||||
}
|
||||
return "367541038";
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_QQ_QUN_KEY)
|
||||
public String getQQQunKey() {
|
||||
SettingsEntity mSettings = Config.getSettings();
|
||||
if (mSettings != null && mSettings.getSupport() != null &&
|
||||
!TextUtils.isEmpty(mSettings.getSupport().getQQunKey())) {
|
||||
return mSettings.getSupport().getQQunKey();
|
||||
}
|
||||
return "vd754P2_uNUJqDcgX4V-pyXEGZZVH0DE";
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_BASE64_ENCODED_IMEI)
|
||||
public String getBase64EncodedIMEI() {
|
||||
return MetaUtil.getBase64EncodedIMEI();
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_BUILD_TIME)
|
||||
public long getBuildTime() {
|
||||
return BuildConfig.BUILD_TIME;
|
||||
}
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
package com.gh.flutter;
|
||||
|
||||
import com.gh.gamecenter.common.utils.CompressImageUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import me.ele.lancet.base.annotations.Insert;
|
||||
import me.ele.lancet.base.annotations.TargetClass;
|
||||
|
||||
public class FlutterImageServiceImplAop {
|
||||
private static final String TARGET_CLASS = FlutterConstants.SERVICE_PACKAGE + ".FlutterImageServiceImpl";
|
||||
private static final String METHOD_COMPRESS_IMAGE = "compressImage";
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_COMPRESS_IMAGE)
|
||||
public String compressImage(String origin, boolean compressGif) throws Exception {
|
||||
final File file = CompressImageUtils
|
||||
.INSTANCE
|
||||
.compressImageAndSaveToFile(new File(origin), compressGif);
|
||||
return file.getAbsolutePath();
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
package com.gh.flutter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.gh.common.util.LibaoUtils;
|
||||
import com.gh.gamecenter.entity.LibaoEntity;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import me.ele.lancet.base.annotations.Insert;
|
||||
import me.ele.lancet.base.annotations.TargetClass;
|
||||
|
||||
public class FlutterLiBaoServiceImplAop {
|
||||
|
||||
private static final String TARGET_CLASS = FlutterConstants.SERVICE_PACKAGE + ".FlutterLiBaoServiceImpl";
|
||||
private static final String METHOD_LING = "ling";
|
||||
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_LING)
|
||||
public void ling(final Context context,
|
||||
final String entrance,
|
||||
final String libaoText,
|
||||
final String beforeStatus,
|
||||
final Map<String, Object> libao) {
|
||||
Gson gson = new Gson();
|
||||
JsonElement element = gson.toJsonTree(libao);
|
||||
LibaoEntity libaoEntity = new Gson().fromJson(element, LibaoEntity.class);
|
||||
libaoEntity.setBeforeStatus(beforeStatus);
|
||||
LibaoUtils.libaoBtnClick(context, null,
|
||||
libaoEntity, false, null,
|
||||
entrance + "+(礼包中心:最新)", "礼包详情-[" + libaoText + "]",
|
||||
null);
|
||||
}
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
package com.gh.flutter
|
||||
|
||||
import com.gh.gamecenter.common.json.json
|
||||
import com.gh.gamecenter.common.loghub.LoghubUtils
|
||||
import com.gh.gamecenter.common.tracker.Tracker
|
||||
import com.gh.common.util.LogUtils
|
||||
import com.lightgame.utils.Utils
|
||||
import me.ele.lancet.base.annotations.Insert
|
||||
import me.ele.lancet.base.annotations.TargetClass
|
||||
import org.json.JSONObject
|
||||
|
||||
class FlutterLogHubServiceImplAop {
|
||||
|
||||
companion object {
|
||||
private const val TARGET_CLASS = FlutterConstants.SERVICE_PACKAGE + ".FlutterLogHubServiceImpl"
|
||||
private const val METHOD_LOG = "log"
|
||||
fun build(event: String): JSONObject {
|
||||
return json {
|
||||
"event" to event
|
||||
"meta" to LogUtils.getMetaObject()
|
||||
"launch_id" to Tracker.launchId
|
||||
"session_id" to Tracker.sessionId
|
||||
"timestamp" to System.currentTimeMillis() / 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_LOG)
|
||||
fun log(event: String, store: String, extras: Map<String, Any>?) {
|
||||
val json = build(event)
|
||||
if (!extras.isNullOrEmpty())
|
||||
extras.forEach { json.put(it.key, it.value) }
|
||||
Utils.log("NewLogUtils", json.toString(4))
|
||||
LoghubUtils.log(json, store, false)
|
||||
}
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
package com.gh.flutter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.gh.common.util.CheckLoginUtils;
|
||||
|
||||
import me.ele.lancet.base.annotations.Insert;
|
||||
import me.ele.lancet.base.annotations.TargetClass;
|
||||
|
||||
public class FlutterLoginServiceImplAop {
|
||||
private static final String TARGET_CLASS =
|
||||
FlutterConstants.SERVICE_PACKAGE + ".FlutterLoginServiceImpl";
|
||||
private static final String METHOD_LING = "login";
|
||||
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_LING)
|
||||
public void login(Context context, String entrance) {
|
||||
CheckLoginUtils.checkLogin(context, entrance, null);
|
||||
}
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
package com.gh.flutter;
|
||||
|
||||
import com.gh.common.filter.RegionSettingHelper;
|
||||
|
||||
import me.ele.lancet.base.annotations.Insert;
|
||||
import me.ele.lancet.base.annotations.TargetClass;
|
||||
|
||||
public class FlutterRegionSettingServiceImplAop {
|
||||
private static final String TARGET_CLASS =
|
||||
FlutterConstants.SERVICE_PACKAGE + ".FlutterRegionSettingServiceImpl";
|
||||
private static final String METHOD_SHOULD_THIS_GAME_DISPLAY_MIRROR_INFO = "shouldThisGameDisplayMirrorInfo";
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_SHOULD_THIS_GAME_DISPLAY_MIRROR_INFO)
|
||||
public boolean shouldThisGameDisplayMirrorInfo(String gameId) {
|
||||
return RegionSettingHelper.INSTANCE.shouldThisGameDisplayMirrorInfo(gameId);
|
||||
}
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
package com.gh.flutter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import me.ele.lancet.base.annotations.Insert;
|
||||
import me.ele.lancet.base.annotations.TargetClass;
|
||||
|
||||
public class FlutterSharedPreferencesServiceImplAop {
|
||||
private static final String TARGET_CLASS = FlutterConstants.SERVICE_PACKAGE + ".FlutterSharedPreferencesServiceImpl";
|
||||
private static final String METHOD_GET_STRING = "getString";
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_STRING)
|
||||
public String getString(Context context, String key, String defaultValue) {
|
||||
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
return pref.getString(key, defaultValue);
|
||||
}
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
package com.gh.flutter;
|
||||
|
||||
import com.gh.gamecenter.login.entity.UserInfoEntity;
|
||||
import com.gh.gamecenter.login.user.UserManager;
|
||||
|
||||
import me.ele.lancet.base.annotations.Insert;
|
||||
import me.ele.lancet.base.annotations.TargetClass;
|
||||
|
||||
public class FlutterUserServiceImplAop {
|
||||
private static final String TARGET_CLASS = FlutterConstants.SERVICE_PACKAGE + ".FlutterUserServiceImpl";
|
||||
private static final String METHOD_GET_USER_ID = "getUserId";
|
||||
private static final String METHOD_GET_DEVICE_ID = "getDeviceId";
|
||||
private static final String METHOD_GET_TOKEN = "getToken";
|
||||
private static final String METHOD_GET_QQ = "getQq";
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_TOKEN)
|
||||
public String getToken() {
|
||||
return UserManager.getInstance().getToken();
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_USER_ID)
|
||||
public String getUserId() {
|
||||
return UserManager.getInstance().getUserId();
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_DEVICE_ID)
|
||||
public String getDeviceId() {
|
||||
return UserManager.getInstance().getDeviceId();
|
||||
}
|
||||
|
||||
@TargetClass(TARGET_CLASS)
|
||||
@Insert(METHOD_GET_QQ)
|
||||
public String getQq() {
|
||||
UserInfoEntity userInfo = UserManager.getInstance().getUserInfoEntity();
|
||||
if (userInfo != null) {
|
||||
return userInfo.getQq();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
Submodule assistant_flutter deleted from d5fdd3b07c
@ -71,10 +71,6 @@ android.databinding.incremental=true
|
||||
# 部分 vivo 手机不去掉 testOnly 直接装不上 :(
|
||||
android.injected.testOnly = false
|
||||
|
||||
# 启用后每个库的 R 类仅包含库本身声明的资源,而不包含其依赖项的资源
|
||||
# 声明该属性可加快Flutter模块编译速度(Experimental)
|
||||
# android.nonTransitiveRClass=true
|
||||
|
||||
# 动态配置插件
|
||||
isRelease = true
|
||||
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
// Gradle初始化脚本(Flutter注入)
|
||||
apply from: "init.gradle"
|
||||
apply from: "dependencies.gradle"
|
||||
|
||||
rootProject {
|
||||
|
||||
buildscript {
|
||||
ext.flutter_io = System.env.FLUTTER_STORAGE_BASE_URL
|
||||
?: "https://storage.googleapis.com"
|
||||
repositories {
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
dependencies {
|
||||
classpath "com.github.axen1314.lancet:lancet-plugin:$lancet_version"
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven { url "$flutter_io/download.flutter.io" }// Flutter
|
||||
}
|
||||
|
||||
subprojects {
|
||||
if (name == "app") {
|
||||
afterEvaluate { project ->
|
||||
Project flutterProject = rootProject.findProject(":flutter")
|
||||
if (flutterProject == null) {
|
||||
logger.error("Flutter project not found!")
|
||||
} else {
|
||||
project.apply plugin: 'me.ele.lancet'
|
||||
project.dependencies {
|
||||
implementation (flutterProject, {
|
||||
exclude group: 'androidx.legacy', module: "legacy-support-v4" // imei_plugin
|
||||
exclude group: 'com.facebook.fresco', module: 'fresco'// flutter_fresco
|
||||
})
|
||||
compileOnly "com.github.axen1314.lancet:lancet-base:$lancet_version"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -289,12 +289,6 @@ public class UserRepository {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送登录成功回调事件给Flutter
|
||||
* 请不要随意修改方法名
|
||||
*/
|
||||
public static void dispatchOnLoginToFlutter() {}
|
||||
|
||||
//更改用户信息
|
||||
@SuppressLint("CheckResult")
|
||||
public void changeUserInfo(final String content, final String editType, final Boolean isForcedToCertificate) {
|
||||
@ -548,7 +542,6 @@ public class UserRepository {
|
||||
energyTaskHelper.postEnergyTask("login");
|
||||
}
|
||||
}
|
||||
dispatchOnLoginToFlutter();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,68 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
# @author juntao
|
||||
# @2021.11.30
|
||||
|
||||
# 不同的 hosted_url 似乎会造成 pubspec.lock 文件变更,https://github.com/dart-lang/pub/issues/2226
|
||||
export PUB_HOSTED_URL=https://pub.flutter-io.cn
|
||||
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
|
||||
|
||||
version=$(awk -v FS="versionName = " 'NF>1{print $2}' dependencies.gradle | sed "s/\"//g")
|
||||
versionCode=$(awk -v FS="versionCode = " 'NF>1{print $2}' dependencies.gradle | sed "s/\"//g")
|
||||
build_time=$(TZ=Asia/Shanghai date +'%Y-%m%d-%H%M')
|
||||
build_time_without_divider=$(TZ=Asia/Shanghai date +'%Y%m%d%H%M')L
|
||||
|
||||
git checkout module_common/build.gradle
|
||||
git checkout gradle.properties
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
sed -i '' '10 a setBinding(new Binding([gradle: this]))' settings.gradle
|
||||
sed -i '' '11 a evaluate(new File(settingsDir, "assistant_flutter/.android/include_flutter.groovy"))' settings.gradle
|
||||
else
|
||||
sed -i '10 a setBinding(new Binding([gradle: this]))' settings.gradle
|
||||
sed -i '11 a evaluate(new File(settingsDir, "assistant_flutter/.android/include_flutter.groovy"))' settings.gradle
|
||||
fi
|
||||
|
||||
# 添加 -n 代表全局禁用深色模式
|
||||
while getopts "n" arg
|
||||
do
|
||||
case ${arg} in
|
||||
n)
|
||||
# 移除夜间颜色资源
|
||||
rm -r app/src/main/res/values-night
|
||||
rm -r app/src/main/res/drawable-night-xxxhdpi
|
||||
rm -r app/src/main/res/drawable-night
|
||||
rm -r app/src/main/res/drawable-night-nodpi
|
||||
rm -r module_core/src/main/res/drawable-night-xxxhdpi
|
||||
rm -r module_core/src/main/res/values-night
|
||||
rm -r module_common/src/main/res/values-night
|
||||
rm -r module_common/src/main/res/drawable-night-xxxhdpi
|
||||
rm -r module_common/src/main/res/drawable-night-nodpi
|
||||
rm -r module_common/src/main/res/drawable-night
|
||||
sed -i 's/buildConfigField "boolean", "IS_DARK_MODE_ON", "true"/buildConfigField "boolean", "IS_DARK_MODE_ON", "false"/g' module_common/build.gradle
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
cd assistant_flutter
|
||||
|
||||
flutter pub get
|
||||
|
||||
cd ..
|
||||
|
||||
./gradlew --stop
|
||||
./gradlew clean
|
||||
|
||||
sed -i 's/buildConfigField "long", "BUILD_TIME", "0"/buildConfigField "long", "BUILD_TIME", '"\"${build_time_without_divider}\""'/g' module_common/build.gradle
|
||||
|
||||
./gradlew rIR -I init.flutter.gradle
|
||||
if [ ! -f app/build/outputs/apk/internal/release/app-internal-release.apk ]; then
|
||||
./gradlew rIR -I init.gradle
|
||||
fi
|
||||
mv app/build/outputs/apk/internal/release/app-internal-release.apk app/build/tmp/${version}-${versionCode}-internal-${build_time}.apk
|
||||
|
||||
git checkout module_common/build.gradle
|
||||
git checkout gradle.properties
|
||||
git checkout settings.gradle
|
||||
|
||||
cd assistant_flutter
|
||||
git checkout pubspec.lock
|
||||
##!/usr/bin/env bash
|
||||
## @author juntao
|
||||
## @2021.11.30
|
||||
#
|
||||
## 不同的 hosted_url 似乎会造成 pubspec.lock 文件变更,https://github.com/dart-lang/pub/issues/2226
|
||||
#export PUB_HOSTED_URL=https://pub.flutter-io.cn
|
||||
#export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
|
||||
#
|
||||
#version=$(awk -v FS="versionName = " 'NF>1{print $2}' dependencies.gradle | sed "s/\"//g")
|
||||
#versionCode=$(awk -v FS="versionCode = " 'NF>1{print $2}' dependencies.gradle | sed "s/\"//g")
|
||||
#build_time=$(TZ=Asia/Shanghai date +'%Y-%m%d-%H%M')
|
||||
#build_time_without_divider=$(TZ=Asia/Shanghai date +'%Y%m%d%H%M')L
|
||||
#
|
||||
#git checkout module_common/build.gradle
|
||||
#git checkout gradle.properties
|
||||
#
|
||||
#if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
# sed -i '' '10 a setBinding(new Binding([gradle: this]))' settings.gradle
|
||||
# sed -i '' '11 a evaluate(new File(settingsDir, "assistant_flutter/.android/include_flutter.groovy"))' settings.gradle
|
||||
#else
|
||||
# sed -i '10 a setBinding(new Binding([gradle: this]))' settings.gradle
|
||||
# sed -i '11 a evaluate(new File(settingsDir, "assistant_flutter/.android/include_flutter.groovy"))' settings.gradle
|
||||
#fi
|
||||
#
|
||||
## 添加 -n 代表全局禁用深色模式
|
||||
#while getopts "n" arg
|
||||
#do
|
||||
# case ${arg} in
|
||||
# n)
|
||||
# # 移除夜间颜色资源
|
||||
# rm -r app/src/main/res/values-night
|
||||
# rm -r app/src/main/res/drawable-night-xxxhdpi
|
||||
# rm -r app/src/main/res/drawable-night
|
||||
# rm -r app/src/main/res/drawable-night-nodpi
|
||||
# rm -r module_core/src/main/res/drawable-night-xxxhdpi
|
||||
# rm -r module_core/src/main/res/values-night
|
||||
# rm -r module_common/src/main/res/values-night
|
||||
# rm -r module_common/src/main/res/drawable-night-xxxhdpi
|
||||
# rm -r module_common/src/main/res/drawable-night-nodpi
|
||||
# rm -r module_common/src/main/res/drawable-night
|
||||
# sed -i 's/buildConfigField "boolean", "IS_DARK_MODE_ON", "true"/buildConfigField "boolean", "IS_DARK_MODE_ON", "false"/g' module_common/build.gradle
|
||||
# ;;
|
||||
# esac
|
||||
#done
|
||||
#
|
||||
#cd assistant_flutter
|
||||
#
|
||||
#flutter pub get
|
||||
#
|
||||
#cd ..
|
||||
#
|
||||
#./gradlew --stop
|
||||
#./gradlew clean
|
||||
#
|
||||
#sed -i 's/buildConfigField "long", "BUILD_TIME", "0"/buildConfigField "long", "BUILD_TIME", '"\"${build_time_without_divider}\""'/g' module_common/build.gradle
|
||||
#
|
||||
#./gradlew rIR -I init.flutter.gradle
|
||||
#if [ ! -f app/build/outputs/apk/internal/release/app-internal-release.apk ]; then
|
||||
# ./gradlew rIR -I init.gradle
|
||||
#fi
|
||||
#mv app/build/outputs/apk/internal/release/app-internal-release.apk app/build/tmp/${version}-${versionCode}-internal-${build_time}.apk
|
||||
#
|
||||
#git checkout module_common/build.gradle
|
||||
#git checkout gradle.properties
|
||||
#git checkout settings.gradle
|
||||
#
|
||||
#cd assistant_flutter
|
||||
#git checkout pubspec.lock
|
||||
@ -3,8 +3,6 @@ include ':libraries:LGLibrary'
|
||||
include ':libraries:QQShare'
|
||||
include ':libraries:Matisse'
|
||||
include ':vspace-bridge:vspace'
|
||||
//setBinding(new Binding([gradle: this]))
|
||||
//evaluate(new File(settingsDir, "assistant_flutter/.android/include_flutter.groovy"))
|
||||
include ':module_core'
|
||||
include ':module_common'
|
||||
include ':module_login'
|
||||
|
||||
Reference in New Issue
Block a user