@onekeyfe/react-native-jpush 0.0.0-stage → 6.7.0-22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +56 -2
- package/ReactNativeJpush.podspec +66 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +144 -0
- package/android/fcm/build.gradle +36 -0
- package/android/fcm/consumer-rules.pro +2 -0
- package/android/fcm/src/main/AndroidManifest.xml +25 -0
- package/android/fcm/src/main/java/com/onekey/jpush/fcm/FcmInitProvider.java +25 -0
- package/android/fcm/src/main/java/com/onekey/jpush/fcm/FcmMessagingService.java +84 -0
- package/android/fcm/src/main/java/com/onekey/jpush/fcm/FcmPushManager.java +69 -0
- package/android/fcm/src/test/java/com/onekey/jpush/fcm/FcmAdapterTest.java +684 -0
- package/android/fcm/src/test/java/com/onekey/jpush/fcm/FcmManifestTest.java +54 -0
- package/android/gradle.properties +4 -0
- package/android/src/main/AndroidManifest.xml +143 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/cn/android/service/JTransitActivity.java +19 -0
- package/android/src/main/java/cn/jiguang/android/BuildConfig.java +10 -0
- package/android/src/main/java/cn/jiguang/android/IDataShare.java +190 -0
- package/android/src/main/java/cn/jiguang/api/BaseLogger.java +82 -0
- package/android/src/main/java/cn/jiguang/api/JAction.java +22 -0
- package/android/src/main/java/cn/jiguang/api/JActionExtra.java +21 -0
- package/android/src/main/java/cn/jiguang/api/JAnalyticsAction.java +11 -0
- package/android/src/main/java/cn/jiguang/api/JCoreInterface.java +228 -0
- package/android/src/main/java/cn/jiguang/api/JCoreManager.java +156 -0
- package/android/src/main/java/cn/jiguang/api/JDispatchAction.java +66 -0
- package/android/src/main/java/cn/jiguang/api/MultiSpHelper.java +114 -0
- package/android/src/main/java/cn/jiguang/api/ReportCallBack.java +9 -0
- package/android/src/main/java/cn/jiguang/api/SdkType.java +13 -0
- package/android/src/main/java/cn/jiguang/api/utils/JCollectionAuth.java +28 -0
- package/android/src/main/java/cn/jiguang/core/JCoreCrypto.java +545 -0
- package/android/src/main/java/cn/jiguang/core/JCoreStorage.java +737 -0
- package/android/src/main/java/cn/jiguang/core/JCoreTcpEngine.java +1395 -0
- package/android/src/main/java/cn/jiguang/core/JCoreWireCodec.java +1716 -0
- package/android/src/main/java/cn/jiguang/internal/ActionManager.java +63 -0
- package/android/src/main/java/cn/jiguang/internal/JConstants.java +61 -0
- package/android/src/main/java/cn/jiguang/internal/JCoreHelperAction.java +12 -0
- package/android/src/main/java/cn/jiguang/internal/JCoreInternalHelper.java +102 -0
- package/android/src/main/java/cn/jiguang/net/DefaultHostVerifier.java +40 -0
- package/android/src/main/java/cn/jiguang/net/HttpRequest.java +78 -0
- package/android/src/main/java/cn/jiguang/net/HttpResponse.java +48 -0
- package/android/src/main/java/cn/jiguang/net/HttpUtils.java +106 -0
- package/android/src/main/java/cn/jiguang/plugins/core/JCoreModule.java +91 -0
- package/android/src/main/java/cn/jiguang/plugins/core/JCorePackage.java +27 -0
- package/android/src/main/java/cn/jiguang/plugins/push/JPushModule.java +773 -0
- package/android/src/main/java/cn/jiguang/plugins/push/JPushPackage.java +25 -0
- package/android/src/main/java/cn/jiguang/plugins/push/common/JConstants.java +88 -0
- package/android/src/main/java/cn/jiguang/plugins/push/common/JLogger.java +122 -0
- package/android/src/main/java/cn/jiguang/plugins/push/helper/JPushHelper.java +710 -0
- package/android/src/main/java/cn/jiguang/plugins/push/receiver/JPushBroadcastReceiver.java +37 -0
- package/android/src/main/java/cn/jiguang/plugins/push/receiver/JPushModuleReceiver.java +264 -0
- package/android/src/main/java/cn/jiguang/plugins/service/JCoreModuleService.java +7 -0
- package/android/src/main/java/cn/jpush/android/api/BasicPushNotificationBuilder.java +83 -0
- package/android/src/main/java/cn/jpush/android/api/CallBackParams.java +50 -0
- package/android/src/main/java/cn/jpush/android/api/CmdMessage.java +33 -0
- package/android/src/main/java/cn/jpush/android/api/CustomMessage.java +28 -0
- package/android/src/main/java/cn/jpush/android/api/CustomPushNotificationBuilder.java +81 -0
- package/android/src/main/java/cn/jpush/android/api/DefaultPushNotificationBuilder.java +90 -0
- package/android/src/main/java/cn/jpush/android/api/InAppSlotParams.java +65 -0
- package/android/src/main/java/cn/jpush/android/api/InstrumentedActivity.java +17 -0
- package/android/src/main/java/cn/jpush/android/api/InstrumentedListActivity.java +17 -0
- package/android/src/main/java/cn/jpush/android/api/JPushInterface.java +490 -0
- package/android/src/main/java/cn/jpush/android/api/JPushMessage.java +121 -0
- package/android/src/main/java/cn/jpush/android/api/JThirdPlatFormInterface.java +247 -0
- package/android/src/main/java/cn/jpush/android/api/MultiActionsNotificationBuilder.java +72 -0
- package/android/src/main/java/cn/jpush/android/api/NotificationCustomButton.java +50 -0
- package/android/src/main/java/cn/jpush/android/api/NotificationMessage.java +67 -0
- package/android/src/main/java/cn/jpush/android/api/PushNotificationBuilder.java +13 -0
- package/android/src/main/java/cn/jpush/android/api/TagAliasCallback.java +8 -0
- package/android/src/main/java/cn/jpush/android/data/JPushCollectControl.java +96 -0
- package/android/src/main/java/cn/jpush/android/data/JPushConfig.java +79 -0
- package/android/src/main/java/cn/jpush/android/data/JPushConfigEx.java +41 -0
- package/android/src/main/java/cn/jpush/android/data/JPushLocalNotification.java +155 -0
- package/android/src/main/java/cn/jpush/android/helper/JCoreHelper.java +70 -0
- package/android/src/main/java/cn/jpush/android/helper/Logger.java +82 -0
- package/android/src/main/java/cn/jpush/android/local/ActionHelper.java +1293 -0
- package/android/src/main/java/cn/jpush/android/local/ActivityLifeCallBack.java +47 -0
- package/android/src/main/java/cn/jpush/android/local/JPushAction.java +67 -0
- package/android/src/main/java/cn/jpush/android/local/JPushConstants.java +34 -0
- package/android/src/main/java/cn/jpush/android/local/JPushResponse.java +26 -0
- package/android/src/main/java/cn/jpush/android/local/ProxyActivityAction.java +34 -0
- package/android/src/main/java/cn/jpush/android/service/AlarmReceiver.java +15 -0
- package/android/src/main/java/cn/jpush/android/service/BActivity.java +19 -0
- package/android/src/main/java/cn/jpush/android/service/DActivity.java +19 -0
- package/android/src/main/java/cn/jpush/android/service/DaemonService.java +17 -0
- package/android/src/main/java/cn/jpush/android/service/DataProvider.java +136 -0
- package/android/src/main/java/cn/jpush/android/service/DataShare.java +129 -0
- package/android/src/main/java/cn/jpush/android/service/DownloadProvider.java +139 -0
- package/android/src/main/java/cn/jpush/android/service/InitProvider.java +48 -0
- package/android/src/main/java/cn/jpush/android/service/JCommonService.java +79 -0
- package/android/src/main/java/cn/jpush/android/service/JNotifyActivity.java +28 -0
- package/android/src/main/java/cn/jpush/android/service/JPushMessageReceiver.java +94 -0
- package/android/src/main/java/cn/jpush/android/service/PushReceiver.java +26 -0
- package/android/src/main/java/cn/jpush/android/service/PushService.java +28 -0
- package/android/src/main/java/cn/jpush/android/service/SchedulerReceiver.java +17 -0
- package/android/src/main/java/cn/jpush/android/service/TagAliasReceiver.java +11 -0
- package/android/src/main/java/cn/jpush/android/service/WakedResultReceiver.java +24 -0
- package/android/src/main/java/cn/jpush/android/ui/FullScreenView.java +11 -0
- package/android/src/main/java/cn/jpush/android/ui/PopWinActivity.java +16 -0
- package/android/src/main/java/cn/jpush/android/ui/PushActivity.java +27 -0
- package/android/src/main/java/cn/jpush/android/ui/RoundedImageView.java +63 -0
- package/android/src/main/java/cn/jpush/android/ui/ShadowViewCard.java +56 -0
- package/android/src/main/java/cn/jpush/android/ups/ICallbackResult.java +5 -0
- package/android/src/main/java/cn/jpush/android/ups/JPushUPSManager.java +37 -0
- package/android/src/main/java/cn/jpush/android/ups/TokenResult.java +47 -0
- package/android/src/main/java/cn/jpush/android/ups/UPSRegisterCallBack.java +4 -0
- package/android/src/main/java/cn/jpush/android/ups/UPSTurnCallBack.java +4 -0
- package/android/src/main/java/cn/jpush/android/ups/UPSUnRegisterCallBack.java +4 -0
- package/android/src/main/java/com/margelo/nitro/reactnativejpush/ReactNativeJpush.kt +455 -0
- package/android/src/main/java/com/margelo/nitro/reactnativejpush/ReactNativeJpushPackage.kt +50 -0
- package/android/src/main/res/values/jpush_string.xml +7 -0
- package/android/src/main/res/values/jpush_style.xml +22 -0
- package/android/src/test/java/com/margelo/nitro/reactnativejpush/JPushCloudHandshakeTest.java +110 -0
- package/android/src/test/java/com/margelo/nitro/reactnativejpush/JPushHandshakeFailureTest.java +73 -0
- package/android/src/test/java/com/margelo/nitro/reactnativejpush/ReactNativeJpushProtocolTest.java +908 -0
- package/ios/ReactNativeJpush.swift +522 -0
- package/ios/bridge/RCTJCoreModule.h +5 -0
- package/ios/bridge/RCTJCoreModule.m +31 -0
- package/ios/bridge/RCTJPushEventQueue.h +14 -0
- package/ios/bridge/RCTJPushEventQueue.m +23 -0
- package/ios/bridge/RCTJPushModule.h +37 -0
- package/ios/bridge/RCTJPushModule.m +1165 -0
- package/ios/include/JCOREService.h +3 -0
- package/ios/include/JGCOREAPI.h +14 -0
- package/ios/include/JGInforCollectionAuth.h +17 -0
- package/ios/include/JGInforCollectionAuthItems.h +2 -0
- package/ios/include/JGPushNotificationTrigger.h +2 -0
- package/ios/include/JPUSHService.h +359 -0
- package/ios/jcore/JCOREConfiguration.h +141 -0
- package/ios/jcore/JCOREConfiguration.m +703 -0
- package/ios/jcore/JCORECrypto.h +73 -0
- package/ios/jcore/JCORECrypto.m +649 -0
- package/ios/jcore/JCORESisResolver.h +56 -0
- package/ios/jcore/JCORESisResolver.m +525 -0
- package/ios/jcore/JCORETcpSession.h +42 -0
- package/ios/jcore/JCORETcpSession.m +956 -0
- package/ios/jcore/JCOREWireProtocol.h +274 -0
- package/ios/jcore/JCOREWireProtocol.m +1453 -0
- package/ios/jpush/JPUSHModels.m +214 -0
- package/ios/jpush/JPUSHNotificationManager.h +34 -0
- package/ios/jpush/JPUSHNotificationManager.m +360 -0
- package/ios/jpush/JPUSHService.m +794 -0
- package/ios/tests/ReactNativeJpushTests.m +148 -0
- package/lib/module/ReactNativeJpush.nitro.js +4 -0
- package/lib/module/ReactNativeJpush.nitro.js.map +1 -0
- package/lib/module/index.js +801 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/ReactNativeJpush.nitro.d.ts +60 -0
- package/lib/typescript/src/ReactNativeJpush.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +235 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +23 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string_std__string.hpp +76 -0
- package/nitrogen/generated/android/c++/JHybridReactNativeJpushSpec.cpp +310 -0
- package/nitrogen/generated/android/c++/JHybridReactNativeJpushSpec.hpp +115 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativejpush/Func_void_bool.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativejpush/Func_void_std__string_std__string.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativejpush/HybridReactNativeJpushSpec.kt +274 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativejpush/reactnativejpushOnLoad.kt +35 -0
- package/nitrogen/generated/android/reactnativejpush+autolinking.cmake +81 -0
- package/nitrogen/generated/android/reactnativejpush+autolinking.gradle +27 -0
- package/nitrogen/generated/android/reactnativejpushOnLoad.cpp +58 -0
- package/nitrogen/generated/android/reactnativejpushOnLoad.hpp +34 -0
- package/nitrogen/generated/ios/ReactNativeJpush+autolinking.rb +62 -0
- package/nitrogen/generated/ios/ReactNativeJpush-Swift-Cxx-Bridge.cpp +49 -0
- package/nitrogen/generated/ios/ReactNativeJpush-Swift-Cxx-Bridge.hpp +147 -0
- package/nitrogen/generated/ios/ReactNativeJpush-Swift-Cxx-Umbrella.hpp +46 -0
- package/nitrogen/generated/ios/ReactNativeJpushAutolinking.mm +33 -0
- package/nitrogen/generated/ios/ReactNativeJpushAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridReactNativeJpushSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridReactNativeJpushSpecSwift.hpp +402 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridReactNativeJpushSpec.swift +107 -0
- package/nitrogen/generated/ios/swift/HybridReactNativeJpushSpec_cxx.swift +723 -0
- package/nitrogen/generated/shared/c++/HybridReactNativeJpushSpec.cpp +73 -0
- package/nitrogen/generated/shared/c++/HybridReactNativeJpushSpec.hpp +116 -0
- package/package.json +174 -4
- package/src/ReactNativeJpush.nitro.ts +93 -0
- package/src/index.tsx +1090 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
package cn.jpush.android.local;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.app.Application;
|
|
5
|
+
import android.os.Bundle;
|
|
6
|
+
|
|
7
|
+
public class ActivityLifeCallBack implements Application.ActivityLifecycleCallbacks {
|
|
8
|
+
private static int activityTaskCount = 0;
|
|
9
|
+
|
|
10
|
+
@Override
|
|
11
|
+
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@Override
|
|
15
|
+
public void onActivityStarted(Activity activity) {
|
|
16
|
+
if (activityTaskCount == 0) {
|
|
17
|
+
JPushConstants.isForeGround = true;
|
|
18
|
+
}
|
|
19
|
+
activityTaskCount++;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@Override
|
|
23
|
+
public void onActivityResumed(Activity activity) {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@Override
|
|
27
|
+
public void onActivityPaused(Activity activity) {
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@Override
|
|
31
|
+
public void onActivityStopped(Activity activity) {
|
|
32
|
+
if (activityTaskCount > 0) {
|
|
33
|
+
activityTaskCount--;
|
|
34
|
+
}
|
|
35
|
+
if (activityTaskCount == 0) {
|
|
36
|
+
JPushConstants.isForeGround = false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Override
|
|
41
|
+
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@Override
|
|
45
|
+
public void onActivityDestroyed(Activity activity) {
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
package cn.jpush.android.local;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.content.Context;
|
|
5
|
+
import android.content.Intent;
|
|
6
|
+
import android.os.Bundle;
|
|
7
|
+
import cn.jpush.android.api.CallBackParams;
|
|
8
|
+
import cn.jpush.android.api.CustomMessage;
|
|
9
|
+
import cn.jpush.android.api.NotificationMessage;
|
|
10
|
+
import cn.jpush.android.service.JPushMessageReceiver;
|
|
11
|
+
import java.nio.ByteBuffer;
|
|
12
|
+
|
|
13
|
+
public abstract class JPushAction {
|
|
14
|
+
public abstract Object beforLogin(Context context, String sdkType, int cmd, String key);
|
|
15
|
+
|
|
16
|
+
public abstract Object beforRegister(Context context, String sdkType, int cmd, String key);
|
|
17
|
+
|
|
18
|
+
public abstract boolean checkActionInfo(String sdkType);
|
|
19
|
+
|
|
20
|
+
public abstract void dispatchMessage(
|
|
21
|
+
Context context,
|
|
22
|
+
String sdkType,
|
|
23
|
+
int command,
|
|
24
|
+
int version,
|
|
25
|
+
long rid,
|
|
26
|
+
long uid,
|
|
27
|
+
ByteBuffer body
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
public abstract void dispatchTimeOutMessage(Context context, String sdkType, long rid, int command);
|
|
31
|
+
|
|
32
|
+
public abstract Object getDataByCmd(Context context, int cmd);
|
|
33
|
+
|
|
34
|
+
public abstract ProxyActivityAction getPopWinActivity(Context context);
|
|
35
|
+
|
|
36
|
+
public abstract ProxyActivityAction getPushActivity(Context context);
|
|
37
|
+
|
|
38
|
+
public abstract String getSdkVersion(String sdkType);
|
|
39
|
+
|
|
40
|
+
public abstract void handleAction(Context context, String action, Object data);
|
|
41
|
+
|
|
42
|
+
public abstract void handleNotificationIntent(Context context, Intent intent);
|
|
43
|
+
|
|
44
|
+
public abstract boolean isSupportedCMD(String sdkType, int command);
|
|
45
|
+
|
|
46
|
+
public abstract void onActivityLifeCallback(Activity activity, String lifecycleEvent);
|
|
47
|
+
|
|
48
|
+
public abstract void onInAppMessageClick(Context context, NotificationMessage message);
|
|
49
|
+
|
|
50
|
+
public abstract void onInAppMessageShow(Context context, NotificationMessage message);
|
|
51
|
+
|
|
52
|
+
public abstract void onJPushMessageReceive(Context context, JPushMessageReceiver receiver, Intent intent);
|
|
53
|
+
|
|
54
|
+
public abstract void onJPushMessageReceive(Context context, String receiverClassName, String messageType, Bundle bundle);
|
|
55
|
+
|
|
56
|
+
public abstract void onMessage(Context context, CustomMessage message);
|
|
57
|
+
|
|
58
|
+
public abstract void onMultiAction(Context context, Intent intent);
|
|
59
|
+
|
|
60
|
+
public abstract void onNotifyMessageArrived(Context context, NotificationMessage message);
|
|
61
|
+
|
|
62
|
+
public abstract void onNotifyMessageOpened(Context context, NotificationMessage message);
|
|
63
|
+
|
|
64
|
+
public abstract void onTagAliasResponse(Context context, long rid, int statusCode, Intent intent);
|
|
65
|
+
|
|
66
|
+
public abstract void setAliasAndTags(Context context, String alias, java.util.Set<String> tags, CallBackParams params);
|
|
67
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
package cn.jpush.android.local;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import cn.jiguang.core.JCoreStorage;
|
|
5
|
+
|
|
6
|
+
public class JPushConstants {
|
|
7
|
+
public static final String SDK_TYPE = "JPUSH";
|
|
8
|
+
public static final String SDK_NAME = "JPush";
|
|
9
|
+
public static final String SDK_VERSION_NAME = "5.9.0";
|
|
10
|
+
public static final int SDK_VERSION_CODE = 590;
|
|
11
|
+
public static final String DISPATCH_ACTION_CLASS = "cn.jpush.android.local.JPushDispatchAction";
|
|
12
|
+
public static final String ENCODING_UTF_8 = "UTF-8";
|
|
13
|
+
public static boolean isForeGround = true;
|
|
14
|
+
public static Context mApplicationContext;
|
|
15
|
+
|
|
16
|
+
public static void init(Context context) {
|
|
17
|
+
if (context != null) {
|
|
18
|
+
try {
|
|
19
|
+
Context app = context.getApplicationContext();
|
|
20
|
+
mApplicationContext = app != null ? app : context;
|
|
21
|
+
} catch (Throwable ignored) {
|
|
22
|
+
mApplicationContext = context;
|
|
23
|
+
}
|
|
24
|
+
JCoreStorage.setAppContext(mApplicationContext);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public static Context getAppContext(Context context) {
|
|
29
|
+
if (mApplicationContext == null && context != null) {
|
|
30
|
+
init(context);
|
|
31
|
+
}
|
|
32
|
+
return mApplicationContext != null ? mApplicationContext : JCoreStorage.getAppContext(context);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
package cn.jpush.android.local;
|
|
2
|
+
|
|
3
|
+
import java.nio.ByteBuffer;
|
|
4
|
+
|
|
5
|
+
public class JPushResponse {
|
|
6
|
+
public int cmd;
|
|
7
|
+
public long rid;
|
|
8
|
+
public long rquestId;
|
|
9
|
+
public ByteBuffer body;
|
|
10
|
+
public long uid;
|
|
11
|
+
|
|
12
|
+
public JPushResponse(int cmd, long rid, long rquestId, ByteBuffer body) {
|
|
13
|
+
this.cmd = cmd;
|
|
14
|
+
this.rid = rid;
|
|
15
|
+
this.rquestId = rquestId;
|
|
16
|
+
this.body = body;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public JPushResponse(int cmd, long rid, long rquestId, long uid, ByteBuffer body) {
|
|
20
|
+
this.cmd = cmd;
|
|
21
|
+
this.rid = rid;
|
|
22
|
+
this.rquestId = rquestId;
|
|
23
|
+
this.uid = uid;
|
|
24
|
+
this.body = body;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
package cn.jpush.android.local;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.content.Intent;
|
|
5
|
+
import android.content.res.Configuration;
|
|
6
|
+
import android.os.Bundle;
|
|
7
|
+
import android.view.KeyEvent;
|
|
8
|
+
import android.view.Menu;
|
|
9
|
+
|
|
10
|
+
public abstract class ProxyActivityAction {
|
|
11
|
+
public abstract void onCreate(Activity activity, Bundle savedInstanceState);
|
|
12
|
+
|
|
13
|
+
public abstract void onResume(Activity activity);
|
|
14
|
+
|
|
15
|
+
public abstract void onPause(Activity activity);
|
|
16
|
+
|
|
17
|
+
public abstract void onRestart(Activity activity);
|
|
18
|
+
|
|
19
|
+
public abstract void onStop(Activity activity);
|
|
20
|
+
|
|
21
|
+
public abstract void onDestroy(Activity activity);
|
|
22
|
+
|
|
23
|
+
public abstract void onNewIntent(Activity activity, Intent intent);
|
|
24
|
+
|
|
25
|
+
public abstract void onConfigurationChanged(Activity activity, Configuration newConfig);
|
|
26
|
+
|
|
27
|
+
public abstract boolean onKeyDown(Activity activity, int keyCode, KeyEvent event);
|
|
28
|
+
|
|
29
|
+
public abstract boolean onCreateOptionsMenu(Activity activity, Menu menu);
|
|
30
|
+
|
|
31
|
+
public abstract void onBackPressed(Activity activity);
|
|
32
|
+
|
|
33
|
+
public abstract void onEvent(Activity activity, String action, Bundle bundle);
|
|
34
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
package cn.jpush.android.service;
|
|
2
|
+
|
|
3
|
+
import android.content.BroadcastReceiver;
|
|
4
|
+
import android.content.Context;
|
|
5
|
+
import android.content.Intent;
|
|
6
|
+
import cn.jiguang.internal.JConstants;
|
|
7
|
+
|
|
8
|
+
public class AlarmReceiver extends BroadcastReceiver {
|
|
9
|
+
@Override
|
|
10
|
+
public void onReceive(Context context, Intent intent) {
|
|
11
|
+
if (context != null) {
|
|
12
|
+
JConstants.getAppContext(context.getApplicationContext());
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package cn.jpush.android.service;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.content.Intent;
|
|
5
|
+
import android.os.Bundle;
|
|
6
|
+
|
|
7
|
+
public class BActivity extends Activity {
|
|
8
|
+
@Override
|
|
9
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
10
|
+
super.onCreate(savedInstanceState);
|
|
11
|
+
finish();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@Override
|
|
15
|
+
protected void onNewIntent(Intent intent) {
|
|
16
|
+
super.onNewIntent(intent);
|
|
17
|
+
finish();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
package cn.jpush.android.service;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.content.Intent;
|
|
5
|
+
import android.os.Bundle;
|
|
6
|
+
|
|
7
|
+
public class DActivity extends Activity {
|
|
8
|
+
@Override
|
|
9
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
10
|
+
super.onCreate(savedInstanceState);
|
|
11
|
+
finish();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@Override
|
|
15
|
+
protected void onNewIntent(Intent intent) {
|
|
16
|
+
super.onNewIntent(intent);
|
|
17
|
+
finish();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
package cn.jpush.android.service;
|
|
2
|
+
|
|
3
|
+
import android.app.Service;
|
|
4
|
+
import android.content.Intent;
|
|
5
|
+
import android.os.IBinder;
|
|
6
|
+
|
|
7
|
+
public class DaemonService extends Service {
|
|
8
|
+
@Override
|
|
9
|
+
public IBinder onBind(Intent intent) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@Override
|
|
14
|
+
public int onStartCommand(Intent intent, int flags, int startId) {
|
|
15
|
+
return Service.START_NOT_STICKY;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
package cn.jpush.android.service;
|
|
2
|
+
|
|
3
|
+
import android.content.ContentProvider;
|
|
4
|
+
import android.content.ContentValues;
|
|
5
|
+
import android.database.Cursor;
|
|
6
|
+
import android.database.MatrixCursor;
|
|
7
|
+
import android.net.Uri;
|
|
8
|
+
import android.os.Bundle;
|
|
9
|
+
import cn.jiguang.core.JCoreStorage;
|
|
10
|
+
import cn.jiguang.internal.JCoreInternalHelper;
|
|
11
|
+
import java.util.Set;
|
|
12
|
+
|
|
13
|
+
public class DataProvider extends ContentProvider {
|
|
14
|
+
@Override
|
|
15
|
+
public boolean onCreate() {
|
|
16
|
+
JCoreStorage.setAppContext(getContext());
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Override
|
|
21
|
+
public Cursor query(
|
|
22
|
+
Uri uri,
|
|
23
|
+
String[] projection,
|
|
24
|
+
String selection,
|
|
25
|
+
String[] selectionArgs,
|
|
26
|
+
String sortOrder
|
|
27
|
+
) {
|
|
28
|
+
DataShare.enforceSameAppCaller();
|
|
29
|
+
String key = selection;
|
|
30
|
+
String defaultVal = "";
|
|
31
|
+
if ((key == null || key.isEmpty()) && uri != null) {
|
|
32
|
+
try {
|
|
33
|
+
key = uri.getQueryParameter("key");
|
|
34
|
+
String defParam = uri.getQueryParameter("default");
|
|
35
|
+
if (defParam != null) {
|
|
36
|
+
defaultVal = defParam;
|
|
37
|
+
}
|
|
38
|
+
} catch (Throwable ignored) {
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (selectionArgs != null && selectionArgs.length > 0 && selectionArgs[0] != null) {
|
|
42
|
+
if (key == null || key.isEmpty()) {
|
|
43
|
+
key = selectionArgs[0];
|
|
44
|
+
} else {
|
|
45
|
+
defaultVal = selectionArgs[0];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (key == null || key.isEmpty()) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
String value = JCoreStorage.getSpValue(getContext(), key, defaultVal);
|
|
52
|
+
MatrixCursor cursor = new MatrixCursor(new String[] { "key", "value" }, 1);
|
|
53
|
+
cursor.addRow(new Object[] { key, value });
|
|
54
|
+
return cursor;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@Override
|
|
58
|
+
public String getType(Uri uri) {
|
|
59
|
+
DataShare.enforceSameAppCaller();
|
|
60
|
+
if (uri != null) {
|
|
61
|
+
try {
|
|
62
|
+
String key = uri.getQueryParameter("key");
|
|
63
|
+
if (key != null && !key.isEmpty()) {
|
|
64
|
+
return JCoreStorage.getSpValue(getContext(), key, "");
|
|
65
|
+
}
|
|
66
|
+
} catch (Throwable ignored) {
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return "vnd.android.cursor.item/jpush_data";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@Override
|
|
73
|
+
public Uri insert(Uri uri, ContentValues values) {
|
|
74
|
+
DataShare.enforceSameAppCaller();
|
|
75
|
+
if (values != null) {
|
|
76
|
+
try {
|
|
77
|
+
if (values.containsKey("key") && values.containsKey("value")) {
|
|
78
|
+
JCoreStorage.putSpValue(
|
|
79
|
+
getContext(),
|
|
80
|
+
values.getAsString("key"),
|
|
81
|
+
values.getAsString("value")
|
|
82
|
+
);
|
|
83
|
+
} else {
|
|
84
|
+
Set<String> keys = values.keySet();
|
|
85
|
+
if (keys != null) {
|
|
86
|
+
for (String k : keys) {
|
|
87
|
+
Object v = values.get(k);
|
|
88
|
+
JCoreStorage.putSpValue(getContext(), k, v != null ? String.valueOf(v) : "");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
} catch (Throwable ignored) {
|
|
93
|
+
}
|
|
94
|
+
} else if (uri != null) {
|
|
95
|
+
try {
|
|
96
|
+
String k = uri.getQueryParameter("key");
|
|
97
|
+
String v = uri.getQueryParameter("value");
|
|
98
|
+
if (k != null && !k.isEmpty()) {
|
|
99
|
+
JCoreStorage.putSpValue(getContext(), k, v != null ? v : "");
|
|
100
|
+
}
|
|
101
|
+
} catch (Throwable ignored) {
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return uri;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@Override
|
|
108
|
+
public int delete(Uri uri, String selection, String[] selectionArgs) {
|
|
109
|
+
DataShare.enforceSameAppCaller();
|
|
110
|
+
String key = selection;
|
|
111
|
+
if ((key == null || key.isEmpty()) && uri != null) {
|
|
112
|
+
try {
|
|
113
|
+
key = uri.getQueryParameter("key");
|
|
114
|
+
} catch (Throwable ignored) {
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (key != null && !key.isEmpty()) {
|
|
118
|
+
JCoreStorage.putSpValue(getContext(), key, "");
|
|
119
|
+
return 1;
|
|
120
|
+
}
|
|
121
|
+
return 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@Override
|
|
125
|
+
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
|
|
126
|
+
DataShare.enforceSameAppCaller();
|
|
127
|
+
insert(uri, values);
|
|
128
|
+
return 1;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@Override
|
|
132
|
+
public Bundle call(String method, String arg, Bundle extras) {
|
|
133
|
+
DataShare.enforceSameAppCaller();
|
|
134
|
+
return JCoreInternalHelper.getInstance().directHandle(getContext(), method, arg, extras);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
package cn.jpush.android.service;
|
|
2
|
+
|
|
3
|
+
import android.os.Binder;
|
|
4
|
+
import android.os.Bundle;
|
|
5
|
+
import android.os.IBinder;
|
|
6
|
+
import android.os.Parcel;
|
|
7
|
+
import android.os.Process;
|
|
8
|
+
import android.os.RemoteException;
|
|
9
|
+
import cn.jiguang.android.IDataShare;
|
|
10
|
+
import cn.jiguang.core.JCoreStorage;
|
|
11
|
+
import cn.jiguang.internal.JCoreInternalHelper;
|
|
12
|
+
import java.util.Map;
|
|
13
|
+
import java.util.concurrent.ConcurrentHashMap;
|
|
14
|
+
|
|
15
|
+
public class DataShare extends IDataShare.Stub {
|
|
16
|
+
private static final Map<String, IDataShare> aidlMap = new ConcurrentHashMap<String, IDataShare>();
|
|
17
|
+
private static volatile IDataShare instance;
|
|
18
|
+
private static volatile boolean binding;
|
|
19
|
+
private static volatile int sTestCallingUid = -1;
|
|
20
|
+
private static volatile int sTestMyUid = -1;
|
|
21
|
+
|
|
22
|
+
public static void setTestCallerUids(int callingUid, int myUid) {
|
|
23
|
+
sTestCallingUid = callingUid;
|
|
24
|
+
sTestMyUid = myUid;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public static void enforceSameAppCaller() {
|
|
28
|
+
if (sTestCallingUid >= 0 && sTestMyUid >= 0) {
|
|
29
|
+
if (sTestCallingUid != sTestMyUid) {
|
|
30
|
+
throw new SecurityException("Unauthorized Binder caller UID: " + sTestCallingUid);
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
int callingUid;
|
|
35
|
+
int myUid;
|
|
36
|
+
try {
|
|
37
|
+
callingUid = Binder.getCallingUid();
|
|
38
|
+
myUid = Process.myUid();
|
|
39
|
+
} catch (Throwable ignored) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (myUid > 0 && callingUid != myUid) {
|
|
43
|
+
throw new SecurityException("Unauthorized Binder caller UID: " + callingUid);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public static IDataShare getInstance(String processName) {
|
|
48
|
+
if (processName != null && !processName.isEmpty()) {
|
|
49
|
+
IDataShare bound = aidlMap.get(processName);
|
|
50
|
+
if (bound != null) {
|
|
51
|
+
return bound;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (instance == null) {
|
|
55
|
+
synchronized (DataShare.class) {
|
|
56
|
+
if (instance == null) {
|
|
57
|
+
instance = new DataShare();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return instance;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public static void init(IDataShare aidl, String processName) {
|
|
65
|
+
if (aidl != null) {
|
|
66
|
+
instance = aidl;
|
|
67
|
+
if (processName != null && !processName.isEmpty()) {
|
|
68
|
+
aidlMap.put(processName, aidl);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
binding = false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
public static boolean isBinding() {
|
|
75
|
+
return binding;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public static void setBinding() {
|
|
79
|
+
binding = true;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@Override
|
|
83
|
+
public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException {
|
|
84
|
+
enforceSameAppCaller();
|
|
85
|
+
return super.onTransact(code, data, reply, flags);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@Override
|
|
89
|
+
public IBinder getBinderByType(String type, String action) throws RemoteException {
|
|
90
|
+
enforceSameAppCaller();
|
|
91
|
+
if (type != null && !type.isEmpty()) {
|
|
92
|
+
IDataShare bound = aidlMap.get(type);
|
|
93
|
+
if (bound != null) {
|
|
94
|
+
return bound.asBinder();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@Override
|
|
101
|
+
public void onAction(String type, String action, Bundle bundle) throws RemoteException {
|
|
102
|
+
enforceSameAppCaller();
|
|
103
|
+
JCoreInternalHelper.getInstance().directHandle(JCoreStorage.getAppContext(null), type, action, bundle);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@Override
|
|
107
|
+
public String bind(IDataShare aidl, String type) throws RemoteException {
|
|
108
|
+
enforceSameAppCaller();
|
|
109
|
+
String key = (type != null && !type.isEmpty()) ? type : "default";
|
|
110
|
+
if (aidl != null) {
|
|
111
|
+
aidlMap.put(key, aidl);
|
|
112
|
+
if (instance == null) {
|
|
113
|
+
instance = aidl;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return key;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@Override
|
|
120
|
+
public Bundle execute(String sdkType, String action, Bundle bundle) throws RemoteException {
|
|
121
|
+
enforceSameAppCaller();
|
|
122
|
+
return JCoreInternalHelper.getInstance().directHandle(
|
|
123
|
+
JCoreStorage.getAppContext(null),
|
|
124
|
+
sdkType,
|
|
125
|
+
action,
|
|
126
|
+
bundle
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
package cn.jpush.android.service;
|
|
2
|
+
|
|
3
|
+
import android.content.ContentProvider;
|
|
4
|
+
import android.content.ContentValues;
|
|
5
|
+
import android.database.Cursor;
|
|
6
|
+
import android.database.MatrixCursor;
|
|
7
|
+
import android.net.Uri;
|
|
8
|
+
import android.os.Bundle;
|
|
9
|
+
import cn.jiguang.core.JCoreStorage;
|
|
10
|
+
import cn.jiguang.internal.JCoreInternalHelper;
|
|
11
|
+
import java.util.Set;
|
|
12
|
+
|
|
13
|
+
public class DownloadProvider extends ContentProvider {
|
|
14
|
+
@Override
|
|
15
|
+
public boolean onCreate() {
|
|
16
|
+
JCoreStorage.setAppContext(getContext());
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@Override
|
|
21
|
+
public Cursor query(
|
|
22
|
+
Uri uri,
|
|
23
|
+
String[] projection,
|
|
24
|
+
String selection,
|
|
25
|
+
String[] selectionArgs,
|
|
26
|
+
String sortOrder
|
|
27
|
+
) {
|
|
28
|
+
DataShare.enforceSameAppCaller();
|
|
29
|
+
String key = null;
|
|
30
|
+
String defaultVal = "";
|
|
31
|
+
if (uri != null) {
|
|
32
|
+
try {
|
|
33
|
+
key = uri.getQueryParameter("key");
|
|
34
|
+
String defParam = uri.getQueryParameter("default");
|
|
35
|
+
if (defParam != null) {
|
|
36
|
+
defaultVal = defParam;
|
|
37
|
+
}
|
|
38
|
+
} catch (Throwable ignored) {
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if ((key == null || key.isEmpty()) && selection != null && !selection.isEmpty()) {
|
|
42
|
+
key = selection;
|
|
43
|
+
}
|
|
44
|
+
if (selectionArgs != null && selectionArgs.length > 0 && selectionArgs[0] != null) {
|
|
45
|
+
if (key == null || key.isEmpty()) {
|
|
46
|
+
key = selectionArgs[0];
|
|
47
|
+
} else {
|
|
48
|
+
defaultVal = selectionArgs[0];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (key == null || key.isEmpty()) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
String value = JCoreStorage.getSpValue(getContext(), key, defaultVal);
|
|
55
|
+
MatrixCursor cursor = new MatrixCursor(new String[] { "key", "value" }, 1);
|
|
56
|
+
cursor.addRow(new Object[] { key, value });
|
|
57
|
+
return cursor;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@Override
|
|
61
|
+
public String getType(Uri uri) {
|
|
62
|
+
DataShare.enforceSameAppCaller();
|
|
63
|
+
if (uri != null) {
|
|
64
|
+
try {
|
|
65
|
+
String key = uri.getQueryParameter("key");
|
|
66
|
+
if (key != null && !key.isEmpty()) {
|
|
67
|
+
return JCoreStorage.getSpValue(getContext(), key, "");
|
|
68
|
+
}
|
|
69
|
+
} catch (Throwable ignored) {
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return "vnd.android.cursor.item/jcore_sp";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@Override
|
|
76
|
+
public Uri insert(Uri uri, ContentValues values) {
|
|
77
|
+
DataShare.enforceSameAppCaller();
|
|
78
|
+
if (values != null) {
|
|
79
|
+
try {
|
|
80
|
+
if (values.containsKey("key") && values.containsKey("value")) {
|
|
81
|
+
JCoreStorage.putSpValue(
|
|
82
|
+
getContext(),
|
|
83
|
+
values.getAsString("key"),
|
|
84
|
+
values.getAsString("value")
|
|
85
|
+
);
|
|
86
|
+
} else {
|
|
87
|
+
Set<String> keys = values.keySet();
|
|
88
|
+
if (keys != null) {
|
|
89
|
+
for (String k : keys) {
|
|
90
|
+
Object v = values.get(k);
|
|
91
|
+
JCoreStorage.putSpValue(getContext(), k, v != null ? String.valueOf(v) : "");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
} catch (Throwable ignored) {
|
|
96
|
+
}
|
|
97
|
+
} else if (uri != null) {
|
|
98
|
+
try {
|
|
99
|
+
String k = uri.getQueryParameter("key");
|
|
100
|
+
String v = uri.getQueryParameter("value");
|
|
101
|
+
if (k != null && !k.isEmpty()) {
|
|
102
|
+
JCoreStorage.putSpValue(getContext(), k, v != null ? v : "");
|
|
103
|
+
}
|
|
104
|
+
} catch (Throwable ignored) {
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return uri;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@Override
|
|
111
|
+
public int delete(Uri uri, String selection, String[] selectionArgs) {
|
|
112
|
+
DataShare.enforceSameAppCaller();
|
|
113
|
+
String key = selection;
|
|
114
|
+
if ((key == null || key.isEmpty()) && uri != null) {
|
|
115
|
+
try {
|
|
116
|
+
key = uri.getQueryParameter("key");
|
|
117
|
+
} catch (Throwable ignored) {
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (key != null && !key.isEmpty()) {
|
|
121
|
+
JCoreStorage.putSpValue(getContext(), key, "");
|
|
122
|
+
return 1;
|
|
123
|
+
}
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@Override
|
|
128
|
+
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
|
|
129
|
+
DataShare.enforceSameAppCaller();
|
|
130
|
+
insert(uri, values);
|
|
131
|
+
return 1;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@Override
|
|
135
|
+
public Bundle call(String method, String arg, Bundle extras) {
|
|
136
|
+
DataShare.enforceSameAppCaller();
|
|
137
|
+
return JCoreInternalHelper.getInstance().directHandle(getContext(), method, arg, extras);
|
|
138
|
+
}
|
|
139
|
+
}
|