diff --git a/dsoftbus/depend/BUILD.gn b/dsoftbus/depend/BUILD.gn new file mode 100755 index 0000000000000000000000000000000000000000..1a190dc8f61380a5fedbad4f016268242f168bd0 --- /dev/null +++ b/dsoftbus/depend/BUILD.gn @@ -0,0 +1,41 @@ +import("//build/ohos.gni") + +config("lib_public_config") { + include_dirs = [ "include", "//utils/native/base/include" ] +} + +ohos_shared_library("libhilog") { + sources = [ "test.c" ] + public_configs = [ ":lib_public_config" ] +} + +ohos_shared_library("ipc_single") { + sources = [ "test.c" ] + public_configs = [ ":lib_public_config" ] +} + +ohos_shared_library("deviceauth_sdk") { + sources = [ "test.c" ] + public_configs = [ ":lib_public_config" ] +} + +group("libpermissionsdk_standard") { +} + +group("ipc_core") { +} + +group("system_ability_fwk") { +} + +group("samgr_proxy") { +} + +group("cesfwk_innerkits") { +} + +group("want") { +} + +group("appexecfwk_core") { +} diff --git a/dsoftbus/depend/include/ability_info.h b/dsoftbus/depend/include/ability_info.h new file mode 100755 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/dsoftbus/depend/include/bundle_mgr_interface.h b/dsoftbus/depend/include/bundle_mgr_interface.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/bundle_mgr_interface.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/common_event_data.h b/dsoftbus/depend/include/common_event_data.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/common_event_data.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/common_event_manager.h b/dsoftbus/depend/include/common_event_manager.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/common_event_manager.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/common_event_subscriber.h b/dsoftbus/depend/include/common_event_subscriber.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/common_event_subscriber.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/common_event_support.h b/dsoftbus/depend/include/common_event_support.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/common_event_support.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/depend.h b/dsoftbus/depend/include/depend.h new file mode 100755 index 0000000000000000000000000000000000000000..786d60ab1ca8ca8dc0ec13db5e01301e22bc462d --- /dev/null +++ b/dsoftbus/depend/include/depend.h @@ -0,0 +1,170 @@ +#ifndef _DEPEND_H +#define _DEPEND_H + +//parameter.h +const char* GetSerial(void); +int GetDevUdid(char *udid, int size); + +//hilog/log.h +#define HILOG_DEBUG(type, ...) +#define HILOG_INFO(type, ...) +#define HILOG_WARN(type, ...) +#define HILOG_ERROR(type, ...) + +#endif + +#ifndef _DEPEND_CPP_H +#define _DEPEND_CPP_H +//IRemoteBroker +#ifdef __cplusplus +#include +#include +#include +#include +#include "parcel.h" + +typedef enum TypePermissionState { + PERMISSION_NOT_GRANTED = -1, + PERMISSION_GRANTED = 0, +} PermissionState; + +#define DECLARE_SYSTEM_ABILITY(className) \ + public: \ + virtual std::string GetClassName() override { \ + return #className; \ + } + +#define DECLARE_BASE_SYSTEM_ABILITY(className) \ + public: \ + virtual std::string GetClassName() = 0; + +namespace OHOS { +namespace Security { +namespace Permission { +}; +}; + +#define REGISTER_SYSTEM_ABILITY_BY_ID(abilityClassName, systemAbilityId, runOnCreate) \ + const bool abilityClassName##_##RegisterResult = \ + SystemAbility::MakeAndRegisterAbility(new abilityClassName(systemAbilityId, runOnCreate)); + +enum { + SOFTBUS_SERVER_SA_ID = 4700, +}; + +template class BrokerDelegator { +}; + +class IRemoteObject; + +class MessageParcel : public Parcel { +public: + bool WriteFileDescriptor(int fd) {return true;} + bool WriteRawData(const void *data, size_t size) {return true;} + void *ReadRawData(size_t size) {return NULL;} + sptr ReadRemoteObject() {return NULL;} + int ReadFileDescriptor() {return 0;} +}; + +class MessageOption { +}; + +class IRemoteBroker { +#define DECLARE_INTERFACE_DESCRIPTOR(DESCRIPTOR) \ + static inline const std::u16string metaDescriptor_ = {DESCRIPTOR}; \ + static inline const std::u16string &GetDescriptor() \ + { \ + return metaDescriptor_; \ + } +}; + +class IRemoteObject : public virtual Parcelable { + public: + virtual int SendRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) {return 0;} + class DeathRecipient : public RefBase { + public: + virtual void OnRemoteDied(const wptr &object) {}; + }; + virtual bool RemoveDeathRecipient(const sptr &recipient) {return true;}; + virtual bool AddDeathRecipient(const sptr &recipient) {return true;}; + virtual bool Marshalling(Parcel &parcel) const override {return true;} +}; + +template class IRemoteProxy: public INTERFACE, public virtual RefBase { + public: + IRemoteProxy(const sptr &object) { + } + sptr Remote() {return NULL;} +}; + +class IPCObjectStub : public IRemoteObject { + public: + virtual int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) {return 0;} +}; + +template class IRemoteStub: public IPCObjectStub, public INTERFACE { + public: + virtual int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) {return 0;} +}; + +class IPCSkeleton { + public: + static sptr GetContextObject() {return NULL;} + static pid_t GetCallingPid() {return 0;} + static pid_t GetCallingUid() {return 0;} +}; + +class SystemAbility { + DECLARE_BASE_SYSTEM_ABILITY(SystemAbility); + public: + static bool MakeAndRegisterAbility(SystemAbility* systemAbility) {return true;} + bool Publish(sptr systemAbility) {return true;} + protected: + SystemAbility(bool runOnCreate = false) {} + SystemAbility(int32_t systemAbilityId, bool runOnCreate = false) {} + virtual void OnStart() = 0; + virtual void OnStop() = 0; +}; + +}; +#endif + +//device_auth.h +#include +#include + +#define FIELD_PEER_CONN_DEVICE_ID "peerConnDeviceId" +#define FIELD_SERVICE_PKG_NAME "servicePkgName" +#define FIELD_IS_CLIENT "isClient" +#define FIELD_KEY_LENGTH "keyLength" +#define FIELD_CONFIRMATION "confirmation" + +#define REQUEST_ACCEPTED 0x80000006 + +typedef struct { + bool (*onTransmit)(int64_t requestId, const uint8_t *data, uint32_t dataLen); + void (*onSessionKeyReturned)(int64_t requestId, const uint8_t *sessionKey, uint32_t sessionKeyLen); + void (*onFinish)(int64_t requestId, int operationCode, const char *returnData); + void (*onError)(int64_t requestId, int operationCode, int errorCode, const char *errorReturn); + char *(*onRequest)(int64_t requestId, int operationCode, const char *reqParams); +} DeviceAuthCallback; + +typedef struct { + int32_t (*processData)(int64_t authReqId, const uint8_t *data, uint32_t dataLen, const DeviceAuthCallback *gaCallback); + int32_t (*authDevice)(int64_t authReqId, const char *authParams, const DeviceAuthCallback *gaCallback); +} GroupAuthManager; + +typedef struct { + void (*onDeviceNotTrusted)(const char *peerUdid); +} DataChangeListener; + +typedef struct { + int32_t (*regDataChangeListener)(const char *appId, const DataChangeListener *listener); +} DeviceGroupManager; + +int InitDeviceAuthService(void); +void DestroyDeviceAuthService(void); +const GroupAuthManager *GetGaInstance(void); +const DeviceGroupManager *GetGmInstance(void); + +#endif diff --git a/dsoftbus/depend/include/device_auth.h b/dsoftbus/depend/include/device_auth.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/device_auth.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/hilog/log.h b/dsoftbus/depend/include/hilog/log.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/hilog/log.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/ipc_skeleton.h b/dsoftbus/depend/include/ipc_skeleton.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/ipc_skeleton.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/ipc_types.h b/dsoftbus/depend/include/ipc_types.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/ipc_types.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/iremote_broker.h b/dsoftbus/depend/include/iremote_broker.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/iremote_broker.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/iremote_object.h b/dsoftbus/depend/include/iremote_object.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/iremote_object.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/iremote_parcel.h b/dsoftbus/depend/include/iremote_parcel.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/iremote_parcel.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/iremote_proxy.h b/dsoftbus/depend/include/iremote_proxy.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/iremote_proxy.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/iremote_stub.h b/dsoftbus/depend/include/iremote_stub.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/iremote_stub.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/message_parcel.h b/dsoftbus/depend/include/message_parcel.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/message_parcel.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/ohos/aafwk/content/want.h b/dsoftbus/depend/include/ohos/aafwk/content/want.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/ohos/aafwk/content/want.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/parameter.h b/dsoftbus/depend/include/parameter.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/parameter.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/permission/permission.h b/dsoftbus/depend/include/permission/permission.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/permission/permission.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/permission/permission_kit.h b/dsoftbus/depend/include/permission/permission_kit.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/permission/permission_kit.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/sys_mgr_client.h b/dsoftbus/depend/include/sys_mgr_client.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/sys_mgr_client.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/system_ability.h b/dsoftbus/depend/include/system_ability.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/system_ability.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/system_ability_definition.h b/dsoftbus/depend/include/system_ability_definition.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/system_ability_definition.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/include/wifi_msg.h b/dsoftbus/depend/include/wifi_msg.h new file mode 100755 index 0000000000000000000000000000000000000000..f2e4d5342eb41f3f2c53911f0de9a2764d721479 --- /dev/null +++ b/dsoftbus/depend/include/wifi_msg.h @@ -0,0 +1 @@ +#include "depend.h" diff --git a/dsoftbus/depend/ohos.build b/dsoftbus/depend/ohos.build new file mode 100755 index 0000000000000000000000000000000000000000..33673a313e5ada20432572a0835d7fbfa5b63953 --- /dev/null +++ b/dsoftbus/depend/ohos.build @@ -0,0 +1,121 @@ +{ + "subsystem": "depend", + "parts": { + "hiviewdfx_hilog_native": { + "module_list": [ ], + "inner_kits": [ + { + "name": "//depend:libhilog", + "header": { + "header_files": [ ], + "header_base": "//depend" + } + } + ] + }, + "ipc": { + "module_list": [ ], + "inner_kits": [ + { + "name": "//depend:ipc_single", + "header": { + "header_files": [ ], + "header_base": "//depend" + } + }, + { + "name":"//depend:ipc_core", + "header": { + "header_files": [ ], + "header_base": "//depend" + } + } + ] + }, + "ces_standard": { + "module_list": [ ], + "inner_kits": [ + { + "name": "//depend:cesfwk_innerkits", + "header": { + "header_files": [ ], + "header_base": "//depend" + } + } + ] + }, + "aafwk_standard": { + "module_list": [ ], + "inner_kits": [ + { + "name": "//depend:want", + "header": { + "header_files": [ ], + "header_base": "//depend" + } + } + ] + }, + "appexecfwk_standard": { + "module_list": [ ], + "inner_kits": [ + { + "name": "//depend:appexecfwk_core", + "header": { + "header_files": [ ], + "header_base": "//depend" + } + } + ] + }, + "deviceauth_standard": { + "module_list": [ ], + "inner_kits": [ + { + "name": "//depend:deviceauth_sdk", + "header": { + "header_files": [ ], + "header_base": "//depend" + } + } + ] + }, + "permission_standard": { + "module_list": [ ], + "inner_kits": [ + { + "name": "//depend:libpermissionsdk_standard", + "header": { + "header_files": [ ], + "header_base":"//depend" + } + } + ] + }, + "safwk": { + "module_list": [ ], + "inner_kits": [ + { + "name": "//depend:system_ability_fwk", + "header": { + "header_files": [ ], + "header_base": "//depend" + } + } + ] + }, + "samgr_L2": { + "module_list": [ ], + "inner_kits": [ + { + "name": "//depend:samgr_proxy", + "header": { + "header_files": [ ], + "header_base": "//depend" + } + } + ] + } + } +} + diff --git a/dsoftbus/depend/test.c b/dsoftbus/depend/test.c new file mode 100755 index 0000000000000000000000000000000000000000..943f60d2d8a96bb8c4efbbc44acd7736fa3538c5 --- /dev/null +++ b/dsoftbus/depend/test.c @@ -0,0 +1,37 @@ +#include +#include "depend.h" + +void test() +{ + printf("test"); +} + +int GetDevUdid(char *udid, int size) +{ + return 0; +} + +const char* GetSerial(void) +{ + return NULL; +} + +int InitDeviceAuthService(void) +{ + return 0; +} + +void DestroyDeviceAuthService(void) +{ + return; +} + +const GroupAuthManager *GetGaInstance(void) +{ + return NULL; +} + +const DeviceGroupManager *GetGmInstance(void) +{ + return NULL; +}