1.mob SDK升级 2.隐私相关整改

This commit is contained in:
huangjian
2022-08-29 11:35:39 +08:00
parent 264581f8b1
commit 1dc42662f9
27 changed files with 112 additions and 751 deletions

View File

@@ -5,6 +5,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.huawei.agconnect'
apply plugin: 'com.tencent.vasdolly'
apply from: '../mob.gradle'
def onlyArm64 = Boolean.parseBoolean(only_arm64)

View File

@@ -17,10 +17,19 @@
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission
android:name="android.permission.READ_PHONE_STATE"
tools:node="remove" />
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"
tools:node="remove" />
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"
tools:node="remove" />
<!-- 云信权限声明 -->
<!-- 控制呼吸灯,振动器等,用于新消息提醒 -->
<uses-permission android:name="android.permission.FLASHLIGHT" />
@@ -401,45 +410,6 @@
android:targetActivity="com.yizhuan.xchat_android_core.pay.PaymentActivity" />
<!-- 支付相关配置 -->
<!-- shareSDK配置 begin ####################################################### -->
<meta-data
android:name="Mob-AppKey"
android:value="32075fcbba527" />
<meta-data
android:name="Mob-AppSecret"
android:value="9db6e523d459ebd5e102ff2c261f640a" />
<activity
android:name="com.mob.tools.MobUIShell"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:windowSoftInputMode="stateHidden|adjustResize" />
<activity
android:name="cn.sharesdk.tencent.qq.ReceiveActivity"
android:launchMode="singleTask"
android:noHistory="true">
<intent-filter>
<data android:scheme="tencent1109606637" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
<!-- <activity xmlns:tools="http://schemas.android.com/tools"-->
<!-- android:name="cn.sharesdk.wechat.utils.WechatHandlerActivity"-->
<!-- android:configChanges="keyboardHidden|orientation|screenSize"-->
<!-- android:exported="false"-->
<!-- tools:node="merge" />-->
<!-- <activity-alias xmlns:tools="http://schemas.android.com/tools"-->
<!-- android:name="${applicationId}.wxapi.WXEntryActivity"-->
<!-- android:exported="true"-->
<!-- android:targetActivity="cn.sharesdk.wechat.utils.WechatHandlerActivity"-->
<!-- tools:node="merge" />-->
<!-- 为了兼容小程序返回的问题声明WXEntryActivity并把之前的 WechatHandlerActivity注释 -->
<activity
android:name="com.mango.yinyou.wxapi.WXEntryActivity"

View File

