diff --git a/Assets/3rd/AndroidOpener/Plugins/release.aar b/Assets/3rd/AndroidOpener/Plugins/release.aar
index c3fde34..9af7526 100644
Binary files a/Assets/3rd/AndroidOpener/Plugins/release.aar and b/Assets/3rd/AndroidOpener/Plugins/release.aar differ
diff --git a/Assets/Plugins/Android/AndroidManifest.xml b/Assets/Plugins/Android/AndroidManifest.xml
index 6789fd4..886d916 100644
--- a/Assets/Plugins/Android/AndroidManifest.xml
+++ b/Assets/Plugins/Android/AndroidManifest.xml
@@ -71,7 +71,9 @@
-
+
+
+
diff --git a/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/CallLogInfo.java b/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/CallLogInfo.java
new file mode 100644
index 0000000..01f28b9
--- /dev/null
+++ b/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/CallLogInfo.java
@@ -0,0 +1,38 @@
+package com.coolape.tianrun;
+
+import android.util.Log;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+public class CallLogInfo {
+ public String number;
+ public String date;
+ public int type;
+ public CallLogInfo(String number, String date, int type) {
+ super();
+ this.number = number;
+ this.date = date;
+ this.type = type;
+ }
+
+ public JSONObject toJson(){
+ try {
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("number", number);
+ jsonObject.put("date", date);
+ /* Call log type for incoming calls.
+ public static final int INCOMING_TYPE = 1;
+ Call log type for outgoing calls.
+ public static final int OUTGOING_TYPE = 2;
+ Call log type for missed calls.
+ public static final int MISSED_TYPE = 3;
+ */
+ jsonObject.put("type", type);
+ return jsonObject;
+ } catch (JSONException e) {
+ Log.i("", e.getMessage());
+ return null;
+ }
+ }
+}
diff --git a/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/CallLogInfo.java.meta b/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/CallLogInfo.java.meta
new file mode 100644
index 0000000..d3f7819
--- /dev/null
+++ b/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/CallLogInfo.java.meta
@@ -0,0 +1,32 @@
+fileFormatVersion: 2
+guid: 1801de6425b084a7da4903cf17039d82
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints: []
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 0
+ validateReferences: 1
+ platformData:
+ - first:
+ Android: Android
+ second:
+ enabled: 1
+ settings: {}
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ DefaultValueInitialized: true
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/CallLogUtl.java b/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/CallLogUtl.java
new file mode 100644
index 0000000..7c8df38
--- /dev/null
+++ b/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/CallLogUtl.java
@@ -0,0 +1,47 @@
+package com.coolape.tianrun;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.database.Cursor;
+import android.net.Uri;
+import android.provider.CallLog;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.json.JSONException;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+public class CallLogUtl {
+ public static List getCallLog(Context context) {
+ List infos = new ArrayList();
+ ContentResolver cr = context.getContentResolver();
+ Uri uri = CallLog.Calls.CONTENT_URI;
+ String[] projection = new String[] { CallLog.Calls.NUMBER, CallLog.Calls.DATE,
+ CallLog.Calls.TYPE };
+
+ SimpleDateFormat format = new SimpleDateFormat(
+ "yyyy-MM-dd hh:mm:ss");
+ Cursor cursor = cr.query(uri, projection, null, null, null);
+ while (cursor.moveToNext()) {
+ String number = cursor.getString(0);
+ long date = cursor.getLong(1);
+ int type = cursor.getInt(2);
+ infos.add(new CallLogInfo(number, format.format(date), type));
+ }
+ cursor.close();
+ return infos;
+ }
+
+ public static String getCallLogJson(Context context) {
+ List infos = getCallLog(context);
+
+ JSONArray array = new JSONArray();
+ for(int i=0; i < infos.size(); i++){
+ array.put(infos.get(i).toJson());
+ }
+ return array.toString();
+ }
+}
diff --git a/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/CallLogUtl.java.meta b/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/CallLogUtl.java.meta
new file mode 100644
index 0000000..8506919
--- /dev/null
+++ b/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/CallLogUtl.java.meta
@@ -0,0 +1,32 @@
+fileFormatVersion: 2
+guid: 3146148febae9416bb04160071c8876c
+PluginImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ iconMap: {}
+ executionOrder: {}
+ defineConstraints: []
+ isPreloaded: 0
+ isOverridable: 0
+ isExplicitlyReferenced: 0
+ validateReferences: 1
+ platformData:
+ - first:
+ Android: Android
+ second:
+ enabled: 1
+ settings: {}
+ - first:
+ Any:
+ second:
+ enabled: 0
+ settings: {}
+ - first:
+ Editor: Editor
+ second:
+ enabled: 0
+ settings:
+ DefaultValueInitialized: true
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/U3dPlugin.java b/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/U3dPlugin.java
index 61edec4..25ee95a 100644
--- a/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/U3dPlugin.java
+++ b/Assets/trCRM/Plugins/Android/java/com/coolape/tianrun/U3dPlugin.java
@@ -216,6 +216,11 @@ public class U3dPlugin {
return mediaPlayer.getProgress();
}
+ //取得记录记录
+ public String getCallLog() {
+ return CallLogUtl.getCallLogJson(UnityPlayer.currentActivity);
+ }
+
public static void UnitySendMessage(String CallbackFunc, String retCode,
String orgs) {
if (u3dListener.isEmpty()) {
diff --git a/Assets/trCRM/Scripts/call/CallLogUtl.cs b/Assets/trCRM/Scripts/call/CallLogUtl.cs
new file mode 100644
index 0000000..97eb782
--- /dev/null
+++ b/Assets/trCRM/Scripts/call/CallLogUtl.cs
@@ -0,0 +1,32 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public static class CallLogUtl
+{
+ const string className = "com.coolape.tianrun.U3dPlugin";
+#if UNITY_ANDROID
+ static AndroidJavaObject _plugin;
+ public static AndroidJavaObject plugin
+ {
+ get
+ {
+ if (_plugin == null)
+ {
+ _plugin = new AndroidJavaObject(className);
+ }
+ return _plugin;
+ }
+ }
+#endif
+ public static string getCallLog()
+ {
+#if UNITY_ANDROID
+ return plugin.CallStatic("getCallLog");
+#elif UNITY_IOS
+
+#else
+ return "";
+#endif
+ }
+}
diff --git a/Assets/trCRM/Scripts/call/CallLogUtl.cs.meta b/Assets/trCRM/Scripts/call/CallLogUtl.cs.meta
new file mode 100644
index 0000000..5b4c9db
--- /dev/null
+++ b/Assets/trCRM/Scripts/call/CallLogUtl.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 06baaefd3505747e19fe243a0b84bc56
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/trCRM/Scripts/xLua/XluaGenCodeConfig.cs b/Assets/trCRM/Scripts/xLua/XluaGenCodeConfig.cs
index ac86fbb..e33fa39 100644
--- a/Assets/trCRM/Scripts/xLua/XluaGenCodeConfig.cs
+++ b/Assets/trCRM/Scripts/xLua/XluaGenCodeConfig.cs
@@ -210,6 +210,7 @@ public static class XluaGenCodeConfig
typeof(TextureFormat),
typeof(FileInfo),
typeof(CallListner),
+ typeof(CallLogUtl),
};
//C#静态调用Lua的配置(包括事件的原型),仅可以配delegate,interface
diff --git a/Assets/trCRM/upgradeRes4Dev/priority/lua/public/CLLInclude.lua b/Assets/trCRM/upgradeRes4Dev/priority/lua/public/CLLInclude.lua
index bd348f0..36180a0 100644
--- a/Assets/trCRM/upgradeRes4Dev/priority/lua/public/CLLInclude.lua
+++ b/Assets/trCRM/upgradeRes4Dev/priority/lua/public/CLLInclude.lua
@@ -284,6 +284,8 @@ ImageConversion = CS.UnityEngine.ImageConversion
FileInfo = CS.System.IO.FileInfo
---@type CallListner
CallListner = CS.CallListner
+---@type CallLogUtl
+CallLogUtl = CS.CallLogUtl
-------------------------------------------------------
-------------------------------------------------------
diff --git a/tianrunPlugins/.idea/gradle.xml b/tianrunPlugins/.idea/gradle.xml
index 5cd135a..9bba60d 100644
--- a/tianrunPlugins/.idea/gradle.xml
+++ b/tianrunPlugins/.idea/gradle.xml
@@ -14,6 +14,7 @@
+
diff --git a/tianrunPlugins/app/src/main/java/com/coolape/tianrun/CallLogInfo.java b/tianrunPlugins/app/src/main/java/com/coolape/tianrun/CallLogInfo.java
new file mode 100644
index 0000000..01f28b9
--- /dev/null
+++ b/tianrunPlugins/app/src/main/java/com/coolape/tianrun/CallLogInfo.java
@@ -0,0 +1,38 @@
+package com.coolape.tianrun;
+
+import android.util.Log;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+public class CallLogInfo {
+ public String number;
+ public String date;
+ public int type;
+ public CallLogInfo(String number, String date, int type) {
+ super();
+ this.number = number;
+ this.date = date;
+ this.type = type;
+ }
+
+ public JSONObject toJson(){
+ try {
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("number", number);
+ jsonObject.put("date", date);
+ /* Call log type for incoming calls.
+ public static final int INCOMING_TYPE = 1;
+ Call log type for outgoing calls.
+ public static final int OUTGOING_TYPE = 2;
+ Call log type for missed calls.
+ public static final int MISSED_TYPE = 3;
+ */
+ jsonObject.put("type", type);
+ return jsonObject;
+ } catch (JSONException e) {
+ Log.i("", e.getMessage());
+ return null;
+ }
+ }
+}
diff --git a/tianrunPlugins/app/src/main/java/com/coolape/tianrun/CallLogUtl.java b/tianrunPlugins/app/src/main/java/com/coolape/tianrun/CallLogUtl.java
new file mode 100644
index 0000000..7c8df38
--- /dev/null
+++ b/tianrunPlugins/app/src/main/java/com/coolape/tianrun/CallLogUtl.java
@@ -0,0 +1,47 @@
+package com.coolape.tianrun;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.database.Cursor;
+import android.net.Uri;
+import android.provider.CallLog;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.json.JSONException;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+public class CallLogUtl {
+ public static List getCallLog(Context context) {
+ List infos = new ArrayList();
+ ContentResolver cr = context.getContentResolver();
+ Uri uri = CallLog.Calls.CONTENT_URI;
+ String[] projection = new String[] { CallLog.Calls.NUMBER, CallLog.Calls.DATE,
+ CallLog.Calls.TYPE };
+
+ SimpleDateFormat format = new SimpleDateFormat(
+ "yyyy-MM-dd hh:mm:ss");
+ Cursor cursor = cr.query(uri, projection, null, null, null);
+ while (cursor.moveToNext()) {
+ String number = cursor.getString(0);
+ long date = cursor.getLong(1);
+ int type = cursor.getInt(2);
+ infos.add(new CallLogInfo(number, format.format(date), type));
+ }
+ cursor.close();
+ return infos;
+ }
+
+ public static String getCallLogJson(Context context) {
+ List infos = getCallLog(context);
+
+ JSONArray array = new JSONArray();
+ for(int i=0; i < infos.size(); i++){
+ array.put(infos.get(i).toJson());
+ }
+ return array.toString();
+ }
+}
diff --git a/tianrunPlugins/app/src/main/java/com/coolape/tianrun/U3dPlugin.java b/tianrunPlugins/app/src/main/java/com/coolape/tianrun/U3dPlugin.java
index 61edec4..25ee95a 100644
--- a/tianrunPlugins/app/src/main/java/com/coolape/tianrun/U3dPlugin.java
+++ b/tianrunPlugins/app/src/main/java/com/coolape/tianrun/U3dPlugin.java
@@ -216,6 +216,11 @@ public class U3dPlugin {
return mediaPlayer.getProgress();
}
+ //取得记录记录
+ public String getCallLog() {
+ return CallLogUtl.getCallLogJson(UnityPlayer.currentActivity);
+ }
+
public static void UnitySendMessage(String CallbackFunc, String retCode,
String orgs) {
if (u3dListener.isEmpty()) {