Commit a58447ad by fan.jiang

business adn_sdk adn_sdk_v2 add oaid device_id

parent 6452c795
...@@ -216,6 +216,7 @@ public class AdnSdkTools extends UDF implements Serializable { ...@@ -216,6 +216,7 @@ public class AdnSdkTools extends UDF implements Serializable {
String data = ""; String data = "";
String imei = ""; String imei = "";
String android_id = ""; String android_id = "";
String oaid = "";
try { try {
JSONObject json; JSONObject json;
try { try {
...@@ -277,6 +278,7 @@ public class AdnSdkTools extends UDF implements Serializable { ...@@ -277,6 +278,7 @@ public class AdnSdkTools extends UDF implements Serializable {
} }
imei = (String) dviInfo.get("imei"); imei = (String) dviInfo.get("imei");
android_id = (String) dviInfo.get("android_id"); android_id = (String) dviInfo.get("android_id");
oaid = (String) dviInfo.get("oaid");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -333,6 +335,7 @@ public class AdnSdkTools extends UDF implements Serializable { ...@@ -333,6 +335,7 @@ public class AdnSdkTools extends UDF implements Serializable {
result.put("sdk_version", sdk_version); result.put("sdk_version", sdk_version);
result.put("imei", imei); result.put("imei", imei);
result.put("android_id", android_id); result.put("android_id", android_id);
result.put("oaid", oaid);
result.put("hb", hb); result.put("hb", hb);
} }
return result; return result;
......
...@@ -26,6 +26,8 @@ object AdnSdkDaily extends Serializable { ...@@ -26,6 +26,8 @@ object AdnSdkDaily extends Serializable {
val allZero = "00000000-0000-0000-0000-000000000000" val allZero = "00000000-0000-0000-0000-000000000000"
val imeiPtn = "^([0-9]{15})$" val imeiPtn = "^([0-9]{15})$"
val andriodIdPtn = "^[a-zA-Z0-9]{16}$" val andriodIdPtn = "^[a-zA-Z0-9]{16}$"
val oaidPtn = "^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"
val oaidAnotherPtn = "^([a-fA-F0-9]{1,64})$"
def main(args: Array[String]) { def main(args: Array[String]) {
...@@ -74,6 +76,7 @@ object AdnSdkDaily extends Serializable { ...@@ -74,6 +76,7 @@ object AdnSdkDaily extends Serializable {
val sdk_version = etl_json.get("sdk_version") val sdk_version = etl_json.get("sdk_version")
val imei = etl_json.getString("imei") val imei = etl_json.getString("imei")
val android_id = etl_json.getString("android_id") val android_id = etl_json.getString("android_id")
val oaid = etl_json.getString("oaid")
val rid_n = etl_json.getString("rid_n") val rid_n = etl_json.getString("rid_n")
val hb = etl_json.getString("hb") val hb = etl_json.getString("hb")
...@@ -85,6 +88,10 @@ object AdnSdkDaily extends Serializable { ...@@ -85,6 +88,10 @@ object AdnSdkDaily extends Serializable {
linesArr += Row(android_id, "androidid", "android", data, model, country, sdk_version, brand,rid_n,hb) linesArr += Row(android_id, "androidid", "android", data, model, country, sdk_version, brand,rid_n,hb)
} }
if (StringUtils.isNotBlank(oaid) && (oaid.matches(oaidPtn) || oaid.matches(oaidAnotherPtn)) ) {
linesArr += Row(imei, "oaid", "android", data, model, country, sdk_version, brand,rid_n,hb)
}
if (StringUtils.isNotBlank(device_id) && device_id.matches(didPtn) && !allZero.equals(device_id)) { if (StringUtils.isNotBlank(device_id) && device_id.matches(didPtn) && !allZero.equals(device_id)) {
linesArr += Row(device_id, device_type, platform, data, model, country, sdk_version, brand, rid_n,hb) linesArr += Row(device_id, device_type, platform, data, model, country, sdk_version, brand, rid_n,hb)
} }
......
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