@@ -1,110 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<DevInfor>
<!--
说明:
所有集成到您项目的平台都应该为其在表格中填写相对应的开发者信息,以新浪微博为例:
<SinaWeibo
Id="1"
SortId="1"
AppKey="568898243"
AppSecret="38a4f8204cc784f81f9f0daaf31e02e3"
RedirectUrl="http://www.mob.com"
Enable="true" />
其中的SortId是此平台在分享列表中的位置由开发者自行定义可以是任何整型数字数值越大
越靠后AppKey、AppSecret和RedirectUrl是您在新浪微博上注册开发者信息和应用后得到的信息
Id是一个保留的识别符整型ShareSDK不使用此字段供您在自己的项目中当作平台的识别符。
Enable字段表示此平台是否有效布尔值默认为true如果Enable为false即便平台的jar包
已经添加到应用中,平台实例依然不可获取。
各个平台注册应用信息的地址如下:
新浪微博 http://open.weibo.com
微信好友 http://open.weixin.qq.com
Facebook https://developers.facebook.com
Twitter https://dev.twitter.com
人人网 http://dev.renren.com
开心网 http://open.kaixin001.com
搜狐微博 http://open.t.sohu.com
网易微博 http://open.t.163.com
豆瓣 http://developers.douban.com
有道云笔记 http://note.youdao.com/open/developguide.html#app
印象笔记 https://dev.evernote.com/
Linkedin https://developer.linkedin.com
FourSquare https://developer.foursquare.com/
搜狐随身看 https://open.sohu.com/
Flickr http://www.flickr.com/services/
Pinterest http://developers.pinterest.com/
Tumblr http://www.tumblr.com/developers
Dropbox https://www.dropbox.com/developers
Instagram http://instagram.com/developer#
VKontakte http://vk.com/dev
易信好友 http://open.yixin.im/
明道 http://open.mingdao.com/
Line http://media.line.me/zh-hant/ https://developers.line.me
Pocket http://getpocket.com/developer/apps/new
KakaoTalk https://developers.kakao.com/
KakaoStory https://developers.kakao.com/
Plurk http://www.plurk.com/API
-->
<!-- ShareByAppClient标识是否使用微博客户端分享默认是false, -->
<!--
Wechat微信和WechatMoments微信朋友圈的appid是一样的
注意开发者不能用我们这两个平台的appid,否则分享不了
微信测试的时候微信测试需要先签名打包出apk,
sample测试微信要先签名打包keystore在sample项目中密码123456
BypassApproval是绕过审核的标记设置为true后AppId将被忽略故不经过
审核的应用也可以执行分享,但是仅限于分享文字和图片,不能分享其他类型,
默认值为false。此外微信收藏不支持此字段。wx4868b35061f87885
-->
<Wechat
Id="4"
SortId="4"
AppId="wx3f0462eb7eccd64f"
AppSecret="1c07949e3f53433f1c6038bfcdd54c40"
UserName="gh_afb25ac019c9"
Path="pages/index/index.html?id=1"
BypassApproval="false"
Enable="true" />
<WechatMoments
Id="5"
SortId="5"
AppId="wx3f0462eb7eccd64f"
AppSecret="1c07949e3f53433f1c6038bfcdd54c40"
BypassApproval="false"
Enable="true" />
<WechatFavorite
Id="6"
SortId="6"
AppId="wx3f0462eb7eccd64f"
AppSecret="1c07949e3f53433f1c6038bfcdd54c40"
BypassApproval="false"
Enable="true" />
<QQ
Id="7"
SortId="7"
AppId="101937205"
AppKey="458ed9d671ba4b177799189db5fbc434"
BypassApproval="false"
ShareByAppClient="true"
Enable="true" />
<QZone
Id="3"
SortId="3"
AppId="101937205"
AppKey="458ed9d671ba4b177799189db5fbc434"
ShareByAppClient="true"
BypassApproval="false"
Enable="true" />
</DevInfor>

View File

@@ -17,7 +17,6 @@ import static com.yizhuan.xchat_android_core.im.custom.bean.CustomAttachment.CUS
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.ActivityManager;
import android.app.Application;
import android.content.Context;
import android.graphics.Color;
@@ -30,7 +29,6 @@ import android.util.Log;
import androidx.multidex.MultiDex;
import com.alibaba.security.realidentity.RPVerify;
import com.bumptech.glide.request.target.ViewTarget;
import com.bytedance.hume.readapk.HumeSDK;
import com.coorchice.library.utils.LogUtils;
@@ -292,7 +290,7 @@ public class XChatApplication extends Application {
initLinkedMe();
LinkedME.getInstance().setImmediate(true);
MobSDK.init(context);
MobSDK.submitPolicyGrantResult(true, null);
MobSDK.submitPolicyGrantResult(true);
// 友盟统计初始化
UMConfigure.init(context, XChatConstants.UMENG_APP_KEY,
BasicConfig.INSTANCE.getChannel(), UMConfigure.DEVICE_TYPE_PHONE, null);
@@ -497,40 +495,6 @@ public class XChatApplication extends Application {
}
/**
* 获取当前进程名
*
* @param context
* @return 进程名
*/
public static String getProcessName(Context context) {
String processName = null;
// ActivityManager
ActivityManager am = ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE));
while (true) {
for (ActivityManager.RunningAppProcessInfo info : am.getRunningAppProcesses()) {
if (info.pid == android.os.Process.myPid()) {
processName = info.processName;
break;
}
}
// go home
if (!TextUtils.isEmpty(processName)) {
return processName;
}
// take a rest and again
try {
Thread.sleep(100L);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
}
}
/**
* 初始化RxNet
*

View File

@@ -1,153 +0,0 @@
package com.yizhuan.erban.ui.utils.sys;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningTaskInfo;
import android.content.Context;
import android.os.Build;
import android.os.PowerManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.List;
public class SysInfoUtil {
public static final String getOsInfo() {
return Build.VERSION.RELEASE;
}
public static final String getPhoneModelWithManufacturer() {
return Build.MANUFACTURER + " " + Build.MODEL;
}
public static final String getPhoneMode() {
return Build.MODEL;
}
public static final boolean isAppOnForeground(Context context) {
ActivityManager manager = (ActivityManager) context
.getApplicationContext().getSystemService(
Context.ACTIVITY_SERVICE);
String packageName = context.getApplicationContext().getPackageName();
List<ActivityManager.RunningAppProcessInfo> list = manager
.getRunningAppProcesses();
if (list == null)
return false;
boolean ret = false;
Iterator<ActivityManager.RunningAppProcessInfo> it = list.iterator();
while (it.hasNext()) {
ActivityManager.RunningAppProcessInfo appInfo = it.next();
if (appInfo.processName.equals(packageName)
&& appInfo.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND) {
ret = true;
break;
}
}
return ret;
}
public static final boolean isScreenOn(Context context) {
PowerManager powerManager = (PowerManager) context
.getSystemService(Context.POWER_SERVICE);
return powerManager.isScreenOn();
}
public static boolean stackResumed(Context context) {
ActivityManager manager = (ActivityManager) context
.getApplicationContext().getSystemService(
Context.ACTIVITY_SERVICE);
String packageName = context.getApplicationContext().getPackageName();
List<RunningTaskInfo> recentTaskInfos = manager.getRunningTasks(1);
if (recentTaskInfos != null && recentTaskInfos.size() > 0) {
RunningTaskInfo taskInfo = recentTaskInfos.get(0);
if (taskInfo.baseActivity.getPackageName().equals(packageName) && taskInfo.numActivities > 1) {
return true;
}
}
return false;
}
public static final boolean mayOnEmulator(Context context) {
if (mayOnEmulatorViaBuild()) {
return true;
}
if (mayOnEmulatorViaTelephonyDeviceId(context)) {
return true;
}
if (mayOnEmulatorViaQEMU(context)) {
return true;
}
return false;
}
private static final boolean mayOnEmulatorViaBuild() {
/**
* ro.product.model likes sdk
*/
if (!TextUtils.isEmpty(Build.MODEL) && Build.MODEL.toLowerCase().contains("sdk")) {
return true;
}
/**
* ro.product.manufacturer likes unknown
*/
if (!TextUtils.isEmpty(Build.MANUFACTURER) && Build.MANUFACTURER.toLowerCase().contains("unknown")) {
return true;
}
/**
* ro.product.device likes generic
*/
if (!TextUtils.isEmpty(Build.DEVICE) && Build.DEVICE.toLowerCase().contains("generic")) {
return true;
}
return false;
}
private static final boolean mayOnEmulatorViaTelephonyDeviceId(Context context) {
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
if (tm == null) {
return false;
}
String deviceId = tm.getDeviceId();
if (TextUtils.isEmpty(deviceId)) {
return false;
}
/**
* device id of telephony likes '0*'
*/
for (int i = 0; i < deviceId.length(); i++) {
if (deviceId.charAt(i) != '0') {
return false;
}
}
return true;
}
private static final boolean mayOnEmulatorViaQEMU(Context context) {
String qemu = getProp(context, "ro.kernel.qemu");
return "1".equals(qemu);
}
private static final String getProp(Context context, String property) {
try {
ClassLoader cl = context.getClassLoader();
Class<?> SystemProperties = cl.loadClass("android.os.SystemProperties");
Method method = SystemProperties.getMethod("get", String.class);
Object[] params = new Object[1];
params[0] = property;
return (String)method.invoke(SystemProperties, params);
} catch (Exception e) {
return null;
}
}
}

View File

@@ -1,46 +0,0 @@
package com.yizhuan.erban.ui.utils.sys;
import android.app.ActivityManager;
import android.content.Context;
import android.text.TextUtils;
/**
* 系统工具箱
*/
public class SystemUtil {
/**
* 获取当前进程名
* @param context
* @return 进程名
*/
public static final String getProcessName(Context context) {
String processName = null;
// ActivityManager
ActivityManager am = ((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE));
while (true) {
for (ActivityManager.RunningAppProcessInfo info : am.getRunningAppProcesses()) {
if (info.pid == android.os.Process.myPid()) {
processName = info.processName;
break;
}
}
// go home
if (!TextUtils.isEmpty(processName)) {
return processName;
}
// take a rest and again
try {
Thread.sleep(100L);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
}
}
}

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="ssdk_oks_share">Share</string>
<string name="ssdk_oks_sharing">Sharing operation is working in the background…</string>
<string name="ssdk_oks_share_failed">Operation failed</string>
<string name="ssdk_oks_share_completed">Operation succeeded</string>
<string name="ssdk_oks_share_canceled">Operation canceled</string>
<string name="ssdk_oks_cancel">Cancel</string>
<string name="ssdk_oks_multi_share">Photo Sharing</string>
<string name="ssdk_oks_confirm">Confirm</string>
<string name="ssdk_oks_contacts">Contacts</string>
<string name="ssdk_oks_pull_to_refresh">Pull down to refresh</string>
<string name="ssdk_oks_release_to_refresh">Release to refresh</string>
<string name="ssdk_oks_refreshing">Refreshing…</string>
</resources>

View File

@@ -1,81 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="ssdk_weibo_oauth_regiseter">Authorization</string>
<string name="ssdk_website">http://www.mob.com</string>
<string name="ssdk_weibo_upload_content">分享图片</string>
<string name="ssdk_wechat_client_inavailable">Wechat client not exists or the version is too low</string>
<string name="ssdk_google_plus_client_inavailable">Google+ client not exists or the version is too low</string>
<string name="ssdk_qq_client_inavailable">Mobile QQ client not exists or the version is too low</string>
<string name="ssdk_pinterest_client_inavailable">Pinterest client not exists or the version is too low</string>
<string name="ssdk_instagram_client_inavailable">Instagram client not exists or the version is too low</string>
<string name="ssdk_yixin_client_inavailable">Yixin client not exists or the version is too low</string>
<string name="ssdk_line_client_inavailable">Line client not exists or the version is too low</string>
<string name="ssdk_kakaotalk_client_inavailable">KakaoTalk client not exists or the version is too low</string>
<string name="ssdk_kakaostory_client_inavailable">KakaoStory client not exists or the version is too low</string>
<string name="ssdk_whatsapp_client_inavailable">WhatsApp client not exists or the version is too low</string>
<string name="ssdk_laiwang_client_inavailable">Laiwangs client not exists or the version is too low</string>
<string name="ssdk_alipay_client_inavailable">Alipay client not exists or the version is too low</string>
<string name="ssdk_facebookmessenger_client_inavailable">Facebookmessenger client not exists or the version is too low</string>
<string name="ssdk_sinaweibo">Sina Weibo</string>
<string name="ssdk_tencentweibo">Tencent Weibo</string>
<string name="ssdk_qzone">QZone</string>
<string name="ssdk_wechat">WeChat</string>
<string name="ssdk_wechatmoments">WeChat Moments</string>
<string name="ssdk_wechatfavorite">WeChat Favorites</string>
<string name="ssdk_facebook">Facebook</string>
<string name="ssdk_twitter">Twitter</string>
<string name="ssdk_renren">Renren</string>
<string name="ssdk_kaixin">Kaixin</string>
<string name="ssdk_email">Email</string>
<string name="ssdk_shortmessage">Short Message</string>
<string name="ssdk_sohumicroblog">Sohu Microblog</string>
<string name="ssdk_neteasemicroblog">Netease Microblog</string>
<string name="ssdk_douban">Douban</string>
<string name="ssdk_youdao">Youdao</string>
<string name="ssdk_evernote">Evernote</string>
<string name="ssdk_linkedin">Linked in</string>
<string name="ssdk_googleplus">Google+</string>
<string name="ssdk_foursquare">FourSquare</string>
<string name="ssdk_qq">QQ</string>
<string name="ssdk_sohusuishenkan">Sohu Suishenkan</string>
<string name="ssdk_pinterest">Pinterest</string>
<string name="ssdk_flickr">Flickr</string>
<string name="ssdk_tumblr">Tumblr</string>
<string name="ssdk_dropbox">Dropbox</string>
<string name="ssdk_vkontakte">VK</string>
<string name="ssdk_instagram">Instagram</string>
<string name="ssdk_yixin">Yixin</string>
<string name="ssdk_yixinmoments">Yixin Moments</string>
<string name="ssdk_mingdao">Mingdao</string>
<string name="ssdk_kakaotalk">KakaoTalk</string>
<string name="ssdk_kakaostory">KakaoStory</string>
<string name="ssdk_line">Line</string>
<string name="ssdk_bluetooth">Bluetooth</string>
<string name="ssdk_whatsapp">WhatsApp</string>
<string name="ssdk_pocket">Pocket</string>
<string name="ssdk_instapaper">Instapaper</string>
<string name="ssdk_instapaper_email">Email</string>
<string name="ssdk_instapaper_pwd">Password</string>
<string name="ssdk_instapaper_login">Sign In</string>
<string name="ssdk_instapaper_logining">Sign In…</string>
<string name="ssdk_instapager_email_or_password_incorrect">Email or Password incorrect</string>
<string name="ssdk_facebookmessenger">Facebook Messenger</string>
<string name="ssdk_laiwang">Laiwang</string>
<string name="ssdk_laiwangmoments">Laiwang Moments</string>
<string name="ssdk_alipay">Alipay</string>
<string name="ssdk_alipaymoments">Alipay Moments</string>
<string name="ssdk_plurk">Plurk</string>
<string name="ssdk_dingding">Dingding</string>
<string name="ssdk_meipai">Meipai</string>
<string name="ssdk_youtube">Youtube</string>
<string name="ssdk_share_to_qzone">Share To QZone</string>
<string name="ssdk_share_to_qq">Share To QQ</string>
<string name="ssdk_share_to_googleplus">Share To Google+</string>
<string name="ssdk_share_to_facebook">Share To Facebook</string>
<string name="ssdk_mingdao_share_content">Share webpage</string>
<string name="ssdk_share_to_mingdao">Share To Mingdao</string>
<string name="ssdk_share_to_qzone_default">Shared from %s</string>
<string name="ssdk_use_login_button">use login button instead</string>
</resources>

View File

@@ -1,70 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="ssdk_instapager_login_html" formatted="false"><![CDATA[
<!DOCTYPE html>
<html>
<head>
<meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">
<meta content=\"width=device-width,minimum-scale=1,maximum-scale=1,initial-scale=1,user-scalable=no\" id=\"viewport\" name=\"viewport\">
<meta content=\"yes\" name=\"apple-mobile-web-app-capable\">
<title>%s</title>
<style type=\"text/css\">
body{margin:0;padding:0}
.inputstyle {
-webkit-tap-highlight-color:rgba(255,255,255,0);
width:100%%;
height:44px;
color:#000;
background:0;
border:0;
font-size:16px;
outline: none;
-webkit-appearance:none
}
.btn {
width:90%%;
height:44px;
line-height:44px;
background:#A0C035;
border:0;
border-radius:4px;
color:#fff;
font-size:16px;
text-align:center;
margin-top:15px;
display:block
}
.btn:disabled {
background: #dddddd;
}
.error {
color:red;
}
</style>
</head>
<body>
<script type=\"text/javascript\">
function login(form){
var u=form[\"u\"].value,p=form[\"p\"].value;
if(!u || !p)
return false;
form[\"s\"].disabled = true;
return true;
}
</script>
<form style=\"margin-top:45px;\" action=\"%s\" metho=\"get\" onsubmit=\"return login(this);\">
%s
<div style=\"padding-left:15px;border-top:1px solid #E3E3E5;border-bottom:1px solid #E3E3E5;\">
<input type=\"hidden\" name=\"ID_SIGN\" value=\"OWELJSFPWECSFEW\"/>
<input class=\"inputstyle\" id=\"u\" name=\"u\" type=\"text\" value=\"%s\" placeholder=\"%s\" style=\"border-bottom:1px solid #E3E3E5;\"/>
<input class=\"inputstyle\" id=\"p\" name=\"p\" type=\"password\" placeholder=\"%s\"/>
</div>
<p><input style=\"margin:0 auto;\" type=\"submit\" name=\"s\" value=\" %s \" class=\"btn\"/></p>
</form>
</body>
</html>
]]></string>
</resources>

View File

@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="ssdk_oks_classic_platfrom_cell_back_nor">#ffffffff</drawable>
<drawable name="ssdk_oks_classic_platfrom_cell_back_sel">#ffeeeeee</drawable>
</resources>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="ssdk_oks_share">分享</string>
<string name="ssdk_oks_sharing">分享操作正在后台进行…</string>
<string name="ssdk_oks_share_failed">分享失败</string>
<string name="ssdk_oks_share_completed">分享成功</string>
<string name="ssdk_oks_share_canceled">分享已取消</string>
<string name="ssdk_oks_cancel">取消</string>
<string name="ssdk_oks_multi_share">图文分享</string>
<string name="ssdk_oks_confirm">确定</string>
<string name="ssdk_oks_contacts">联系人</string>
<string name="ssdk_oks_pull_to_refresh">下拉刷新</string>
<string name="ssdk_oks_release_to_refresh">松开刷新</string>
<string name="ssdk_oks_refreshing">刷新中…</string>
</resources>

View File

@@ -1,85 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="ssdk_weibo_oauth_regiseter">应用授权</string>
<string name="ssdk_website">http://www.mob.com</string>
<string name="ssdk_weibo_upload_content">分享图片</string>
<string name="ssdk_wechat_client_inavailable">目前您的微信版本过低或未安装微信,需要安装微信才能使用</string>
<string name="ssdk_google_plus_client_inavailable">Google+ 版本过低或者没有安装需要升级或安装Google+才能使用!</string>
<string name="ssdk_qq_client_inavailable">QQ 版本过低或者没有安装需要升级或安装QQ才能使用</string>
<string name="ssdk_pinterest_client_inavailable">Pinterest版本过低或者没有安装需要升级或安装Pinterest才能使用</string>
<string name="ssdk_instagram_client_inavailable">Instagram版本过低或者没有安装需要升级或安装Instagram才能使用</string>
<string name="ssdk_yixin_client_inavailable">目前您的易信版本过低或未安装,需要安装易信才能使用</string>
<string name="ssdk_line_client_inavailable">目前您的Line版本过低或未安装需要安装Line才能使用</string>
<string name="ssdk_kakaotalk_client_inavailable">目前您的KakaoTalk版本过低或未安装需要安装KakaoTalk才能使用</string>
<string name="ssdk_kakaostory_client_inavailable">目前您的KakaoStory版本过低或未安装需要安装KakaoStory才能使用</string>
<string name="ssdk_whatsapp_client_inavailable">目前您的WhatsApp版本过低或未安装需要安装WhatsApp才能使用</string>
<string name="ssdk_laiwang_client_inavailable">目前您的来往版本过低或未安装,需要安装来往才能使用</string>
<string name="ssdk_alipay_client_inavailable">目前您的支付宝版本过低或未安装,需要安装支付宝才能使用</string>
<string name="ssdk_facebookmessenger_client_inavailable">目前您的FacebookMessenger版本过低或未安装需要安装才能使用</string>
<string name="ssdk_sinaweibo">新浪微博</string>
<string name="ssdk_tencentweibo">腾讯微博</string>
<string name="ssdk_qzone">QQ空间</string>
<string name="ssdk_wechat">微信好友</string>
<string name="ssdk_wechatmoments">微信朋友圈</string>
<string name="ssdk_wechatfavorite">微信收藏</string>
<string name="ssdk_facebook">Facebook</string>
<string name="ssdk_twitter">Twitter</string>
<string name="ssdk_renren">人人网</string>
<string name="ssdk_kaixin">开心网</string>
<string name="ssdk_email">邮件</string>
<string name="ssdk_shortmessage">信息</string>
<string name="ssdk_sohumicroblog">搜狐微博</string>
<string name="ssdk_sohusuishenkan">搜狐随身看</string>
<string name="ssdk_neteasemicroblog">网易微博</string>
<string name="ssdk_douban">豆瓣</string>
<string name="ssdk_youdao">有道云笔记</string>
<string name="ssdk_evernote">印象笔记</string>
<string name="ssdk_linkedin">领英</string>
<string name="ssdk_googleplus">Google+</string>
<string name="ssdk_foursquare">FourSquare</string>
<string name="ssdk_qq">QQ</string>
<string name="ssdk_pinterest">Pinterest</string>
<string name="ssdk_flickr">Flickr</string>
<string name="ssdk_tumblr">Tumblr</string>
<string name="ssdk_dropbox">Dropbox</string>
<string name="ssdk_vkontakte">VK</string>
<string name="ssdk_instagram">Instagram</string>
<string name="ssdk_yixin">易信</string>
<string name="ssdk_yixinmoments">易信朋友圈</string>
<string name="ssdk_mingdao">明道</string>
<string name="ssdk_kakaotalk">KakaoTalk</string>
<string name="ssdk_kakaostory">KakaoStory</string>
<string name="ssdk_line">Line</string>
<string name="ssdk_bluetooth">蓝牙</string>
<string name="ssdk_whatsapp">WhatsApp</string>
<string name="ssdk_pocket">Pocket</string>
<string name="ssdk_instapaper">Instapaper</string>
<string name="ssdk_instapaper_email">邮箱</string>
<string name="ssdk_instapaper_pwd">密码</string>
<string name="ssdk_instapaper_login">登录</string>
<string name="ssdk_instapaper_logining">登录中…</string>
<string name="ssdk_instapager_email_or_password_incorrect">Email或密码不正确</string>
<string name="ssdk_facebookmessenger">Facebook Messenger</string>
<string name="ssdk_laiwang">来往</string>
<string name="ssdk_laiwangmoments">来往动态</string>
<string name="ssdk_alipay">支付宝好友</string>
<string name="ssdk_alipaymoments">支付宝生活圈</string>
<string name="ssdk_plurk">Plurk</string>
<string name="ssdk_youtube">Youtube</string>
<string name="ssdk_dingding">钉钉</string>
<string name="ssdk_meipai">美拍</string>
<string name="ssdk_share_to_qzone">分享到QQ空间</string>
<string name="ssdk_share_to_qq">分享到QQ</string>
<string name="ssdk_share_to_facebook">分享到Facebook</string>
<string name="ssdk_mingdao_share_content">网页分享</string>
<string name="ssdk_share_to_mingdao">分享到明道</string>
<string name="ssdk_share_to_googleplus">分享到Google+</string>
<string name="ssdk_share_to_qzone_default">来自%s的分享</string>
<string name="ssdk_use_login_button">请改用“登录”按钮</string>
<string name="ssdk_share_to_youtube">分享到Youtube</string>
<string name="ssdk_gender_male"></string>
<string name="ssdk_gender_female"></string>
<string name="ssdk_symbol_ellipsis">...</string>
</resources>

View File

@@ -26,6 +26,7 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.huawei.agconnect:agcp:1.6.0.300'
classpath 'com.tencent.vasdolly:plugin:3.0.3'
classpath "com.mob.sdk:MobSDK:2018.0319.1724"
}
}

View File

@@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'realm-android'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: '../mob.gradle'
android {
compileSdkVersion 30

View File

@@ -16,6 +16,8 @@ android.injected.testOnly=false
android.useAndroidX=true
android.enableJetifier=true
android.enableResourceOptimizations=false
# mob
MobSDK.spEdition=FP
with_flutter_aar=true
with_jenkins=false

View File

@@ -1,95 +0,0 @@
package com.yizhuan.xchat_android_library.utils;
import android.app.ActivityManager;
import android.content.Context;
import com.yizhuan.xchat_android_library.utils.codec.MD5Utils;
import com.yizhuan.xchat_android_library.utils.log.MLog;
import java.util.List;
/**
* 进程相关的工具类
* @author:wsq
* @time:Dec 16, 2014 4:52:28 PM
*/
public final class ProcessUtil {
/**
* 获取进程相关的文件名除了主进程其他进程文件会改变为fileName_mb5(进程名).hashCode()
* @param context
* @param fileName
* @return
*/
public static String getFileNameBindProcess(Context context, String fileName) {
try{
if(!isMainProcess(context)){
fileName = fileName+"_"+ MD5Utils.getMD5String(getCurProcessName(context)).hashCode();
}
}catch(Exception e){
// fileName += "_unknown";
MLog.error(ProcessUtil.class, "fileName[%s] instead of it,exception on getFileNameBindProcess: %s ", fileName, e);
}
return fileName;
}
/**
* 获取当前进程名称
* @param context
* @return
*/
public static String getCurProcessName(Context context) {
if(context==null){
return null;
}
int pid = android.os.Process.myPid();
ActivityManager mActivityManager = (ActivityManager) context
.getSystemService(Context.ACTIVITY_SERVICE);
for (ActivityManager.RunningAppProcessInfo appProcess : mActivityManager.getRunningAppProcesses()) {
if (appProcess.pid == pid) {
return appProcess.processName;
}
}
return null;
}
/**
* 判断当前进程是否android的主进程
* @param context
* @return
*/
public static boolean isMainProcess(Context context){
if(context==null){
return false;
}
String curProcessName = getCurProcessName(context);
String processName = context.getApplicationInfo().processName;
return processName.equals(curProcessName);
}
/**
* app是否处于后台
* @param context
* @return
*/
public static boolean isBackground(Context context) {
try{
ActivityManager activityManager = (ActivityManager) context
.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningAppProcessInfo> appProcesses = activityManager
.getRunningAppProcesses();
final String packageName = context.getPackageName();
for (ActivityManager.RunningAppProcessInfo appProcess : appProcesses) {
if (appProcess.processName.equals(packageName)) {
return (appProcess.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_BACKGROUND);
}
}
return false;
}catch(Exception e){
MLog.error(ProcessUtil.class, "isBackground exceptioon: %s",e);
return false;
}
}
}

39
mob.gradle Normal file
View File

@@ -0,0 +1,39 @@
apply plugin: 'com.mob.sdk'
MobSDK {
appKey "32075fcbba527"
appSecret "9db6e523d459ebd5e102ff2c261f640a"
ShareSDK {
//平台配置信息
gui false
devInfo {
Wechat {
appId "wx3f0462eb7eccd64f"
appSecret "1c07949e3f53433f1c6038bfcdd54c40"
}
WechatMoments {
appId "wx3f0462eb7eccd64f"
appSecret "1c07949e3f53433f1c6038bfcdd54c40"
}
QQ {
appId "101937205"
appKey "458ed9d671ba4b177799189db5fbc434"
shareByAppClient true
}
QZone {
appId "101937205"
appKey "458ed9d671ba4b177799189db5fbc434"
shareByAppClient true
}
}
}
permissions {
exclude "android.permission.READ_PHONE_STATE", "android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION", "android.permission.QUERY_ALL_PACKAGES"
}
}

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<DevInfor>
<SinaWeibo Enable="false" />
<TencentWeibo Enable="false" />
<Douban Enable="false" />
<QZone AppId="101937205" AppKey="458ed9d671ba4b177799189db5fbc434" ShareByAppClient="true" />
<Renren Enable="false" />
<KaiXin Enable="false" />
<Facebook Enable="false" />
<Twitter Enable="false" />
<Evernote Enable="false" />
<FourSquare Enable="false" />
<GooglePlus Enable="false" />
<Instagram Enable="false" />
<LinkedIn Enable="false" />
<Tumblr Enable="false" />
<Email Enable="false" />
<ShortMessage Enable="false" />
<Wechat AppId="wx3f0462eb7eccd64f" AppSecret="1c07949e3f53433f1c6038bfcdd54c40" />
<WechatMoments AppId="wx3f0462eb7eccd64f" AppSecret="1c07949e3f53433f1c6038bfcdd54c40" />
<QQ AppId="101937205" AppKey="458ed9d671ba4b177799189db5fbc434" ShareByAppClient="true" />
<Instapaper Enable="false" />
<Pocket Enable="false" />
<YouDao Enable="false" />
<Pinterest Enable="false" />
<Flickr Enable="false" />
<Dropbox Enable="false" />
<VKontakte Enable="false" />
<WechatFavorite Enable="false" />
<Yixin Enable="false" />
<YixinMoments Enable="false" />
<Mingdao Enable="false" />
<Line Enable="false" />
<WhatsApp Enable="false" />
<KakaoTalk Enable="false" />
<KakaoStory Enable="false" />
<FacebookMessenger Enable="false" />
<Alipay Enable="false" />
<AlipayMoments Enable="false" />
<Dingding Enable="false" />
<Youtube Enable="false" />
<Meipai Enable="false" />
<Telegram Enable="false" />
<Cmcc Enable="false" />
<Reddit Enable="false" />
<Telecom Enable="false" />
<Accountkit Enable="false" />
<Douyin Enable="false" />
<Wework Enable="false" />
<HWAccount Enable="false" />
<Oasis Enable="false" />
<XMAccount Enable="false" />
<SnapChat Enable="false" />
<Kuaishou Enable="false" />
<Littleredbook Enable="false" />
<Watermelonvideo Enable="false" />
<Tiktok Enable="false" />
</DevInfor>