Commit e202a05c by 刘鹏

feat: 2.1.2和规划整改

parent ebd09841
...@@ -11,7 +11,7 @@ ext { ...@@ -11,7 +11,7 @@ ext {
"m-user" : "0.0.61.90", "m-user" : "0.0.61.90",
"m-user-medical" : "0.0.61.99", "m-user-medical" : "0.0.61.99",
"m-home" : "0.0.22.70", "m-home" : "0.0.22.70",
"m-im-medical" : "0.0.21.31", "m-im-medical" : "0.0.21.32",
"m-dynamic" : "0.0.7.28", "m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
...@@ -34,7 +34,7 @@ ext { ...@@ -34,7 +34,7 @@ ext {
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//第一步 //第一步
"ydl-platform" : "0.0.40.73", "ydl-platform" : "0.0.41.43",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.57", "ydl-webview" : "0.0.38.57",
...@@ -96,7 +96,7 @@ ext { ...@@ -96,7 +96,7 @@ ext {
"m-user" : "0.0.61.90", "m-user" : "0.0.61.90",
"m-user-medical" : "0.0.61.99", "m-user-medical" : "0.0.61.99",
"m-home" : "0.0.22.70", "m-home" : "0.0.22.70",
"m-im-medical" : "0.0.21.31", "m-im-medical" : "0.0.21.32",
"m-dynamic" : "0.0.7.28", "m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
...@@ -118,7 +118,7 @@ ext { ...@@ -118,7 +118,7 @@ ext {
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//第一步 //第一步
"ydl-platform" : "0.0.40.73", "ydl-platform" : "0.0.41.43",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.57", "ydl-webview" : "0.0.38.57",
......
...@@ -11,6 +11,7 @@ import android.os.Build; ...@@ -11,6 +11,7 @@ import android.os.Build;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import android.text.TextUtils; import android.text.TextUtils;
import com.ydl.ydlcommon.utils.DeviceTool;
import com.ydl.ydlcommon.utils.log.AliYunLogConfig; import com.ydl.ydlcommon.utils.log.AliYunLogConfig;
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper; import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper;
import com.yidianling.avchatkit.common.log.LogUtil; import com.yidianling.avchatkit.common.log.LogUtil;
...@@ -543,6 +544,10 @@ public class NetworkUtil { ...@@ -543,6 +544,10 @@ public class NetworkUtil {
*/ */
public static String getActiveMacAddress(Context context) { public static String getActiveMacAddress(Context context) {
if (!DeviceTool.checkHasAgreeSecret()) {
return "";
}
WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
WifiInfo info = wifi.getConnectionInfo(); WifiInfo info = wifi.getConnectionInfo();
......
...@@ -21,7 +21,6 @@ import kotlinx.android.synthetic.main.user_activity_secret.* ...@@ -21,7 +21,6 @@ import kotlinx.android.synthetic.main.user_activity_secret.*
class SecretActivity : BaseActivity() { class SecretActivity : BaseActivity() {
private var secretDialog: SecretDialog? = null private var secretDialog: SecretDialog? = null
private var mSecretProtocolString: String = ""
companion object { companion object {
val SECRET_PROTOCOL: String = "secret_protocol" val SECRET_PROTOCOL: String = "secret_protocol"
...@@ -47,10 +46,7 @@ class SecretActivity : BaseActivity() { ...@@ -47,10 +46,7 @@ class SecretActivity : BaseActivity() {
} }
private fun getParam() { private fun getParam() {
mSecretProtocolString = intent.getStringExtra(SECRET_PROTOCOL) ?: ""
if (null != user_secret_desc) {
// user_secret_desc.text = Html.fromHtml(mSecretProtocolString)
}
} }
private fun initView() { private fun initView() {
......
...@@ -20,8 +20,8 @@ import android.text.TextUtils; ...@@ -20,8 +20,8 @@ import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import com.tbruyelle.rxpermissions2.RxPermissions; import com.tbruyelle.rxpermissions2.RxPermissions;
import com.yidianling.common.tools.RxTool;
import com.ydl.ydlcommon.BuildConfig; import com.ydl.ydlcommon.BuildConfig;
import com.yidianling.common.tools.RxTool;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.FileReader; import java.io.FileReader;
...@@ -93,7 +93,7 @@ public class DeviceTool { ...@@ -93,7 +93,7 @@ public class DeviceTool {
private static void gotoMeizuPermission(Activity activity) { private static void gotoMeizuPermission(Activity activity) {
Intent intent = new Intent("com.meizu.safe.security.SHOW_APPSEC"); Intent intent = new Intent("com.meizu.safe.security.SHOW_APPSEC");
intent.addCategory(Intent.CATEGORY_DEFAULT); intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.putExtra("packageName", BuildConfig.APPLICATION_ID); intent.putExtra("packageName", getPackageName());
try { try {
activity.startActivity(intent); activity.startActivity(intent);
} catch (Exception e) { } catch (Exception e) {
...@@ -122,7 +122,9 @@ public class DeviceTool { ...@@ -122,7 +122,9 @@ public class DeviceTool {
@SuppressLint("MissingPermission") @SuppressLint("MissingPermission")
public static final String getIMEI() { public static final String getIMEI() {
Activity topTaskActivity = ActivityManager.Companion.getInstance().getTopTaskActivity(); Activity topTaskActivity = ActivityManager.Companion.getInstance().getTopTaskActivity();
if (!checkHasAgreeSecret()) {
return "";
}
try { try {
String imei = ""; String imei = "";
RxPermissions rxPermissions = new RxPermissions(topTaskActivity); RxPermissions rxPermissions = new RxPermissions(topTaskActivity);
...@@ -130,7 +132,7 @@ public class DeviceTool { ...@@ -130,7 +132,7 @@ public class DeviceTool {
if (rxPermissions.isGranted(Manifest.permission.READ_PHONE_STATE)) { if (rxPermissions.isGranted(Manifest.permission.READ_PHONE_STATE)) {
//实例化TelephonyManager对象 //实例化TelephonyManager对象
TelephonyManager telephonyManager = (TelephonyManager) topTaskActivity.getSystemService(Context.TELEPHONY_SERVICE); TelephonyManager telephonyManager = (TelephonyManager) topTaskActivity.getSystemService(Context.TELEPHONY_SERVICE);
if (null == telephonyManager){ if (null == telephonyManager) {
return ""; return "";
} }
//获取IMEI号 //获取IMEI号
...@@ -150,6 +152,10 @@ public class DeviceTool { ...@@ -150,6 +152,10 @@ public class DeviceTool {
public static String getEncryptionAndroidID() { public static String getEncryptionAndroidID() {
if (!checkHasAgreeSecret()) {
return "";
}
try { try {
@SuppressLint("HardwareIds") String id = Settings.Secure.getString( @SuppressLint("HardwareIds") String id = Settings.Secure.getString(
RxTool.getContext().getContentResolver(), RxTool.getContext().getContentResolver(),
...@@ -160,7 +166,12 @@ public class DeviceTool { ...@@ -160,7 +166,12 @@ public class DeviceTool {
return ""; return "";
} }
} }
public static String getAndroidID() { public static String getAndroidID() {
if (!checkHasAgreeSecret()) {
return "";
}
try { try {
@SuppressLint("HardwareIds") String id = Settings.Secure.getString( @SuppressLint("HardwareIds") String id = Settings.Secure.getString(
RxTool.getContext().getContentResolver(), RxTool.getContext().getContentResolver(),
...@@ -238,7 +249,7 @@ public class DeviceTool { ...@@ -238,7 +249,7 @@ public class DeviceTool {
case TelephonyManager.NETWORK_TYPE_LTE: case TelephonyManager.NETWORK_TYPE_LTE:
return NETWORN_4G; return NETWORN_4G;
default: default:
//中国移动 联通 电信 三种3G制式 //中国移动 联通 电信 三种3G制式
if (strSubTypeName.equalsIgnoreCase("TD-SCDMA") || strSubTypeName.equalsIgnoreCase("WCDMA") || strSubTypeName.equalsIgnoreCase("CDMA2000")) { if (strSubTypeName.equalsIgnoreCase("TD-SCDMA") || strSubTypeName.equalsIgnoreCase("WCDMA") || strSubTypeName.equalsIgnoreCase("CDMA2000")) {
return NETWORN_3G; return NETWORN_3G;
} else { } else {
...@@ -251,6 +262,9 @@ public class DeviceTool { ...@@ -251,6 +262,9 @@ public class DeviceTool {
} }
public static String getMac(Context context) { public static String getMac(Context context) {
if (!checkHasAgreeSecret()) {
return "02:00:00:00:00:00";
}
String strMac = null; String strMac = null;
...@@ -276,11 +290,16 @@ public class DeviceTool { ...@@ -276,11 +290,16 @@ public class DeviceTool {
return "02:00:00:00:00:00"; return "02:00:00:00:00:00";
} }
/* /*
* 获取MAC地址 * 获取MAC地址
*GPRS链接和WIFI链接返回同一个MAC地址 *GPRS链接和WIFI链接返回同一个MAC地址
* */ * */
public static String getMacFromHardware() { public static String getMacFromHardware() {
if (!checkHasAgreeSecret()) {
return "02:00:00:00:00:00";
}
try { try {
List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces()); List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces());
for (NetworkInterface nif : all) { for (NetworkInterface nif : all) {
...@@ -306,8 +325,8 @@ public class DeviceTool { ...@@ -306,8 +325,8 @@ public class DeviceTool {
} }
return "02:00:00:00:00:00"; return "02:00:00:00:00:00";
} }
/** /**
*
* 将ip的整数形式转换成ip形式 * 将ip的整数形式转换成ip形式
* *
* @param ipInt * @param ipInt
...@@ -321,6 +340,7 @@ public class DeviceTool { ...@@ -321,6 +340,7 @@ public class DeviceTool {
sb.append((ipInt >> 24) & 0xFF); sb.append((ipInt >> 24) & 0xFF);
return sb.toString(); return sb.toString();
} }
/** /**
* 获取WIFI当前ip地址 * 获取WIFI当前ip地址
* *
...@@ -328,6 +348,10 @@ public class DeviceTool { ...@@ -328,6 +348,10 @@ public class DeviceTool {
* @return * @return
*/ */
public static String getLocalWifiIpAddress(Context context) { public static String getLocalWifiIpAddress(Context context) {
if (!checkHasAgreeSecret()) {
return "隐私协议未同意,不让获取";
}
try { try {
WifiManager wifiManager = (WifiManager) context WifiManager wifiManager = (WifiManager) context
...@@ -343,6 +367,10 @@ public class DeviceTool { ...@@ -343,6 +367,10 @@ public class DeviceTool {
//GPRS连接下的ip //GPRS连接下的ip
public static String getLocalGPRSIpAddress() { public static String getLocalGPRSIpAddress() {
if (!checkHasAgreeSecret()) {
return null;
}
try { try {
for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); ) { for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements(); ) {
NetworkInterface intf = en.nextElement(); NetworkInterface intf = en.nextElement();
...@@ -361,9 +389,14 @@ public class DeviceTool { ...@@ -361,9 +389,14 @@ public class DeviceTool {
/** /**
* 通过网络接口取MAC地址 * 通过网络接口取MAC地址
*
* @return * @return
*/ */
public static String getNewMac() { public static String getNewMac() {
if (!checkHasAgreeSecret()) {
return null;
}
try { try {
List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces()); List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces());
for (NetworkInterface nif : all) { for (NetworkInterface nif : all) {
...@@ -389,17 +422,27 @@ public class DeviceTool { ...@@ -389,17 +422,27 @@ public class DeviceTool {
} }
return null; return null;
} }
public static String getLocalMacAddressFromWifiInfo(Context context) { public static String getLocalMacAddressFromWifiInfo(Context context) {
if (!checkHasAgreeSecret()) {
return null;
}
WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
WifiInfo winfo = wifi.getConnectionInfo(); WifiInfo winfo = wifi.getConnectionInfo();
String mac = winfo.getMacAddress(); String mac = winfo.getMacAddress();
return mac; return mac;
} }
/* /*
* 获取IPV6地址 * 获取IPV6地址
* */ * */
public static String getLocalIpV6() { public static String getLocalIpV6() {
if (!checkHasAgreeSecret()) {
return null;
}
try { try {
for (Enumeration<NetworkInterface> en = NetworkInterface for (Enumeration<NetworkInterface> en = NetworkInterface
.getNetworkInterfaces(); en.hasMoreElements(); ) { .getNetworkInterfaces(); en.hasMoreElements(); ) {
...@@ -424,7 +467,11 @@ public class DeviceTool { ...@@ -424,7 +467,11 @@ public class DeviceTool {
} }
return null; return null;
} }
public static String getMacAddress(Context context) { public static String getMacAddress(Context context) {
if (!checkHasAgreeSecret()) {
return null;
}
// 如果是6.0以下,直接通过wifimanager获取 // 如果是6.0以下,直接通过wifimanager获取
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
...@@ -465,6 +512,10 @@ public class DeviceTool { ...@@ -465,6 +512,10 @@ public class DeviceTool {
} }
private static String getMacAddress0(Context context) { private static String getMacAddress0(Context context) {
if (!checkHasAgreeSecret()) {
return null;
}
if (isAccessWifiStateAuthorized(context)) { if (isAccessWifiStateAuthorized(context)) {
WifiManager wifiMgr = (WifiManager) context WifiManager wifiMgr = (WifiManager) context
.getSystemService(Context.WIFI_SERVICE); .getSystemService(Context.WIFI_SERVICE);
...@@ -522,6 +573,10 @@ public class DeviceTool { ...@@ -522,6 +573,10 @@ public class DeviceTool {
* @return * @return
*/ */
public static String getMacAddress() { public static String getMacAddress() {
if (!checkHasAgreeSecret()) {
return null;
}
String strMacAddr = null; String strMacAddr = null;
try { try {
// 获得IpD地址 // 获得IpD地址
...@@ -541,12 +596,17 @@ public class DeviceTool { ...@@ -541,12 +596,17 @@ public class DeviceTool {
} }
return strMacAddr; return strMacAddr;
} }
/** /**
* 获取移动设备本地IP * 获取移动设备本地IP
* *
* @return * @return
*/ */
private static InetAddress getLocalInetAddress() { private static InetAddress getLocalInetAddress() {
if (!checkHasAgreeSecret()) {
return null;
}
InetAddress ip = null; InetAddress ip = null;
try { try {
// 列举 // 列举
...@@ -582,6 +642,10 @@ public class DeviceTool { ...@@ -582,6 +642,10 @@ public class DeviceTool {
* @return * @return
*/ */
public static String getLocalIpAddress() { public static String getLocalIpAddress() {
if (!checkHasAgreeSecret()) {
return null;
}
try { try {
for (Enumeration<NetworkInterface> en = NetworkInterface for (Enumeration<NetworkInterface> en = NetworkInterface
.getNetworkInterfaces(); en.hasMoreElements(); ) { .getNetworkInterfaces(); en.hasMoreElements(); ) {
...@@ -601,6 +665,10 @@ public class DeviceTool { ...@@ -601,6 +665,10 @@ public class DeviceTool {
} }
public static String getMachineHardwareAddress() { public static String getMachineHardwareAddress() {
if (!checkHasAgreeSecret()) {
return null;
}
Enumeration<NetworkInterface> interfaces = null; Enumeration<NetworkInterface> interfaces = null;
try { try {
interfaces = NetworkInterface.getNetworkInterfaces(); interfaces = NetworkInterface.getNetworkInterfaces();
...@@ -646,6 +714,10 @@ public class DeviceTool { ...@@ -646,6 +714,10 @@ public class DeviceTool {
} }
public static String getLocalMacAddressFromBusybox() { public static String getLocalMacAddressFromBusybox() {
if (!checkHasAgreeSecret()) {
return "";
}
String result = ""; String result = "";
String Mac = ""; String Mac = "";
result = callCmd("busybox ifconfig", "HWaddr"); result = callCmd("busybox ifconfig", "HWaddr");
...@@ -683,4 +755,13 @@ public class DeviceTool { ...@@ -683,4 +755,13 @@ public class DeviceTool {
return result; return result;
} }
/**
* 检查是否同意隐私协议
*/
public static boolean checkHasAgreeSecret() {
String hasAgreeSecret = SharedPreferencesEditor.getString("hasAgreeSecret");
return "true".equals(hasAgreeSecret);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment