├── app-catalog ├── app │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── drawable-hdpi │ │ │ │ │ ├── ic_logo.png │ │ │ │ │ ├── repeat_bg.png │ │ │ │ │ └── ic_bookmark.png │ │ │ │ ├── drawable-mdpi │ │ │ │ │ ├── back_icon.png │ │ │ │ │ ├── ic_logo.png │ │ │ │ │ └── ic_bookmark.png │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ ├── ic_logo.png │ │ │ │ │ ├── back_icon.png │ │ │ │ │ ├── repeat_bg.png │ │ │ │ │ └── ic_bookmark.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ ├── ic_logo.png │ │ │ │ │ ├── app_icon.png │ │ │ │ │ ├── back_icon.png │ │ │ │ │ ├── repeat_bg.png │ │ │ │ │ └── ic_bookmark.png │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values │ │ │ │ │ ├── dimens.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── menu │ │ │ │ │ ├── menu_login.xml │ │ │ │ │ ├── menu_app_list.xml │ │ │ │ │ ├── menu_app_details.xml │ │ │ │ │ └── menu_read_more_info.xml │ │ │ │ └── values-w820dp │ │ │ │ │ └── dimens.xml │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── wso2 │ │ │ │ └── app │ │ │ │ └── catalog │ │ │ │ ├── AppCatalogException.java │ │ │ │ ├── utils │ │ │ │ └── StreamHandler.java │ │ │ │ └── beans │ │ │ │ └── UnregisterProfile.java │ │ └── androidTest │ │ │ └── java │ │ │ └── org │ │ │ └── wso2 │ │ │ └── app │ │ │ └── catalog │ │ │ └── ApplicationTest.java │ ├── proguard-rules.pro │ └── build.gradle ├── settings.gradle ├── volley │ ├── src │ │ ├── test │ │ │ ├── resources │ │ │ │ └── org.robolectric.Config.properties │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── android │ │ │ │ └── volley │ │ │ │ ├── mock │ │ │ │ ├── ShadowSystemClock.java │ │ │ │ ├── MockCache.java │ │ │ │ └── MockResponseDelivery.java │ │ │ │ ├── utils │ │ │ │ ├── ImmediateResponseDelivery.java │ │ │ │ └── CacheTestUtils.java │ │ │ │ └── toolbox │ │ │ │ ├── RequestFutureTest.java │ │ │ │ ├── StringRequestTest.java │ │ │ │ └── CacheTest.java │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ └── com │ │ │ └── android │ │ │ └── volley │ │ │ ├── TimeoutError.java │ │ │ ├── ServerError.java │ │ │ ├── NoConnectionError.java │ │ │ ├── ParseError.java │ │ │ ├── Network.java │ │ │ ├── NetworkError.java │ │ │ ├── toolbox │ │ │ ├── Authenticator.java │ │ │ ├── NoCache.java │ │ │ └── HttpStack.java │ │ │ ├── ClientError.java │ │ │ ├── ResponseDelivery.java │ │ │ ├── RetryPolicy.java │ │ │ └── VolleyError.java │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── custom_rules.xml │ ├── rules.gradle │ ├── proguard-project.txt │ ├── build.gradle │ ├── Android.mk │ └── proguard.cfg ├── .gitignore ├── iDPProxy │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── raw │ │ │ │ ├── keystore │ │ │ │ └── truststore │ │ │ ├── values-v11 │ │ │ │ └── styles.xml │ │ │ ├── values-v14 │ │ │ │ └── styles.xml │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ ├── java │ │ │ └── org │ │ │ │ └── wso2 │ │ │ │ └── emm │ │ │ │ └── agent │ │ │ │ └── proxy │ │ │ │ ├── interfaces │ │ │ │ ├── APIAccessCallBack.java │ │ │ │ ├── TokenCallBack.java │ │ │ │ ├── APIResultCallBack.java │ │ │ │ ├── AuthenticationCallback.java │ │ │ │ └── CallBack.java │ │ │ │ ├── authenticators │ │ │ │ ├── OAuthAuthenticator.java │ │ │ │ ├── ClientAuthenticator.java │ │ │ │ └── AuthenticatorFactory.java │ │ │ │ ├── IDPTokenManagerException.java │ │ │ │ ├── clients │ │ │ │ ├── CommunicationClientFactory.java │ │ │ │ └── CommunicationClient.java │ │ │ │ └── utils │ │ │ │ └── StreamHandlerUtil.java │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── build.gradle └── gradle.properties ├── system-service ├── app │ ├── .gitignore │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable-hdpi │ │ │ │ │ ├── ic_logo_dark.png │ │ │ │ │ ├── notification.png │ │ │ │ │ ├── ic_done_black_24dp.png │ │ │ │ │ └── ic_block_black_24dp.png │ │ │ │ ├── drawable-mdpi │ │ │ │ │ ├── ic_done_black_24dp.png │ │ │ │ │ └── ic_block_black_24dp.png │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ ├── ic_block_black_24dp.png │ │ │ │ │ └── ic_done_black_24dp.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ ├── ic_block_black_24dp.png │ │ │ │ │ └── ic_done_black_24dp.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ │ ├── ic_done_black_24dp.png │ │ │ │ │ └── ic_block_black_24dp.png │ │ │ │ ├── values │ │ │ │ │ └── dimens.xml │ │ │ │ ├── values-w820dp │ │ │ │ │ └── dimens.xml │ │ │ │ ├── layout │ │ │ │ │ ├── activity_main.xml │ │ │ │ │ └── activity_lock.xml │ │ │ │ └── xml │ │ │ │ │ └── agent_device_admin.xml │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── wso2 │ │ │ │ └── iot │ │ │ │ └── system │ │ │ │ └── service │ │ │ │ └── services │ │ │ │ └── OTADownloadService.java │ │ └── androidTest │ │ │ └── java │ │ │ └── org │ │ │ └── wso2 │ │ │ └── iot │ │ │ └── system │ │ │ └── service │ │ │ └── ApplicationTest.java │ └── proguard-rules.pro ├── settings.gradle ├── .gitignore ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── gradle.properties └── build.gradle ├── client ├── iDPProxy │ └── src │ │ ├── main │ │ ├── res │ │ │ ├── raw │ │ │ │ ├── keystore.bks │ │ │ │ └── truststore.bks │ │ │ └── drawable-mdpi │ │ │ │ └── ic_launcher.png │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── org │ │ │ └── wso2 │ │ │ └── iot │ │ │ └── agent │ │ │ └── proxy │ │ │ ├── interfaces │ │ │ ├── APIAccessCallBack.java │ │ │ ├── TokenCallBack.java │ │ │ ├── APIResultCallBack.java │ │ │ ├── AuthenticationCallback.java │ │ │ └── CallBack.java │ │ │ ├── authenticators │ │ │ ├── OAuthAuthenticator.java │ │ │ ├── ClientAuthenticator.java │ │ │ └── AuthenticatorFactory.java │ │ │ ├── IDPTokenManagerException.java │ │ │ ├── clients │ │ │ ├── CommunicationClientFactory.java │ │ │ └── CommunicationClient.java │ │ │ └── utils │ │ │ └── StreamHandlerUtil.java │ │ └── staging │ │ └── res │ │ └── raw │ │ ├── keystore.bks │ │ └── truststore.bks ├── client │ ├── src │ │ ├── main │ │ │ ├── ic_download-web.png │ │ │ ├── ic_launcher-web.png │ │ │ ├── ic_downloading-web.png │ │ │ ├── res │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ ├── wso2.png │ │ │ │ │ ├── banner.png │ │ │ │ │ ├── ic_logo.png │ │ │ │ │ ├── ic_power.png │ │ │ │ │ ├── repeat_bg.png │ │ │ │ │ ├── splash_bg.png │ │ │ │ │ ├── ic_bookmark.png │ │ │ │ │ ├── ic_download.png │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_logo_dark.png │ │ │ │ │ ├── ic_phone_ring.png │ │ │ │ │ ├── ic_lock_white_24dp.png │ │ │ │ │ ├── ic_warning_white_24dp.png │ │ │ │ │ ├── ic_error_outline_white_24dp.png │ │ │ │ │ └── ic_notifications_white_24dp.png │ │ │ │ ├── drawable-hdpi │ │ │ │ │ ├── ic_logo.png │ │ │ │ │ ├── ic_power.png │ │ │ │ │ ├── ic_bookmark.png │ │ │ │ │ ├── ic_download.png │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── option_icon.png │ │ │ │ │ ├── repeat_bg.png │ │ │ │ │ ├── ic_logo_dark.png │ │ │ │ │ ├── ic_phone_ring.png │ │ │ │ │ ├── ic_lock_white_24dp.png │ │ │ │ │ ├── ic_warning_white_24dp.png │ │ │ │ │ ├── ic_error_outline_white_24dp.png │ │ │ │ │ └── ic_notifications_white_24dp.png │ │ │ │ ├── drawable-mdpi │ │ │ │ │ ├── ic_logo.png │ │ │ │ │ ├── ic_power.png │ │ │ │ │ ├── ic_bookmark.png │ │ │ │ │ ├── ic_download.png │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── option_icon.png │ │ │ │ │ ├── ic_logo_dark.png │ │ │ │ │ ├── ic_phone_ring.png │ │ │ │ │ ├── ic_lock_white_24dp.png │ │ │ │ │ ├── ic_warning_white_24dp.png │ │ │ │ │ ├── ic_error_outline_white_24dp.png │ │ │ │ │ └── ic_notifications_white_24dp.png │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ ├── dismiss.png │ │ │ │ │ ├── ic_logo.png │ │ │ │ │ ├── ic_power.png │ │ │ │ │ ├── repeat_bg.png │ │ │ │ │ ├── ic_bookmark.png │ │ │ │ │ ├── ic_download.png │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ ├── ic_logo_dark.png │ │ │ │ │ ├── ic_phone_ring.png │ │ │ │ │ ├── ic_lock_white_24dp.png │ │ │ │ │ ├── ic_warning_white_24dp.png │ │ │ │ │ ├── ic_error_outline_white_24dp.png │ │ │ │ │ └── ic_notifications_white_24dp.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ │ ├── ic_power.png │ │ │ │ │ ├── ic_download.png │ │ │ │ │ ├── ic_lock_white_24dp.png │ │ │ │ │ ├── ic_warning_white_24dp.png │ │ │ │ │ ├── ic_error_outline_white_24dp.png │ │ │ │ │ └── ic_notifications_white_24dp.png │ │ │ │ ├── drawable-land-xxhdpi │ │ │ │ │ ├── banner.png │ │ │ │ │ ├── ic_power.png │ │ │ │ │ └── splash_bg.png │ │ │ │ ├── xml │ │ │ │ │ ├── provider_paths.xml │ │ │ │ │ ├── share_paths.xml │ │ │ │ │ └── agent_device_admin.xml │ │ │ │ ├── anim │ │ │ │ │ └── clockwise_refresh.xml │ │ │ │ ├── values-w820dp │ │ │ │ │ └── dimens.xml │ │ │ │ ├── values │ │ │ │ │ ├── attrs.xml │ │ │ │ │ ├── dimens.xml │ │ │ │ │ ├── colors.xml │ │ │ │ │ └── runtimePermissions.xml │ │ │ │ ├── color │ │ │ │ │ └── non_prominent_button_text.xml │ │ │ │ ├── values-sw600dp │ │ │ │ │ └── dimens.xml │ │ │ │ ├── menu │ │ │ │ │ └── authentication_error.xml │ │ │ │ ├── values-sw720dp-land │ │ │ │ │ └── dimens.xml │ │ │ │ ├── drawable │ │ │ │ │ ├── mdm_logo.xml │ │ │ │ │ ├── btn_grey.xml │ │ │ │ │ ├── btn_orange.xml │ │ │ │ │ └── btn_orange_non_prominent.xml │ │ │ │ └── layout │ │ │ │ │ ├── activity_lock.xml │ │ │ │ │ ├── top_banner.xml │ │ │ │ │ ├── activity_registration.xml │ │ │ │ │ └── kiosk_app_drawer.xml │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── wso2 │ │ │ │ └── iot │ │ │ │ └── agent │ │ │ │ ├── events │ │ │ │ ├── listeners │ │ │ │ │ ├── DeviceCertCreationListener.java │ │ │ │ │ └── WifiConfigCreationListener.java │ │ │ │ ├── publisher │ │ │ │ │ ├── DataPublisher.java │ │ │ │ │ └── SplunkLogPublisher.java │ │ │ │ └── beans │ │ │ │ │ ├── ApplicationStatus.java │ │ │ │ │ └── EventPayload.java │ │ │ │ ├── AgentFileProvider.java │ │ │ │ ├── services │ │ │ │ ├── LogPublisherFactory.java │ │ │ │ ├── kiosk │ │ │ │ │ ├── KioskMsgAlarmService.java │ │ │ │ │ ├── KioskLockDownService.java │ │ │ │ │ └── KioskUnlockService.java │ │ │ │ ├── location │ │ │ │ │ └── ReverseGeoCodingService.java │ │ │ │ ├── LocationUpdateReceiver.java │ │ │ │ └── FCMInstanceIdService.java │ │ │ │ ├── beans │ │ │ │ ├── AppRestriction.java │ │ │ │ ├── Tenant.java │ │ │ │ ├── ComplianceFeature.java │ │ │ │ ├── UnregisterProfile.java │ │ │ │ ├── AppInstallRequest.java │ │ │ │ └── AppUninstallRequest.java │ │ │ │ ├── AndroidAgentException.java │ │ │ │ ├── utils │ │ │ │ ├── HTTPAuthenticator.java │ │ │ │ ├── StreamHandler.java │ │ │ │ └── Response.java │ │ │ │ ├── api │ │ │ │ └── TenantResolverCallback.java │ │ │ │ └── transport │ │ │ │ └── exception │ │ │ │ └── TransportHandlerException.java │ │ └── androidTest │ │ │ └── java │ │ │ └── org │ │ │ └── wso2 │ │ │ └── iot │ │ │ └── agent │ │ │ └── services │ │ │ └── operation │ │ │ ├── UnitTestSuite.java │ │ │ └── Constants.java │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── google-services.json ├── .gitignore ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle ├── README.md ├── gradle.properties └── build.gradle ├── .gitignore ├── issue_template.md └── README.md /app-catalog/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /system-service/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/res/raw/keystore.bks: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /client/iDPProxy/src/staging/res/raw/keystore.bks: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /system-service/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app-catalog/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':iDPProxy', ':volley' 2 | -------------------------------------------------------------------------------- /app-catalog/volley/src/test/resources/org.robolectric.Config.properties: -------------------------------------------------------------------------------- 1 | manifest=src/main/AndroidManifest.xml 2 | -------------------------------------------------------------------------------- /client/client/src/main/ic_download-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/ic_download-web.png -------------------------------------------------------------------------------- /client/client/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app-catalog/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/res/raw/keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/iDPProxy/src/main/res/raw/keystore -------------------------------------------------------------------------------- /client/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | *.apk -------------------------------------------------------------------------------- /client/client/src/main/ic_downloading-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/ic_downloading-web.png -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/res/raw/truststore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/iDPProxy/src/main/res/raw/truststore -------------------------------------------------------------------------------- /client/iDPProxy/src/main/res/raw/truststore.bks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/iDPProxy/src/main/res/raw/truststore.bks -------------------------------------------------------------------------------- /system-service/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/wso2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/wso2.png -------------------------------------------------------------------------------- /client/iDPProxy/src/staging/res/raw/truststore.bks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/iDPProxy/src/staging/res/raw/truststore.bks -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-hdpi/ic_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-hdpi/ic_logo.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-hdpi/ic_power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-hdpi/ic_power.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-mdpi/ic_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-mdpi/ic_logo.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-mdpi/ic_power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-mdpi/ic_power.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xhdpi/dismiss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xhdpi/dismiss.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xhdpi/ic_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xhdpi/ic_logo.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/banner.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-hdpi/ic_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-hdpi/ic_logo.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-hdpi/repeat_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-hdpi/repeat_bg.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-mdpi/back_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-mdpi/back_icon.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-mdpi/ic_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-mdpi/ic_logo.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-xhdpi/ic_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-xhdpi/ic_logo.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-xxhdpi/ic_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-xxhdpi/ic_logo.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-hdpi/ic_bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-hdpi/ic_bookmark.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-hdpi/ic_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-hdpi/ic_download.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-hdpi/option_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-hdpi/option_icon.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-hdpi/repeat_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-hdpi/repeat_bg.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-mdpi/ic_bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-mdpi/ic_bookmark.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-mdpi/ic_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-mdpi/ic_download.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-mdpi/option_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-mdpi/option_icon.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xhdpi/ic_power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xhdpi/ic_power.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xhdpi/repeat_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xhdpi/repeat_bg.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/ic_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/ic_logo.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/ic_power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/ic_power.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/repeat_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/repeat_bg.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/splash_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/splash_bg.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxxhdpi/ic_power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxxhdpi/ic_power.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-hdpi/ic_bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-hdpi/ic_bookmark.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-mdpi/ic_bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-mdpi/ic_bookmark.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-xhdpi/back_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-xhdpi/back_icon.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-xhdpi/repeat_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-xhdpi/repeat_bg.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-xxhdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-xxhdpi/app_icon.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-xxhdpi/back_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-xxhdpi/back_icon.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-xxhdpi/repeat_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-xxhdpi/repeat_bg.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-hdpi/ic_logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-hdpi/ic_logo_dark.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-hdpi/ic_phone_ring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-hdpi/ic_phone_ring.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-land-xxhdpi/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-land-xxhdpi/banner.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-mdpi/ic_logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-mdpi/ic_logo_dark.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-mdpi/ic_phone_ring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-mdpi/ic_phone_ring.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xhdpi/ic_bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xhdpi/ic_bookmark.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xhdpi/ic_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xhdpi/ic_download.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xhdpi/ic_logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xhdpi/ic_logo_dark.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/ic_bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/ic_bookmark.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/ic_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/ic_download.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/iDPProxy/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/iDPProxy/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-xhdpi/ic_bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-xhdpi/ic_bookmark.png -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/drawable-xxhdpi/ic_bookmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/app-catalog/app/src/main/res/drawable-xxhdpi/ic_bookmark.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-land-xxhdpi/ic_power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-land-xxhdpi/ic_power.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-land-xxhdpi/splash_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-land-xxhdpi/splash_bg.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xhdpi/ic_phone_ring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xhdpi/ic_phone_ring.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/ic_logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/ic_logo_dark.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/ic_phone_ring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/ic_phone_ring.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxxhdpi/ic_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxxhdpi/ic_download.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-hdpi/ic_lock_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-hdpi/ic_lock_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-mdpi/ic_lock_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-mdpi/ic_lock_white_24dp.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/drawable-hdpi/ic_logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/drawable-hdpi/ic_logo_dark.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/drawable-hdpi/notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/drawable-hdpi/notification.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-hdpi/ic_warning_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-hdpi/ic_warning_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-mdpi/ic_warning_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-mdpi/ic_warning_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xhdpi/ic_lock_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xhdpi/ic_lock_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/ic_lock_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/ic_lock_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxxhdpi/ic_lock_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxxhdpi/ic_lock_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xhdpi/ic_warning_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xhdpi/ic_warning_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/ic_warning_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/ic_warning_white_24dp.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/drawable-hdpi/ic_done_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/drawable-hdpi/ic_done_black_24dp.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/drawable-mdpi/ic_done_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/drawable-mdpi/ic_done_black_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxxhdpi/ic_warning_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxxhdpi/ic_warning_white_24dp.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/drawable-hdpi/ic_block_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/drawable-hdpi/ic_block_black_24dp.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/drawable-mdpi/ic_block_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/drawable-mdpi/ic_block_black_24dp.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/drawable-xhdpi/ic_block_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/drawable-xhdpi/ic_block_black_24dp.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/drawable-xhdpi/ic_done_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/drawable-xhdpi/ic_done_black_24dp.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/drawable-xxhdpi/ic_block_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/drawable-xxhdpi/ic_block_black_24dp.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/drawable-xxhdpi/ic_done_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/drawable-xxhdpi/ic_done_black_24dp.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/drawable-xxxhdpi/ic_done_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/drawable-xxxhdpi/ic_done_black_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-hdpi/ic_error_outline_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-hdpi/ic_error_outline_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-hdpi/ic_notifications_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-hdpi/ic_notifications_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-mdpi/ic_error_outline_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-mdpi/ic_error_outline_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-mdpi/ic_notifications_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-mdpi/ic_notifications_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xhdpi/ic_error_outline_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xhdpi/ic_error_outline_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xhdpi/ic_notifications_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xhdpi/ic_notifications_white_24dp.png -------------------------------------------------------------------------------- /system-service/app/src/main/res/drawable-xxxhdpi/ic_block_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/system-service/app/src/main/res/drawable-xxxhdpi/ic_block_black_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/ic_error_outline_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/ic_error_outline_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxhdpi/ic_notifications_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxhdpi/ic_notifications_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxxhdpi/ic_error_outline_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxxhdpi/ic_error_outline_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/drawable-xxxhdpi/ic_notifications_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wso2/cdmf-agent-android/master/client/client/src/main/res/drawable-xxxhdpi/ic_notifications_white_24dp.png -------------------------------------------------------------------------------- /client/client/src/main/res/xml/provider_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /system-service/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /client/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jun 21 11:05:48 IST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip 7 | -------------------------------------------------------------------------------- /client/client/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Oct 21 11:34:03 PDT 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip 7 | -------------------------------------------------------------------------------- /client/client/src/main/res/xml/share_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app-catalog/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Apr 20 15:32:37 IST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /app-catalog/volley/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat May 07 17:27:35 IST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 7 | -------------------------------------------------------------------------------- /system-service/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Aug 24 10:36:36 IST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /app-catalog/volley/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /client/client/src/main/res/anim/clockwise_refresh.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app-catalog/volley/src/test/java/com/android/volley/mock/ShadowSystemClock.java: -------------------------------------------------------------------------------- 1 | package com.android.volley.mock; 2 | 3 | import android.os.SystemClock; 4 | import org.robolectric.annotation.Implements; 5 | 6 | @Implements(value = SystemClock.class, callThroughByDefault = true) 7 | public class ShadowSystemClock { 8 | public static long elapsedRealtime() { 9 | return 0; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/menu/menu_login.xml: -------------------------------------------------------------------------------- 1 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /app-catalog/volley/custom_rules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /client/client/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /system-service/app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/menu/menu_app_list.xml: -------------------------------------------------------------------------------- 1 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/menu/menu_app_details.xml: -------------------------------------------------------------------------------- 1 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /app-catalog/volley/rules.gradle: -------------------------------------------------------------------------------- 1 | // See build.gradle for an explanation of what this file is. 2 | 3 | apply plugin: 'com.android.library' 4 | 5 | // Check if the android plugin version supports unit testing. 6 | if (configurations.findByName("testCompile")) { 7 | dependencies { 8 | testCompile "junit:junit:4.10" 9 | testCompile "org.mockito:mockito-core:1.9.5" 10 | testCompile "org.robolectric:robolectric:3.0" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/menu/menu_read_more_info.xml: -------------------------------------------------------------------------------- 1 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /app-catalog/app/src/androidTest/java/org/wso2/app/catalog/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package org.wso2.app.catalog; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app-catalog/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /system-service/app/src/androidTest/java/org/wso2/iot/system/service/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package org.wso2.iot.system.service; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app-catalog/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.2.2' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/events/listeners/DeviceCertCreationListener.java: -------------------------------------------------------------------------------- 1 | package org.wso2.iot.agent.events.listeners; 2 | 3 | import java.io.InputStream; 4 | 5 | /** 6 | * Created by dilan on 5/24/16. 7 | */ 8 | public interface DeviceCertCreationListener { 9 | 10 | /** 11 | * This method will be called after the device certificate is created 12 | * @param certificate - Returns the input stream of the certificate 13 | */ 14 | public void onDeviceCertCreated(InputStream certificate); 15 | } 16 | -------------------------------------------------------------------------------- /client/client/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | target 3 | .classpath 4 | .settings 5 | .project 6 | *.iml 7 | *.iws 8 | *.ipr 9 | .idea 10 | 11 | # Mobile Tools for Java (J2ME) 12 | .mtj.tmp/ 13 | 14 | # Package Files # 15 | *.jar 16 | *.war 17 | *.ear 18 | 19 | #built application files 20 | *.ap_ 21 | *.ipa 22 | 23 | # files for the dex VM 24 | *.dex 25 | 26 | # Java class files 27 | *.class 28 | 29 | # generated files 30 | bin/ 31 | gen/ 32 | 33 | # Local configuration file (sdk path, etc) 34 | local.properties 35 | 36 | # Windows thumbnail db 37 | Thumbs.db 38 | 39 | # OSX files 40 | .DS_Store 41 | 42 | # Android Studio 43 | .gradle 44 | build/ 45 | 46 | -------------------------------------------------------------------------------- /system-service/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app-catalog/volley/src/test/java/com/android/volley/utils/ImmediateResponseDelivery.java: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All rights reserved. 2 | 3 | package com.android.volley.utils; 4 | 5 | import com.android.volley.ExecutorDelivery; 6 | 7 | import java.util.concurrent.Executor; 8 | 9 | /** 10 | * A ResponseDelivery for testing that immediately delivers responses 11 | * instead of posting back to the main thread. 12 | */ 13 | public class ImmediateResponseDelivery extends ExecutorDelivery { 14 | 15 | public ImmediateResponseDelivery() { 16 | super(new Executor() { 17 | @Override 18 | public void execute(Runnable command) { 19 | command.run(); 20 | } 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app-catalog/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/kasund/Development/adt-bundle-linux-x86_64-20130219/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /system-service/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/kasund/Development/adt-bundle-linux-x86_64-20130219/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /client/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | include ':iDPProxy' 19 | include ':client' 20 | -------------------------------------------------------------------------------- /client/README.md: -------------------------------------------------------------------------------- 1 | WSO2 EMM Android Agent 2 | ====================== 3 | 4 | Configure and build the Android client application 5 | ---------------------- 6 | Follow the instructions below to configure and build the Android client application: 7 | 8 | 1. Get a Git clone of the project. 9 | 2. Download Android Studio bundle . 10 | 3. Update your Android SDK with the following, 11 | -SDK Versions - 22 and 16 12 | -Build Tools Version - 22.0.1 13 | -Install/Update Android Support Library and Google Play Services 14 | -If you are on Windows platform, Install Google USB Driver 15 | 4. Your Gradle version (Android Studio) should be 1.2.3 or above. 16 | 5. Open the project in your Android Studio. 17 | 6. Clean and build. 18 | 7. Run the project on a device. 19 | -------------------------------------------------------------------------------- /app-catalog/volley/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /issue_template.md: -------------------------------------------------------------------------------- 1 | **Description:** 2 | 3 | 4 | **Suggested Labels:** 5 | 6 | 7 | **Suggested Assignees:** 8 | 9 | 10 | **Affected Product Version:** 11 | 12 | **OS, DB, other environment details and versions:** 13 | 14 | **Steps to reproduce:** 15 | 16 | 17 | **Related Issues:** 18 | -------------------------------------------------------------------------------- /app-catalog/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /system-service/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /app-catalog/volley/src/main/java/com/android/volley/TimeoutError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley; 18 | 19 | /** 20 | * Indicates that the connection or the socket timed out. 21 | */ 22 | @SuppressWarnings("serial") 23 | public class TimeoutError extends VolleyError { } 24 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/AgentFileProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent; 20 | 21 | import android.support.v4.content.FileProvider; 22 | 23 | public class AgentFileProvider extends FileProvider { 24 | } 25 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /client/client/src/main/res/color/non_prominent_button_text.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /client/client/src/main/res/values-sw600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 25 | 26 | -------------------------------------------------------------------------------- /client/gradle.properties: -------------------------------------------------------------------------------- 1 | # The Gradle daemon aims to improve the startup and execution time of Gradle. 2 | # When set to true the Gradle daemon is to run the build. 3 | org.gradle.daemon=true 4 | 5 | # Specifies the JVM arguments used for the daemon process. 6 | # The setting is particularly useful for tweaking memory settings. 7 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 8 | org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 9 | 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | org.gradle.parallel=true 14 | 15 | # Enables new incubating mode that makes Gradle selective when configuring projects. 16 | # Only relevant projects are configured which results in faster builds for large multi-projects. 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:configuration_on_demand 18 | org.gradle.configureondemand=true -------------------------------------------------------------------------------- /client/client/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 16dp 22 | 16dp 23 | 44dp 24 | 25 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/events/listeners/WifiConfigCreationListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.wso2.iot.agent.events.listeners; 19 | 20 | public interface WifiConfigCreationListener { 21 | 22 | /** 23 | * Call when wifi config is saved. 24 | * @param isSavedWifi - Whether Wifi config is saved or not 25 | */ 26 | public void onCreateWifiConfig(boolean isSavedWifi); 27 | } 28 | -------------------------------------------------------------------------------- /client/client/src/main/res/menu/authentication_error.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 25 | 26 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/events/publisher/DataPublisher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.events.publisher; 20 | 21 | import org.wso2.iot.agent.events.beans.EventPayload; 22 | 23 | /** 24 | * When data needs to be published, it can be done by implementing this interface. 25 | */ 26 | public interface DataPublisher { 27 | void publish(EventPayload eventPayload); 28 | } 29 | -------------------------------------------------------------------------------- /client/client/src/main/res/values-sw720dp-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 25 | 128dp 26 | 27 | -------------------------------------------------------------------------------- /app-catalog/volley/src/main/java/com/android/volley/ServerError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley; 18 | 19 | /** 20 | * Indicates that the server responded with an error response. 21 | */ 22 | @SuppressWarnings("serial") 23 | public class ServerError extends VolleyError { 24 | public ServerError(NetworkResponse networkResponse) { 25 | super(networkResponse); 26 | } 27 | 28 | public ServerError() { 29 | super(); 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /client/client/src/androidTest/java/org/wso2/iot/agent/services/operation/UnitTestSuite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.iot.agent.services.operation; 19 | 20 | 21 | import org.junit.runner.RunWith; 22 | import org.junit.runners.Suite; 23 | 24 | /** 25 | * Test suite to run all test classes at once. 26 | */ 27 | @RunWith(Suite.class) 28 | @Suite.SuiteClasses({OperationManagerTest.class}) 29 | public class UnitTestSuite { 30 | } 31 | -------------------------------------------------------------------------------- /app-catalog/volley/src/main/java/com/android/volley/NoConnectionError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley; 18 | 19 | /** 20 | * Error indicating that no connection could be established when performing a Volley request. 21 | */ 22 | @SuppressWarnings("serial") 23 | public class NoConnectionError extends NetworkError { 24 | public NoConnectionError() { 25 | super(); 26 | } 27 | 28 | public NoConnectionError(Throwable reason) { 29 | super(reason); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /client/client/src/main/res/drawable/mdm_logo.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /system-service/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | buildscript { 20 | repositories { 21 | jcenter() 22 | } 23 | dependencies { 24 | classpath 'com.android.tools.build:gradle:2.2.3' 25 | 26 | // NOTE: Do not place your application dependencies here; they belong 27 | // in the individual module build.gradle files 28 | } 29 | } 30 | 31 | allprojects { 32 | repositories { 33 | jcenter() 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app-catalog/volley/src/main/java/com/android/volley/ParseError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley; 18 | 19 | /** 20 | * Indicates that the server's response could not be parsed. 21 | */ 22 | @SuppressWarnings("serial") 23 | public class ParseError extends VolleyError { 24 | public ParseError() { } 25 | 26 | public ParseError(NetworkResponse networkResponse) { 27 | super(networkResponse); 28 | } 29 | 30 | public ParseError(Throwable cause) { 31 | super(cause); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /client/client/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "919081834526", 4 | "firebase_url": "https://wewrweragent.firebaseio.com", 5 | "project_id": "wso2agent", 6 | "storage_bucket": "wso2agent.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:917891897426:android:cb1a80b8fbeae4c0", 12 | "android_client_info": { 13 | "package_name": "org.wso2.iot.agent" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "9234081897234-j4f7tdaj1c6rad7bmqac05k3f3du66m1.apps.googleusercontent.com", 19 | "client_type": 3 20 | } 21 | ], 22 | "api_key": [ 23 | { 24 | "current_key": "rerwerwwerwerwerwer" 25 | } 26 | ], 27 | "services": { 28 | "analytics_service": { 29 | "status": 1 30 | }, 31 | "appinvite_service": { 32 | "status": 1, 33 | "other_platform_oauth_client": [] 34 | }, 35 | "ads_service": { 36 | "status": 2 37 | } 38 | } 39 | } 40 | ], 41 | "configuration_version": "1" 42 | } -------------------------------------------------------------------------------- /app-catalog/volley/build.gradle: -------------------------------------------------------------------------------- 1 | // NOTE: The only changes that belong in this file are the definitions 2 | // of tool versions (gradle plugin, compile SDK, build tools), so that 3 | // Volley can be built via gradle as a standalone project. 4 | // 5 | // Any other changes to the build config belong in rules.gradle, which 6 | // is used by projects that depend on Volley but define their own 7 | // tools versions across all dependencies to ensure a consistent build. 8 | // 9 | // Most users should just add this line to settings.gradle: 10 | // include(":volley") 11 | // 12 | // If you have a more complicated Gradle setup you can choose to use 13 | // this instead: 14 | // include(":volley") 15 | // project(':volley').buildFileName = 'rules.gradle' 16 | 17 | buildscript { 18 | repositories { 19 | jcenter() 20 | } 21 | dependencies { 22 | classpath 'com.android.tools.build:gradle:2.2.2' 23 | } 24 | } 25 | 26 | apply plugin: 'com.android.library' 27 | 28 | repositories { 29 | jcenter() 30 | } 31 | 32 | android { 33 | compileSdkVersion 22 34 | buildToolsVersion = '23.0.3' 35 | } 36 | 37 | apply from: 'rules.gradle' 38 | apply from: 'bintray.gradle' 39 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 25 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app-catalog/volley/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2011 The Android Open Source Project 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | LOCAL_PATH := $(call my-dir) 18 | 19 | include $(CLEAR_VARS) 20 | 21 | LOCAL_MODULE := volley 22 | LOCAL_SDK_VERSION := 17 23 | LOCAL_SRC_FILES := $(call all-java-files-under, src/main/java) 24 | 25 | include $(BUILD_STATIC_JAVA_LIBRARY) 26 | 27 | # Include this library in the build server's output directory 28 | # TODO: Not yet. 29 | #$(call dist-for-goals, dist_files, $(LOCAL_BUILT_MODULE):volley.jar) 30 | 31 | # Include build files in subdirectories 32 | include $(call all-makefiles-under,$(LOCAL_PATH)) 33 | 34 | -------------------------------------------------------------------------------- /client/client/src/main/res/xml/agent_device_admin.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/java/org/wso2/iot/agent/proxy/interfaces/APIAccessCallBack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.iot.agent.proxy.interfaces; 19 | 20 | /** 21 | * This interface handles API access callback when the application 22 | * is able to receive the access token by passing necessary credentials. Applications 23 | * can implement this when retrieving tokens on authentication. 24 | */ 25 | public interface APIAccessCallBack { 26 | void onAPIAccessReceive(String status); 27 | } 28 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/java/org/wso2/emm/agent/proxy/interfaces/APIAccessCallBack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.emm.agent.proxy.interfaces; 19 | 20 | /** 21 | * This interface handles API access callback when the application 22 | * is able to receive the access token by passing necessary credentials. Applications 23 | * can implement this when retrieving tokens on authentication. 24 | */ 25 | public interface APIAccessCallBack { 26 | void onAPIAccessReceive(String status); 27 | } 28 | -------------------------------------------------------------------------------- /app-catalog/volley/src/main/java/com/android/volley/Network.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley; 18 | 19 | /** 20 | * An interface for performing requests. 21 | */ 22 | public interface Network { 23 | /** 24 | * Performs the specified request. 25 | * @param request Request to process 26 | * @return A {@link NetworkResponse} with data and caching metadata; will never be null 27 | * @throws VolleyError on errors 28 | */ 29 | public NetworkResponse performRequest(Request request) throws VolleyError; 30 | } 31 | -------------------------------------------------------------------------------- /system-service/app/src/main/res/xml/agent_device_admin.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/java/org/wso2/emm/agent/proxy/interfaces/TokenCallBack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.emm.agent.proxy.interfaces; 19 | 20 | import org.wso2.emm.agent.proxy.beans.Token; 21 | 22 | /** 23 | * This interface handles token callback when the application 24 | * is able to receive the access token. Applications 25 | * can implement this when they retrieve tokens. 26 | */ 27 | public interface TokenCallBack { 28 | void onReceiveTokenResult(Token token, String status); 29 | } 30 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/java/org/wso2/iot/agent/proxy/interfaces/TokenCallBack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.iot.agent.proxy.interfaces; 19 | 20 | import org.wso2.iot.agent.proxy.beans.Token; 21 | 22 | /** 23 | * This interface handles token callback when the application 24 | * is able to receive the access token. Applications 25 | * can implement this when they retrieve tokens. 26 | */ 27 | public interface TokenCallBack { 28 | void onReceiveTokenResult(Token token, String status, String message); 29 | } 30 | -------------------------------------------------------------------------------- /app-catalog/volley/src/main/java/com/android/volley/NetworkError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley; 18 | 19 | /** 20 | * Indicates that there was a network error when performing a Volley request. 21 | */ 22 | @SuppressWarnings("serial") 23 | public class NetworkError extends VolleyError { 24 | public NetworkError() { 25 | super(); 26 | } 27 | 28 | public NetworkError(Throwable cause) { 29 | super(cause); 30 | } 31 | 32 | public NetworkError(NetworkResponse networkResponse) { 33 | super(networkResponse); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/java/org/wso2/iot/agent/proxy/interfaces/APIResultCallBack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.iot.agent.proxy.interfaces; 19 | 20 | import java.util.Map; 21 | 22 | /** 23 | * This interface handles API result callback when the application 24 | * is able to receive the API results by passing access token. Applications 25 | * can implement this when API access is required. 26 | */ 27 | public interface APIResultCallBack { 28 | void onReceiveAPIResult(Map result, int requestCode); 29 | } 30 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/java/org/wso2/emm/agent/proxy/interfaces/APIResultCallBack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.emm.agent.proxy.interfaces; 19 | 20 | import java.util.Map; 21 | 22 | /** 23 | * This interface handles API result callback when the application 24 | * is able to receive the API results by passing access token. Applications 25 | * can implement this when API access is required. 26 | */ 27 | public interface APIResultCallBack { 28 | void onReceiveAPIResult(Map result, int requestCode); 29 | } 30 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/res/values-v14/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 26 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app-catalog/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.3" 6 | 7 | defaultConfig { 8 | applicationId "org.wso2.app.catalog" 9 | minSdkVersion 16 10 | targetSdkVersion 23 11 | versionCode 1 12 | versionName "1.0" 13 | multiDexEnabled true 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | packagingOptions { 22 | exclude 'META-INF/LICENSE' 23 | exclude 'META-INF/NOTICE' 24 | } 25 | } 26 | 27 | dependencies { 28 | compile project(':iDPProxy') 29 | compile('com.googlecode.json-simple:json-simple:1.1.1') { 30 | exclude module: 'junit' 31 | } 32 | compile fileTree(dir: 'libs', include: ['*.jar']) 33 | compile 'com.android.support:appcompat-v7:23.0.0' 34 | compile 'com.fasterxml.jackson.core:jackson-core:2.6.0-rc3' 35 | compile 'com.fasterxml.jackson.core:jackson-databind:2.6.0-rc3' 36 | compile 'com.fasterxml.jackson.core:jackson-annotations:2.6.0-rc3' 37 | compile 'com.squareup.picasso:picasso:2.5.2' 38 | } 39 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 23 | 24 | 27 | 28 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /client/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | buildscript { 19 | repositories { 20 | jcenter() 21 | maven { 22 | url 'https://maven.google.com/' 23 | name 'Google' 24 | } 25 | } 26 | 27 | 28 | dependencies { 29 | classpath 'com.android.tools.build:gradle:2.3.3' 30 | classpath 'com.google.gms:google-services:3.1.0' 31 | } 32 | } 33 | 34 | task wrapper(type: Wrapper) { 35 | gradleVersion = '2.2.3' 36 | } 37 | 38 | allprojects { 39 | repositories { 40 | jcenter() 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app-catalog/volley/src/main/java/com/android/volley/toolbox/Authenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley.toolbox; 18 | 19 | import com.android.volley.AuthFailureError; 20 | 21 | /** 22 | * An interface for interacting with auth tokens. 23 | */ 24 | public interface Authenticator { 25 | /** 26 | * Synchronously retrieves an auth token. 27 | * 28 | * @throws AuthFailureError If authentication did not succeed 29 | */ 30 | public String getAuthToken() throws AuthFailureError; 31 | 32 | /** 33 | * Invalidates the provided auth token. 34 | */ 35 | public void invalidateAuthToken(String authToken); 36 | } 37 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/java/org/wso2/iot/agent/proxy/authenticators/OAuthAuthenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.proxy.authenticators; 20 | 21 | import java.security.KeyStore; 22 | import java.util.Map; 23 | 24 | public class OAuthAuthenticator implements ClientAuthenticator{ 25 | @Override 26 | public void doAuthenticate() { 27 | } 28 | 29 | @Override 30 | public KeyStore getCredentialCertificate() { 31 | return null; 32 | } 33 | 34 | @Override 35 | public Map getCredentialKey() { 36 | return null; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/java/org/wso2/emm/agent/proxy/authenticators/OAuthAuthenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.emm.agent.proxy.authenticators; 20 | 21 | import java.security.KeyStore; 22 | import java.util.Map; 23 | 24 | public class OAuthAuthenticator implements ClientAuthenticator{ 25 | @Override 26 | public void doAuthenticate() { 27 | } 28 | 29 | @Override 30 | public KeyStore getCredentialCertificate() { 31 | return null; 32 | } 33 | 34 | @Override 35 | public Map getCredentialKey() { 36 | return null; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app-catalog/volley/src/main/java/com/android/volley/ClientError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley; 18 | 19 | /** 20 | * Indicates that the server responded with an error response indicating that the client has erred. 21 | * 22 | * For backwards compatibility, extends ServerError which used to be thrown for all server errors, 23 | * including 4xx error codes indicating a client error. 24 | */ 25 | @SuppressWarnings("serial") 26 | public class ClientError extends ServerError { 27 | public ClientError(NetworkResponse networkResponse) { 28 | super(networkResponse); 29 | } 30 | 31 | public ClientError() { 32 | super(); 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/services/LogPublisherFactory.java: -------------------------------------------------------------------------------- 1 | package org.wso2.iot.agent.services; 2 | 3 | import android.content.Context; 4 | import org.wso2.iot.agent.events.publisher.DataPublisher; 5 | import org.wso2.iot.agent.events.publisher.HttpDataPublisher; 6 | import org.wso2.iot.agent.events.publisher.SplunkLogPublisher; 7 | import org.wso2.iot.agent.utils.Constants; 8 | 9 | /** 10 | * This class produce the matching Log Manager according to the preferred publisher. 11 | */ 12 | public class LogPublisherFactory { 13 | private Context context; 14 | private static SplunkLogPublisher splunkLogPublisher; 15 | 16 | public LogPublisherFactory(Context context) { 17 | this.context = context; 18 | } 19 | 20 | public DataPublisher getLogPublisher() { 21 | if (Constants.LogPublisher.DAS_PUBLISHER.equals(Constants.LogPublisher.LOG_PUBLISHER_IN_USE)) { 22 | return new HttpDataPublisher(context); 23 | } else if (Constants.LogPublisher.SPLUNK_PUBLISHER.equals(Constants.LogPublisher.LOG_PUBLISHER_IN_USE)) { 24 | if (splunkLogPublisher == null) { 25 | splunkLogPublisher = new SplunkLogPublisher(context); 26 | } 27 | return splunkLogPublisher; 28 | } else { 29 | return null; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app-catalog/volley/src/test/java/com/android/volley/toolbox/RequestFutureTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley.toolbox; 18 | 19 | import com.android.volley.Request; 20 | import org.junit.Test; 21 | import org.junit.runner.RunWith; 22 | import org.robolectric.RobolectricTestRunner; 23 | 24 | import static org.junit.Assert.assertNotNull; 25 | 26 | @RunWith(RobolectricTestRunner.class) 27 | public class RequestFutureTest { 28 | 29 | @Test 30 | public void publicMethods() throws Exception { 31 | // Catch-all test to find API-breaking changes. 32 | assertNotNull(RequestFuture.class.getMethod("newFuture")); 33 | assertNotNull(RequestFuture.class.getMethod("setRequest", Request.class)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app-catalog/volley/src/main/java/com/android/volley/ResponseDelivery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley; 18 | 19 | public interface ResponseDelivery { 20 | /** 21 | * Parses a response from the network or cache and delivers it. 22 | */ 23 | public void postResponse(Request request, Response response); 24 | 25 | /** 26 | * Parses a response from the network or cache and delivers it. The provided 27 | * Runnable will be executed after delivery. 28 | */ 29 | public void postResponse(Request request, Response response, Runnable runnable); 30 | 31 | /** 32 | * Posts an error for the given request. 33 | */ 34 | public void postError(Request request, VolleyError error); 35 | } 36 | -------------------------------------------------------------------------------- /app-catalog/volley/src/main/java/com/android/volley/toolbox/NoCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley.toolbox; 18 | 19 | import com.android.volley.Cache; 20 | 21 | /** 22 | * A cache that doesn't. 23 | */ 24 | public class NoCache implements Cache { 25 | @Override 26 | public void clear() { 27 | } 28 | 29 | @Override 30 | public Entry get(String key) { 31 | return null; 32 | } 33 | 34 | @Override 35 | public void put(String key, Entry entry) { 36 | } 37 | 38 | @Override 39 | public void invalidate(String key, boolean fullExpire) { 40 | } 41 | 42 | @Override 43 | public void remove(String key) { 44 | } 45 | 46 | @Override 47 | public void initialize() { 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/events/beans/ApplicationStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.events.beans; 20 | 21 | /** 22 | * Represents application statues. 23 | */ 24 | public class ApplicationStatus { 25 | 26 | private String packageName; 27 | private String state; 28 | 29 | public String getState() { 30 | return state; 31 | } 32 | 33 | public void setState(String state) { 34 | this.state = state; 35 | } 36 | 37 | public String getPackageName() { 38 | return packageName; 39 | } 40 | 41 | public void setPackageName(String packageName) { 42 | this.packageName = packageName; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/java/org/wso2/iot/agent/proxy/interfaces/AuthenticationCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.proxy.interfaces; 20 | 21 | /** 22 | * Callback interface Handles call backs to authentication requests. 23 | * This is to provide a call back to a UI/caller with the out put of the 24 | */ 25 | public interface AuthenticationCallback { 26 | 27 | /** 28 | * When the authentication is completed, this can be called to notify the caller. 29 | * @param authenticated Status of the authentication. 30 | * @param requestCode Request code to identify a request uniquely. 31 | */ 32 | void onAuthenticated(boolean authenticated, int requestCode); 33 | } 34 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/java/org/wso2/emm/agent/proxy/interfaces/AuthenticationCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.emm.agent.proxy.interfaces; 20 | 21 | /** 22 | * Callback interface Handles call backs to authentication requests. 23 | * This is to provide a call back to a UI/caller with the out put of the 24 | */ 25 | public interface AuthenticationCallback { 26 | 27 | /** 28 | * When the authentication is completed, this can be called to notify the caller. 29 | * @param authenticated Status of the authentication. 30 | * @param requestCode Request code to identify a request uniquely. 31 | */ 32 | void onAuthenticated(boolean authenticated, int requestCode); 33 | } 34 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/beans/AppRestriction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.iot.agent.beans; 19 | 20 | import java.util.List; 21 | 22 | public class AppRestriction { 23 | 24 | private String restrictionType; 25 | private List restrictedList; 26 | 27 | public String getRestrictionType() { 28 | return restrictionType; 29 | } 30 | 31 | public void setRestrictionType(String restrictionType) { 32 | this.restrictionType = restrictionType; 33 | } 34 | 35 | public List getRestrictedList() { 36 | return restrictedList; 37 | } 38 | 39 | public void setRestrictedList(List restrictedList) { 40 | this.restrictedList = restrictedList; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /client/client/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | #A8A8A8 21 | #ffffff 22 | #606060 23 | #212121 24 | 25 | #66000000 26 | #ef6c00 27 | #bf360c 28 | #EF6C00 29 | #e78535 30 | #C77627 31 | #ffffffff 32 | 33 | -------------------------------------------------------------------------------- /app-catalog/volley/proguard.cfg: -------------------------------------------------------------------------------- 1 | -optimizationpasses 5 2 | -dontusemixedcaseclassnames 3 | -dontskipnonpubliclibraryclasses 4 | -dontpreverify 5 | -verbose 6 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 7 | 8 | -keep public class * extends android.app.Activity 9 | -keep public class * extends android.app.Application 10 | -keep public class * extends android.app.Service 11 | -keep public class * extends android.content.BroadcastReceiver 12 | -keep public class * extends android.content.ContentProvider 13 | -keep public class * extends android.app.backup.BackupAgentHelper 14 | -keep public class * extends android.preference.Preference 15 | -keep public class com.android.vending.licensing.ILicensingService 16 | 17 | -keepclasseswithmembernames class * { 18 | native ; 19 | } 20 | 21 | -keepclasseswithmembers class * { 22 | public (android.content.Context, android.util.AttributeSet); 23 | } 24 | 25 | -keepclasseswithmembers class * { 26 | public (android.content.Context, android.util.AttributeSet, int); 27 | } 28 | 29 | -keepclassmembers class * extends android.app.Activity { 30 | public void *(android.view.View); 31 | } 32 | 33 | -keepclassmembers enum * { 34 | public static **[] values(); 35 | public static ** valueOf(java.lang.String); 36 | } 37 | 38 | -keep class * implements android.os.Parcelable { 39 | public static final android.os.Parcelable$Creator *; 40 | } 41 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/beans/Tenant.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.beans; 20 | 21 | /** 22 | * This class represents the Tenant information which user belong. 23 | */ 24 | public class Tenant { 25 | 26 | private String tenantDomain; 27 | private String displayName; 28 | 29 | public String getTenantDomain() { 30 | return tenantDomain; 31 | } 32 | 33 | public void setTenantDomain(String tenantDomain) { 34 | this.tenantDomain = tenantDomain; 35 | } 36 | 37 | public String getDisplayName() { 38 | return displayName; 39 | } 40 | 41 | public void setDisplayName(String displayName) { 42 | this.displayName = displayName; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | apply plugin: 'com.android.library' 19 | android { 20 | compileSdkVersion 23 21 | buildToolsVersion "23.0.3" 22 | 23 | defaultConfig { 24 | minSdkVersion 16 25 | targetSdkVersion 22 26 | } 27 | 28 | buildTypes { 29 | release { 30 | minifyEnabled false 31 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 32 | } 33 | } 34 | compileOptions { 35 | sourceCompatibility JavaVersion.VERSION_1_7 36 | targetCompatibility JavaVersion.VERSION_1_7 37 | } 38 | } 39 | 40 | dependencies { 41 | compile 'commons-codec:commons-codec:20041127.091804' 42 | compile project(':volley') 43 | } -------------------------------------------------------------------------------- /client/client/src/androidTest/java/org/wso2/iot/agent/services/operation/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.iot.agent.services.operation; 19 | 20 | import android.os.Environment; 21 | 22 | public class Constants { 23 | static final String STATUS_COMPLETED = "COMPLETED"; 24 | static final String FTP_SCHEME = "ftp://"; 25 | static final String SFTP_SCHEME = "sftp://"; 26 | static final String LOCAL_HOST = "@localhost:"; 27 | static final String DOWNLOAD_FILE_NAME = "DownloadTestFile.txt"; 28 | static final String UPLOAD_FILE_NAME = "UploadTestFile.txt"; 29 | static final String USER_NAME = "test"; 30 | static final String PASSWORD = "test"; 31 | static final int FTP_PORT = 2221; 32 | static final int SFTP_PORT = 2223; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/services/kiosk/KioskMsgAlarmService.java: -------------------------------------------------------------------------------- 1 | package org.wso2.iot.agent.services.kiosk; 2 | 3 | import android.app.IntentService; 4 | import android.content.Intent; 5 | import org.wso2.iot.agent.KioskActivity; 6 | /* 7 | IntentService used to update kiosk ui for alarm and message operations 8 | */ 9 | public class KioskMsgAlarmService extends IntentService { 10 | 11 | public static final String ACTIVITY_TYPE = "type"; 12 | public static final String ACTIVITY_MSG = "msg"; 13 | public static final String ACTIVITY_TITLE = "title"; 14 | 15 | public KioskMsgAlarmService(String s) { 16 | super("KioskMsgAlarmService"); 17 | } 18 | public KioskMsgAlarmService() { 19 | super("KioskMsgAlarmService"); 20 | } 21 | 22 | 23 | @Override 24 | protected void onHandleIntent(Intent intent) { 25 | String msg = intent.getStringExtra(ACTIVITY_MSG); 26 | String type = intent.getStringExtra(ACTIVITY_TYPE); 27 | String title = intent.getStringExtra(ACTIVITY_TITLE); 28 | Intent broadcastIntent = new Intent(); 29 | broadcastIntent.setAction(KioskActivity.ResponseReceiver.ACTION_RESP); 30 | broadcastIntent.addCategory(Intent.CATEGORY_DEFAULT); 31 | broadcastIntent.putExtra(ACTIVITY_MSG, msg); 32 | broadcastIntent.putExtra(ACTIVITY_TYPE, type); 33 | broadcastIntent.putExtra(ACTIVITY_TITLE, title); 34 | sendBroadcast(broadcastIntent); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app-catalog/app/src/main/java/org/wso2/app/catalog/AppCatalogException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.app.catalog; 19 | 20 | /** 21 | * Custom exception class for IDP plug-in related exceptions. 22 | */ 23 | public class AppCatalogException extends Exception { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | public AppCatalogException(String msg, Exception nestedEx) { 28 | super(msg, nestedEx); 29 | } 30 | 31 | public AppCatalogException(String message, Throwable cause) { 32 | super(message, cause); 33 | } 34 | 35 | public AppCatalogException(String msg) { 36 | super(msg); 37 | } 38 | 39 | public AppCatalogException() { 40 | super(); 41 | } 42 | 43 | public AppCatalogException(Throwable cause) { 44 | super(cause); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/AndroidAgentException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.iot.agent; 19 | 20 | /** 21 | * Custom exception class for IDP plug-in related exceptions. 22 | */ 23 | public class AndroidAgentException extends Exception { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | public AndroidAgentException(String msg, Exception nestedEx) { 28 | super(msg, nestedEx); 29 | } 30 | 31 | public AndroidAgentException(String message, Throwable cause) { 32 | super(message, cause); 33 | } 34 | 35 | public AndroidAgentException(String msg) { 36 | super(msg); 37 | } 38 | 39 | public AndroidAgentException() { 40 | super(); 41 | } 42 | 43 | public AndroidAgentException(Throwable cause) { 44 | super(cause); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /client/client/src/main/res/layout/activity_lock.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | 21 | 22 | 28 | 29 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/utils/HTTPAuthenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.utils; 20 | 21 | 22 | import java.net.Authenticator; 23 | import java.net.PasswordAuthentication; 24 | 25 | public class HTTPAuthenticator extends Authenticator { 26 | private static String username = ""; 27 | private static String password = ""; 28 | 29 | protected PasswordAuthentication getPasswordAuthentication() { 30 | return new PasswordAuthentication(HTTPAuthenticator.username, 31 | HTTPAuthenticator.password.toCharArray()); 32 | } 33 | 34 | public static void setPasswordAuthentication(String username, String password) { 35 | HTTPAuthenticator.username = username; 36 | HTTPAuthenticator.password = password; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /system-service/app/src/main/res/layout/activity_lock.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | 21 | 22 | 28 | 29 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app-catalog/volley/src/main/java/com/android/volley/RetryPolicy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley; 18 | 19 | /** 20 | * Retry policy for a request. 21 | */ 22 | public interface RetryPolicy { 23 | 24 | /** 25 | * Returns the current timeout (used for logging). 26 | */ 27 | public int getCurrentTimeout(); 28 | 29 | /** 30 | * Returns the current retry count (used for logging). 31 | */ 32 | public int getCurrentRetryCount(); 33 | 34 | /** 35 | * Prepares for the next retry by applying a backoff to the timeout. 36 | * @param error The error code of the last attempt. 37 | * @throws VolleyError In the event that the retry could not be performed (for example if we 38 | * ran out of attempts), the passed in error is thrown. 39 | */ 40 | public void retry(VolleyError error) throws VolleyError; 41 | } 42 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/java/org/wso2/iot/agent/proxy/IDPTokenManagerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.iot.agent.proxy; 19 | 20 | /** 21 | * Custom exception class for IDP plug-in related exceptions. 22 | */ 23 | public class IDPTokenManagerException extends Exception { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | public IDPTokenManagerException(String msg, Exception nestedEx) { 28 | super(msg, nestedEx); 29 | } 30 | 31 | public IDPTokenManagerException(String message, Throwable cause) { 32 | super(message, cause); 33 | } 34 | 35 | public IDPTokenManagerException(String msg) { 36 | super(msg); 37 | } 38 | 39 | public IDPTokenManagerException() { 40 | super(); 41 | } 42 | 43 | public IDPTokenManagerException(Throwable cause) { 44 | super(cause); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/java/org/wso2/emm/agent/proxy/IDPTokenManagerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.emm.agent.proxy; 19 | 20 | /** 21 | * Custom exception class for IDP plug-in related exceptions. 22 | */ 23 | public class IDPTokenManagerException extends Exception { 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | public IDPTokenManagerException(String msg, Exception nestedEx) { 28 | super(msg, nestedEx); 29 | } 30 | 31 | public IDPTokenManagerException(String message, Throwable cause) { 32 | super(message, cause); 33 | } 34 | 35 | public IDPTokenManagerException(String msg) { 36 | super(msg); 37 | } 38 | 39 | public IDPTokenManagerException() { 40 | super(); 41 | } 42 | 43 | public IDPTokenManagerException(Throwable cause) { 44 | super(cause); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /app-catalog/volley/src/test/java/com/android/volley/utils/CacheTestUtils.java: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. All Rights Reserved. 2 | 3 | package com.android.volley.utils; 4 | 5 | import com.android.volley.Cache; 6 | 7 | import java.util.Random; 8 | 9 | public class CacheTestUtils { 10 | 11 | /** 12 | * Makes a random cache entry. 13 | * @param data Data to use, or null to use random data 14 | * @param isExpired Whether the TTLs should be set such that this entry is expired 15 | * @param needsRefresh Whether the TTLs should be set such that this entry needs refresh 16 | */ 17 | public static Cache.Entry makeRandomCacheEntry( 18 | byte[] data, boolean isExpired, boolean needsRefresh) { 19 | Random random = new Random(); 20 | Cache.Entry entry = new Cache.Entry(); 21 | if (data != null) { 22 | entry.data = data; 23 | } else { 24 | entry.data = new byte[random.nextInt(1024)]; 25 | } 26 | entry.etag = String.valueOf(random.nextLong()); 27 | entry.lastModified = random.nextLong(); 28 | entry.ttl = isExpired ? 0 : Long.MAX_VALUE; 29 | entry.softTtl = needsRefresh ? 0 : Long.MAX_VALUE; 30 | return entry; 31 | } 32 | 33 | /** 34 | * Like {@link #makeRandomCacheEntry(byte[], boolean, boolean)} but 35 | * defaults to an unexpired entry. 36 | */ 37 | public static Cache.Entry makeRandomCacheEntry(byte[] data) { 38 | return makeRandomCacheEntry(data, false, false); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/services/location/ReverseGeoCodingService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.services.location; 20 | 21 | import android.location.Location; 22 | import org.wso2.iot.agent.beans.Address; 23 | 24 | /** 25 | * This interface represents the functions related to retrieve address of a given location. 26 | */ 27 | public interface ReverseGeoCodingService { 28 | 29 | /** 30 | * This method is used to fetch the address details of a given location. 31 | * @param location latitude and longitude 32 | */ 33 | void fetchReverseGeoCodes(Location location); 34 | 35 | /** 36 | * This method is used to get the address details of previously fetched location. 37 | * @return Returns an address object. 38 | */ 39 | Address getReverseGeoCodes(); 40 | } 41 | -------------------------------------------------------------------------------- /app-catalog/volley/src/test/java/com/android/volley/toolbox/StringRequestTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley.toolbox; 18 | 19 | import com.android.volley.Response; 20 | import org.junit.Test; 21 | import org.junit.runner.RunWith; 22 | import org.robolectric.RobolectricTestRunner; 23 | 24 | import static org.junit.Assert.assertNotNull; 25 | 26 | @RunWith(RobolectricTestRunner.class) 27 | public class StringRequestTest { 28 | 29 | @Test 30 | public void publicMethods() throws Exception { 31 | // Catch-all test to find API-breaking changes. 32 | assertNotNull(StringRequest.class.getConstructor(String.class, Response.Listener.class, 33 | Response.ErrorListener.class)); 34 | assertNotNull(StringRequest.class.getConstructor(int.class, String.class, 35 | Response.Listener.class, Response.ErrorListener.class)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/services/kiosk/KioskLockDownService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.iot.agent.services.kiosk; 19 | 20 | import android.app.IntentService; 21 | import android.content.Intent; 22 | import org.wso2.iot.agent.activities.KioskRestrictionActivity; 23 | 24 | /** 25 | * This class connects the LockActivity to the intent that is get passed in. 26 | */ 27 | public class KioskLockDownService extends IntentService { 28 | 29 | public KioskLockDownService() { 30 | super(KioskLockDownService.class.getName()); 31 | } 32 | 33 | @Override 34 | protected void onHandleIntent(Intent lockIntent) { 35 | lockIntent = new Intent(this, KioskRestrictionActivity.class); 36 | lockIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 37 | startActivity(lockIntent); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /client/client/src/main/res/values/runtimePermissions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | android.permission.READ_CALENDAR 5 | android.permission.WRITE_CALENDAR 6 | android.permission.CAMERA 7 | android.permission.READ_CONTACTS 8 | android.permission.WRITE_CONTACTS 9 | android.permission.GET_ACCOUNTS 10 | android.permission.ACCESS_FINE_LOCATION 11 | android.permission.ACCESS_COARSE_LOCATION 12 | android.permission.RECORD_AUDIO 13 | android.permission.READ_PHONE_STATE 14 | android.permission.CALL_PHONE 15 | android.permission.READ_CALL_LOG 16 | android.permission.WRITE_CALL_LOG 17 | com.android.voicemail.permission.ADD_VOICEMAIL 18 | android.permission.USE_SIP 19 | android.permission.PROCESS_OUTGOING_CALLS 20 | android.permission.BODY_SENSORS 21 | android.permission.SEND_SMS 22 | android.permission.RECEIVE_SMS 23 | android.permission.RECEIVE_WAP_PUSH 24 | android.permission.RECEIVE_MMS 25 | android.permission.READ_EXTERNAL_STORAGE 26 | android.permission.WRITE_EXTERNAL_STORAGE 27 | 28 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 25 | 32 | 33 | 34 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /client/client/src/main/res/layout/top_banner.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 15 | 16 | 24 | 25 | 37 | 38 | -------------------------------------------------------------------------------- /client/client/src/main/res/drawable/btn_grey.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/java/org/wso2/iot/agent/proxy/clients/CommunicationClientFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.proxy.clients; 20 | 21 | import org.wso2.iot.agent.proxy.utils.Constants; 22 | 23 | /** 24 | * This provides a factory of communication clients, that can be used when communicating with 25 | * different type of authentication mechanisms 26 | */ 27 | public class CommunicationClientFactory { 28 | 29 | public CommunicationClient getClient(String clientType) { 30 | if (clientType == null) { 31 | return null; 32 | } 33 | if (clientType.equalsIgnoreCase(Constants.HttpClient.MUTUAL_HTTP_CLIENT)) { 34 | return new MutualSSLClient(); 35 | } else if (clientType.equalsIgnoreCase(Constants.HttpClient.OAUTH_HTTP_CLIENT)) { 36 | return new OAuthSSLClient(); 37 | } 38 | return null; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/java/org/wso2/emm/agent/proxy/clients/CommunicationClientFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.emm.agent.proxy.clients; 20 | 21 | import org.wso2.emm.agent.proxy.utils.Constants; 22 | 23 | /** 24 | * This provides a factory of communication clients, that can be used when communicating with 25 | * different type of authentication mechanisms 26 | */ 27 | public class CommunicationClientFactory { 28 | 29 | public CommunicationClient getClient(String clientType) { 30 | if (clientType == null) { 31 | return null; 32 | } 33 | if (clientType.equalsIgnoreCase(Constants.HttpClient.MUTUAL_HTTP_CLIENT)) { 34 | return new MutualSSLClient(); 35 | } else if (clientType.equalsIgnoreCase(Constants.HttpClient.OAUTH_HTTP_CLIENT)) { 36 | return new OAuthSSLClient(); 37 | } 38 | return null; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /client/client/src/main/res/layout/activity_registration.xml: -------------------------------------------------------------------------------- 1 | 18 | 24 | 25 | 30 | 31 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/java/org/wso2/iot/agent/proxy/utils/StreamHandlerUtil.java: -------------------------------------------------------------------------------- 1 | package org.wso2.iot.agent.proxy.utils; 2 | 3 | import android.util.Log; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.io.OutputStream; 9 | 10 | /** 11 | * This class handles the closure of all the stream types. 12 | */ 13 | public class StreamHandlerUtil { 14 | 15 | /** 16 | * Close a ByteArrayOutputStream passed in. 17 | * 18 | * @param stream - ByteArrayOutputStream to be closed. 19 | */ 20 | public static void closeOutputStream(OutputStream stream, String tag) { 21 | if (stream != null) { 22 | try { 23 | stream.close(); 24 | } catch (IOException e) { 25 | Log.e(tag, "Exception occured when closing ByteArrayOutputStream." + e); 26 | } 27 | } 28 | } 29 | 30 | /** 31 | * Close a InputStream passed in. 32 | * 33 | * @param stream - InputStream to be closed. 34 | */ 35 | public static void closeInputStream(InputStream stream, String tag) { 36 | if (stream != null) { 37 | try { 38 | stream.close(); 39 | } catch (IOException e) { 40 | Log.e(tag, "Exception occured when closing InputStream." + e); 41 | } 42 | } 43 | } 44 | 45 | /** 46 | * Close a InputStream passed in. 47 | * 48 | * @param stream - InputStream to be closed. 49 | */ 50 | public static void closeBufferedReader(BufferedReader stream, String tag) { 51 | if (stream != null) { 52 | try { 53 | stream.close(); 54 | } catch (IOException e) { 55 | Log.e(tag, "Exception occured when closing BufferedReader." + e); 56 | } 57 | } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/java/org/wso2/emm/agent/proxy/utils/StreamHandlerUtil.java: -------------------------------------------------------------------------------- 1 | package org.wso2.emm.agent.proxy.utils; 2 | 3 | import android.util.Log; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.io.OutputStream; 9 | 10 | /** 11 | * This class handles the closure of all the stream types. 12 | */ 13 | public class StreamHandlerUtil { 14 | 15 | /** 16 | * Close a ByteArrayOutputStream passed in. 17 | * 18 | * @param stream - ByteArrayOutputStream to be closed. 19 | */ 20 | public static void closeOutputStream(OutputStream stream, String tag) { 21 | if (stream != null) { 22 | try { 23 | stream.close(); 24 | } catch (IOException e) { 25 | Log.e(tag, "Exception occured when closing ByteArrayOutputStream." + e); 26 | } 27 | } 28 | } 29 | 30 | /** 31 | * Close a InputStream passed in. 32 | * 33 | * @param stream - InputStream to be closed. 34 | */ 35 | public static void closeInputStream(InputStream stream, String tag) { 36 | if (stream != null) { 37 | try { 38 | stream.close(); 39 | } catch (IOException e) { 40 | Log.e(tag, "Exception occured when closing InputStream." + e); 41 | } 42 | } 43 | } 44 | 45 | /** 46 | * Close a InputStream passed in. 47 | * 48 | * @param stream - InputStream to be closed. 49 | */ 50 | public static void closeBufferedReader(BufferedReader stream, String tag) { 51 | if (stream != null) { 52 | try { 53 | stream.close(); 54 | } catch (IOException e) { 55 | Log.e(tag, "Exception occured when closing BufferedReader." + e); 56 | } 57 | } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/services/kiosk/KioskUnlockService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.iot.agent.services.kiosk; 19 | 20 | import android.app.IntentService; 21 | import android.content.Intent; 22 | import android.util.Log; 23 | import org.wso2.iot.agent.activities.SplashActivity; 24 | 25 | public class KioskUnlockService extends IntentService { 26 | private static final String TAG = "KioskUnlockService"; 27 | 28 | public KioskUnlockService() { 29 | super(KioskUnlockService.class.getName()); 30 | } 31 | 32 | @Override 33 | protected void onHandleIntent(Intent releaseIntent) { 34 | Log.d(TAG,"Device unlocked." ); 35 | releaseIntent = new Intent(this, SplashActivity.class); 36 | releaseIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 37 | releaseIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 38 | startActivity(releaseIntent); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app-catalog/volley/src/test/java/com/android/volley/toolbox/CacheTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley.toolbox; 18 | 19 | import com.android.volley.Cache; 20 | import org.junit.Test; 21 | import org.junit.runner.RunWith; 22 | import org.robolectric.RobolectricTestRunner; 23 | 24 | import static org.junit.Assert.assertNotNull; 25 | 26 | @RunWith(RobolectricTestRunner.class) 27 | public class CacheTest { 28 | 29 | @Test 30 | public void publicMethods() throws Exception { 31 | // Catch-all test to find API-breaking changes. 32 | assertNotNull(Cache.class.getMethod("get", String.class)); 33 | assertNotNull(Cache.class.getMethod("put", String.class, Cache.Entry.class)); 34 | assertNotNull(Cache.class.getMethod("initialize")); 35 | assertNotNull(Cache.class.getMethod("invalidate", String.class, boolean.class)); 36 | assertNotNull(Cache.class.getMethod("remove", String.class)); 37 | assertNotNull(Cache.class.getMethod("clear")); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/beans/ComplianceFeature.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.wso2.iot.agent.beans; 19 | 20 | /** 21 | * This class represents the basic information of 22 | * the policy feature compliance 23 | */ 24 | public class ComplianceFeature { 25 | 26 | private String featureCode; 27 | private boolean compliance; 28 | private String message; 29 | 30 | public String getFeatureCode() { 31 | return featureCode; 32 | } 33 | 34 | public void setFeatureCode(String featureCode) { 35 | this.featureCode = featureCode; 36 | } 37 | 38 | public boolean isCompliance() { 39 | return compliance; 40 | } 41 | 42 | public void setCompliance(boolean compliance) { 43 | this.compliance = compliance; 44 | } 45 | 46 | public String getMessage() { 47 | return message; 48 | } 49 | 50 | public void setMessage(String message) { 51 | this.message = message; 52 | } 53 | } -------------------------------------------------------------------------------- /client/client/src/main/res/layout/kiosk_app_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 22 | 28 | 29 | 39 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/utils/StreamHandler.java: -------------------------------------------------------------------------------- 1 | package org.wso2.iot.agent.utils; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | import java.io.OutputStream; 7 | 8 | import android.util.Log; 9 | 10 | /** 11 | * This class handles the closure of all the stream types. 12 | */ 13 | public class StreamHandler { 14 | 15 | /** 16 | * Close a ByteArrayOutputStream passed in. 17 | * 18 | * @param stream 19 | * - ByteArrayOutputStream to be closed. 20 | */ 21 | public static void closeOutputStream(OutputStream stream, String tag) { 22 | if (stream != null) { 23 | try { 24 | stream.close(); 25 | } catch (IOException e) { 26 | Log.e(tag, "Exception occured when closing ByteArrayOutputStream." + e); 27 | } 28 | } 29 | } 30 | 31 | /** 32 | * Close a InputStream passed in. 33 | * 34 | * @param stream 35 | * - InputStream to be closed. 36 | */ 37 | public static void closeInputStream(InputStream stream, String tag) { 38 | if (stream != null) { 39 | try { 40 | stream.close(); 41 | } catch (IOException e) { 42 | Log.e(tag, "Exception occured when closing InputStream", e); 43 | } 44 | } 45 | } 46 | 47 | /** 48 | * Close a InputStream passed in. 49 | * 50 | * @param stream 51 | * - InputStream to be closed. 52 | */ 53 | public static void closeBufferedReader(BufferedReader stream, String tag) { 54 | if (stream != null) { 55 | try { 56 | stream.close(); 57 | } catch (IOException e) { 58 | Log.e(tag, "Exception occured when closing BufferedReader", e); 59 | } 60 | } 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/events/beans/EventPayload.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.events.beans; 20 | 21 | /** 22 | * This class represents event details that needs publishing. 23 | */ 24 | public class EventPayload { 25 | 26 | private String deviceIdentifier; 27 | private String type; 28 | private String payload; 29 | 30 | public String getType() { 31 | return type; 32 | } 33 | 34 | public void setType(String type) { 35 | this.type = type; 36 | } 37 | 38 | public String getPayload() { 39 | return payload; 40 | } 41 | 42 | public void setPayload(String payload) { 43 | this.payload = payload; 44 | } 45 | 46 | public String getDeviceIdentifier() { 47 | return deviceIdentifier; 48 | } 49 | 50 | public void setDeviceIdentifier(String deviceIdentifier) { 51 | this.deviceIdentifier = deviceIdentifier; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /app-catalog/app/src/main/java/org/wso2/app/catalog/utils/StreamHandler.java: -------------------------------------------------------------------------------- 1 | package org.wso2.app.catalog.utils; 2 | 3 | import android.util.Log; 4 | 5 | import java.io.BufferedReader; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.io.OutputStream; 9 | 10 | /** 11 | * This class handles the closure of all the stream types. 12 | */ 13 | public class StreamHandler { 14 | 15 | /** 16 | * Close a ByteArrayOutputStream passed in. 17 | * 18 | * @param stream 19 | * - ByteArrayOutputStream to be closed. 20 | */ 21 | public static void closeOutputStream(OutputStream stream, String tag) { 22 | if (stream != null) { 23 | try { 24 | stream.close(); 25 | } catch (IOException e) { 26 | Log.e(tag, "Exception occured when closing ByteArrayOutputStream." + e); 27 | } 28 | } 29 | } 30 | 31 | /** 32 | * Close a InputStream passed in. 33 | * 34 | * @param stream 35 | * - InputStream to be closed. 36 | */ 37 | public static void closeInputStream(InputStream stream, String tag) { 38 | if (stream != null) { 39 | try { 40 | stream.close(); 41 | } catch (IOException e) { 42 | Log.e(tag, "Exception occured when closing InputStream", e); 43 | } 44 | } 45 | } 46 | 47 | /** 48 | * Close a InputStream passed in. 49 | * 50 | * @param stream 51 | * - InputStream to be closed. 52 | */ 53 | public static void closeBufferedReader(BufferedReader stream, String tag) { 54 | if (stream != null) { 55 | try { 56 | stream.close(); 57 | } catch (IOException e) { 58 | Log.e(tag, "Exception occured when closing BufferedReader", e); 59 | } 60 | } 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to WSO2 Android Agent for WSO2 IoT Server 2 | 3 | 4 | 5 | The WSO2 Device Management Agent allows you to authenticate and enroll your device in WSO2 IoT Server. 6 | It also offers a complete and secure enterprise mobility management (EMM/MDM) solution that aims to address mobile computing challenges faced by enterprises today. It helps organizations deal with both corporate owned, personally enabled (COPE) and employee-owned devices with the bring your own device (BYOD) concept. 7 | 8 | ### WSO2 Device Management Agent Key Features 9 | 10 | - Supports app management 11 | - Device location tracking 12 | - Retrieving device info 13 | - Changing lock code 14 | - Restricting camera 15 | - OTA WiFi configuration 16 | - Enterprise WIPE 17 | - Configuring encryption settings 18 | - Pass code policy configuration and clear pass code policy 19 | - Device master reset 20 | - Mute device 21 | - Ring device 22 | - Send messages to device 23 | - Install/uninstall store and enterprise applications 24 | - Retrieve apps installed on the device 25 | - Install Web clips on the device 26 | - Support FCM/LOCAL connectivity modes 27 | - App Catalog app to browse the store. 28 | - Support for custom alerts. 29 | - Advanced WiFi Profiles. 30 | - Improved support for OEMs 31 | 32 | Find the online documentation at : 33 | https://docs.wso2.com/display/IoTS310/Android+Device. 34 | 35 | ### Contact us 36 | 37 | WSO2 Android Agent developers can be contacted via the mailing lists: 38 | 39 | * WSO2 Developers List : dev@wso2.org 40 | * WSO2 Architecture List : architecture@wso2.org 41 | 42 | -------------------------------------------------------------------------------- /client/client/src/main/res/drawable/btn_orange.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /client/client/src/main/res/drawable/btn_orange_non_prominent.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /app-catalog/volley/src/main/java/com/android/volley/toolbox/HttpStack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley.toolbox; 18 | 19 | import com.android.volley.AuthFailureError; 20 | import com.android.volley.Request; 21 | 22 | import org.apache.http.HttpResponse; 23 | 24 | import java.io.IOException; 25 | import java.util.Map; 26 | 27 | /** 28 | * An HTTP stack abstraction. 29 | */ 30 | public interface HttpStack { 31 | /** 32 | * Performs an HTTP request with the given parameters. 33 | * 34 | *

A GET request is sent if request.getPostBody() == null. A POST request is sent otherwise, 35 | * and the Content-Type header is set to request.getPostBodyContentType().

36 | * 37 | * @param request the request to perform 38 | * @param additionalHeaders additional headers to be sent together with 39 | * {@link Request#getHeaders()} 40 | * @return the HTTP response 41 | */ 42 | public HttpResponse performRequest(Request request, Map additionalHeaders) 43 | throws IOException, AuthFailureError; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/java/org/wso2/iot/agent/proxy/clients/CommunicationClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.proxy.clients; 20 | 21 | import com.android.volley.RequestQueue; 22 | import org.wso2.iot.agent.proxy.IDPTokenManagerException; 23 | 24 | import java.util.Map; 25 | 26 | /** 27 | * This provides a generic interface that can be use to derive http clients based on underlying 28 | * communication protocols. 29 | */ 30 | public interface CommunicationClient { 31 | 32 | /** 33 | * Get a client which uses a secured communication medium such as SSL, TLS 34 | * @return A secured http client. 35 | * @throws IDPTokenManagerException 36 | */ 37 | RequestQueue getHttpClient() throws IDPTokenManagerException; 38 | 39 | 40 | /** 41 | * When a request goes through a client addition, defined headers needs to be added and this 42 | * can be achieved here. 43 | * @param headers Map of headers to be added. 44 | */ 45 | void addAdditionalHeader(Map headers); 46 | } 47 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/java/org/wso2/emm/agent/proxy/clients/CommunicationClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.emm.agent.proxy.clients; 20 | 21 | import com.android.volley.RequestQueue; 22 | import org.wso2.emm.agent.proxy.IDPTokenManagerException; 23 | 24 | import java.util.Map; 25 | 26 | /** 27 | * This provides a generic interface that can be use to derive http clients based on underlying 28 | * communication protocols. 29 | */ 30 | public interface CommunicationClient { 31 | 32 | /** 33 | * Get a client which uses a secured communication medium such as SSL, TLS 34 | * @return A secured http client. 35 | * @throws IDPTokenManagerException 36 | */ 37 | RequestQueue getHttpClient() throws IDPTokenManagerException; 38 | 39 | 40 | /** 41 | * When a request goes through a client addition, defined headers needs to be added and this 42 | * can be achieved here. 43 | * @param headers Map of headers to be added. 44 | */ 45 | void addAdditionalHeader(Map headers); 46 | } 47 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/api/TenantResolverCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.api; 20 | 21 | import com.android.volley.VolleyError; 22 | 23 | import org.wso2.iot.agent.AndroidAgentException; 24 | import org.wso2.iot.agent.beans.Tenant; 25 | 26 | import java.util.List; 27 | 28 | /** 29 | * Callback interface Handles call backs to tenant resolving requests. 30 | */ 31 | public interface TenantResolverCallback { 32 | /** 33 | * When the tenant resolving is completed, this can be called to notify the caller. 34 | * @param tenants List of tenants. 35 | */ 36 | void onTenantResolved(List tenants); 37 | 38 | /** 39 | * When authentication success. 40 | */ 41 | void onAuthenticationSuccess(); 42 | 43 | /** 44 | * When authentication failed. 45 | */ 46 | void onAuthenticationFail(); 47 | 48 | /** 49 | * On failure. 50 | * @param exception Cause of the failure. 51 | */ 52 | void onFailure(AndroidAgentException exception); 53 | } 54 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/services/LocationUpdateReceiver.java: -------------------------------------------------------------------------------- 1 | package org.wso2.iot.agent.services; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.location.Location; 7 | import android.util.Log; 8 | 9 | import org.wso2.iot.agent.proxy.IdentityProxy; 10 | import org.wso2.iot.agent.services.location.impl.OpenStreetMapService; 11 | import org.wso2.iot.agent.utils.Constants; 12 | 13 | public class LocationUpdateReceiver extends BroadcastReceiver { 14 | 15 | private static final String TAG = LocationUpdateReceiver.class.getSimpleName(); 16 | private static Location location; 17 | 18 | public LocationUpdateReceiver() { 19 | } 20 | 21 | public static Location getLocation() { 22 | if (location == null) { 23 | Log.w(TAG, "Location not found"); 24 | } 25 | return location; 26 | } 27 | 28 | @Override 29 | public void onReceive(Context context, Intent intent) { 30 | if (intent.hasExtra(Constants.Location.LOCATION)) { 31 | location = intent.getParcelableExtra(Constants.Location.LOCATION); 32 | } 33 | if (location == null) { 34 | Log.w(TAG, "Location not received"); 35 | } else { 36 | if (IdentityProxy.getInstance().getContext() != null) { 37 | OpenStreetMapService.getInstance().fetchReverseGeoCodes(location); 38 | } 39 | if (Constants.DEBUG_MODE_ENABLED) { 40 | Log.d(TAG, "Location> Lat:" + location.getLatitude() 41 | + " Lon:" + location.getLongitude() 42 | + " Provider:" + location.getProvider()); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/java/org/wso2/iot/agent/proxy/interfaces/CallBack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.iot.agent.proxy.interfaces; 19 | 20 | import org.wso2.iot.agent.proxy.beans.Token; 21 | 22 | /** 23 | * This interface handles token callback when the application 24 | * is able to receive the access token from the app local storage or from the server. 25 | * Applications can implement this when it requires access token. 26 | */ 27 | public interface CallBack { 28 | 29 | /** 30 | * Get access token stored in the app preferences. 31 | * 32 | * @param status - Status code. 33 | * @param message - Success/Error message. 34 | * @param token - Token retrieved. 35 | */ 36 | void receiveAccessToken(String status, String message, Token token); 37 | 38 | /** 39 | * Get a new access token from the server. 40 | * 41 | * @param status - Status code. 42 | * @param message - Success/Error message. 43 | * @param token - Token retrieved. 44 | */ 45 | void receiveNewAccessToken(String status, String message, Token token); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/java/org/wso2/emm/agent/proxy/interfaces/CallBack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.emm.agent.proxy.interfaces; 19 | 20 | import org.wso2.emm.agent.proxy.beans.Token; 21 | 22 | /** 23 | * This interface handles token callback when the application 24 | * is able to receive the access token from the app local storage or from the server. 25 | * Applications can implement this when it requires access token. 26 | */ 27 | public interface CallBack { 28 | 29 | /** 30 | * Get access token stored in the app preferences. 31 | * 32 | * @param status - Status code. 33 | * @param message - Success/Error message. 34 | * @param token - Token retrieved. 35 | */ 36 | void receiveAccessToken(String status, String message, Token token); 37 | 38 | /** 39 | * Get a new access token from the server. 40 | * 41 | * @param status - Status code. 42 | * @param message - Success/Error message. 43 | * @param token - Token retrieved. 44 | */ 45 | void receiveNewAccessToken(String status, String message, Token token); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/beans/UnregisterProfile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.wso2.iot.agent.beans; 19 | 20 | /** 21 | * This class represents the data that are required to unregister 22 | * the oauth application. 23 | */ 24 | public class UnregisterProfile { 25 | 26 | private String userId; 27 | private String consumerKey; 28 | private String applicationName; 29 | 30 | private static final String TAG = UnregisterProfile.class.getSimpleName(); 31 | 32 | public String getUserId() { 33 | return userId; 34 | } 35 | 36 | public void setUserId(String userId) { 37 | this.userId = userId; 38 | } 39 | 40 | public String getConsumerKey() { 41 | return consumerKey; 42 | } 43 | 44 | public void setConsumerKey(String consumerKey) { 45 | this.consumerKey = consumerKey; 46 | } 47 | 48 | public String getApplicationName() { 49 | return applicationName; 50 | } 51 | 52 | public void setApplicationName(String applicationName) { 53 | this.applicationName = applicationName; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /system-service/app/src/main/java/org/wso2/iot/system/service/services/OTADownloadService.java: -------------------------------------------------------------------------------- 1 | package org.wso2.iot.system.service.services; 2 | 3 | import android.app.Service; 4 | import android.content.Intent; 5 | import android.os.IBinder; 6 | import android.util.Log; 7 | 8 | import org.wso2.iot.system.service.R; 9 | import org.wso2.iot.system.service.api.OTADownload; 10 | import org.wso2.iot.system.service.api.OTAServerManager; 11 | import org.wso2.iot.system.service.utils.Preference; 12 | 13 | /** 14 | * This service will start the download monitoring thread by invoking the startDownloadUpgradePackage() 15 | * method after a reboot 16 | */ 17 | 18 | public class OTADownloadService extends Service { 19 | 20 | private static final String TAG = OTADownloadService.class.getName(); 21 | 22 | @Override 23 | public int onStartCommand(Intent intent, int flags, int startId) { 24 | boolean isAvailabledownloadReference = Preference.getBoolean(this, this.getResources().getString(R.string.download_manager_reference_id_available)); 25 | Log.d(TAG, "Download manager reference id availability: " + isAvailabledownloadReference); 26 | 27 | if (isAvailabledownloadReference) { 28 | Log.i(TAG, "Partially downloaded OTA file will be resumed"); 29 | OTADownload otaDownload = new OTADownload(this); 30 | OTAServerManager otaServerManager = otaDownload.getOtaServerManager(); 31 | otaServerManager.startDownloadUpgradePackage(otaServerManager); 32 | } else { 33 | Log.i(TAG, "No existing OTA download needs to be resumed"); 34 | stopSelf(); 35 | } 36 | return Service.START_STICKY; 37 | } 38 | 39 | @Override 40 | public IBinder onBind(Intent intent) { 41 | return null; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/java/org/wso2/iot/agent/proxy/authenticators/ClientAuthenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | */ 19 | 20 | package org.wso2.iot.agent.proxy.authenticators; 21 | 22 | import java.security.KeyStore; 23 | import java.util.Map; 24 | 25 | /** 26 | * This is an interface for authenticator where different type of authentication 27 | * methods can be plugged in by implementing the authenticator. 28 | */ 29 | public interface ClientAuthenticator { 30 | /** 31 | * Perform the authentication and using a callback, the result is given back to the caller. 32 | */ 33 | void doAuthenticate(); 34 | 35 | /** 36 | * Get a certificate that can be used in the authentication for providing authenticity to 37 | * a request. 38 | * @return A Keystore with the certificates inside. 39 | */ 40 | KeyStore getCredentialCertificate(); 41 | 42 | /** 43 | * Get any data that can be used as a authentication credentials. 44 | * @return A map of credentials and relevant data. 45 | */ 46 | Map getCredentialKey(); 47 | } 48 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/java/org/wso2/emm/agent/proxy/authenticators/ClientAuthenticator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | * 18 | */ 19 | 20 | package org.wso2.emm.agent.proxy.authenticators; 21 | 22 | import java.security.KeyStore; 23 | import java.util.Map; 24 | 25 | /** 26 | * This is an interface for authenticator where different type of authentication 27 | * methods can be plugged in by implementing the authenticator. 28 | */ 29 | public interface ClientAuthenticator { 30 | /** 31 | * Perform the authentication and using a callback, the result is given back to the caller. 32 | */ 33 | void doAuthenticate(); 34 | 35 | /** 36 | * Get a certificate that can be used in the authentication for providing authenticity to 37 | * a request. 38 | * @return A Keystore with the certificates inside. 39 | */ 40 | KeyStore getCredentialCertificate(); 41 | 42 | /** 43 | * Get any data that can be used as a authentication credentials. 44 | * @return A map of credentials and relevant data. 45 | */ 46 | Map getCredentialKey(); 47 | } 48 | -------------------------------------------------------------------------------- /app-catalog/app/src/main/java/org/wso2/app/catalog/beans/UnregisterProfile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.app.catalog.beans; 20 | 21 | /** 22 | * This class represents the data that are required to unregister 23 | * the oauth application. 24 | */ 25 | public class UnregisterProfile { 26 | 27 | private String userId; 28 | private String consumerKey; 29 | private String applicationName; 30 | 31 | private static final String TAG = UnregisterProfile.class.getSimpleName(); 32 | 33 | public String getUserId() { 34 | return userId; 35 | } 36 | 37 | public void setUserId(String userId) { 38 | this.userId = userId; 39 | } 40 | 41 | public String getConsumerKey() { 42 | return consumerKey; 43 | } 44 | 45 | public void setConsumerKey(String consumerKey) { 46 | this.consumerKey = consumerKey; 47 | } 48 | 49 | public String getApplicationName() { 50 | return applicationName; 51 | } 52 | 53 | public void setApplicationName(String applicationName) { 54 | this.applicationName = applicationName; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/services/FCMInstanceIdService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.services; 20 | 21 | import android.content.Intent; 22 | import android.util.Log; 23 | 24 | import com.google.firebase.iid.FirebaseInstanceId; 25 | import com.google.firebase.iid.FirebaseInstanceIdService; 26 | 27 | import org.wso2.iot.agent.utils.Constants; 28 | import org.wso2.iot.agent.utils.Preference; 29 | 30 | public class FCMInstanceIdService extends FirebaseInstanceIdService { 31 | 32 | private static final String TAG = FCMInstanceIdService.class.getSimpleName(); 33 | 34 | @Override 35 | public void onTokenRefresh() { 36 | // Get updated InstanceID token. 37 | String token = FirebaseInstanceId.getInstance().getToken(); 38 | if (Constants.DEBUG_MODE_ENABLED){ 39 | Log.d(TAG, "FCM Token: " + token); 40 | } 41 | Preference.putString(this, Constants.FCM_REG_ID, token); 42 | Intent intent = new Intent(); 43 | intent.setAction(Constants.FCM_TOKEN_REFRESHED_BROADCAST_ACTION); 44 | sendBroadcast(intent); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /client/iDPProxy/src/main/java/org/wso2/iot/agent/proxy/authenticators/AuthenticatorFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.proxy.authenticators; 20 | 21 | import org.wso2.iot.agent.proxy.IdentityProxy; 22 | import org.wso2.iot.agent.proxy.interfaces.AuthenticationCallback; 23 | 24 | /** 25 | * Creates new instances of authenticators based on the pre-configured authenticators. 26 | */ 27 | public class AuthenticatorFactory { 28 | public ClientAuthenticator getClient(String authenticatorType, AuthenticationCallback callback, 29 | int requestCode) { 30 | if (authenticatorType == null) { 31 | return null; 32 | } 33 | if (authenticatorType.equalsIgnoreCase("MUTUAL_SSL_AUTHENTICATOR")) { 34 | return new MutualSSLAuthenticator(IdentityProxy.getInstance().getContext(), callback, 35 | requestCode); 36 | } else if (authenticatorType.equalsIgnoreCase("OAUTH_AUTHENTICATOR")) { 37 | return new OAuthAuthenticator(); 38 | } 39 | 40 | return null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app-catalog/iDPProxy/src/main/java/org/wso2/emm/agent/proxy/authenticators/AuthenticatorFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.emm.agent.proxy.authenticators; 20 | 21 | import org.wso2.emm.agent.proxy.IdentityProxy; 22 | import org.wso2.emm.agent.proxy.interfaces.AuthenticationCallback; 23 | 24 | /** 25 | * Creates new instances of authenticators based on the pre-configured authenticators. 26 | */ 27 | public class AuthenticatorFactory { 28 | public ClientAuthenticator getClient(String authenticatorType, AuthenticationCallback callback, 29 | int requestCode) { 30 | if (authenticatorType == null) { 31 | return null; 32 | } 33 | if (authenticatorType.equalsIgnoreCase("MUTUAL_SSL_AUTHENTICATOR")) { 34 | return new MutualSSLAuthenticator(IdentityProxy.getInstance().getContext(), callback, 35 | requestCode); 36 | } else if (authenticatorType.equalsIgnoreCase("OAUTH_AUTHENTICATOR")) { 37 | return new OAuthAuthenticator(); 38 | } 39 | 40 | return null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app-catalog/volley/src/main/java/com/android/volley/VolleyError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley; 18 | 19 | /** 20 | * Exception style class encapsulating Volley errors 21 | */ 22 | @SuppressWarnings("serial") 23 | public class VolleyError extends Exception { 24 | public final NetworkResponse networkResponse; 25 | private long networkTimeMs; 26 | 27 | public VolleyError() { 28 | networkResponse = null; 29 | } 30 | 31 | public VolleyError(NetworkResponse response) { 32 | networkResponse = response; 33 | } 34 | 35 | public VolleyError(String exceptionMessage) { 36 | super(exceptionMessage); 37 | networkResponse = null; 38 | } 39 | 40 | public VolleyError(String exceptionMessage, Throwable reason) { 41 | super(exceptionMessage, reason); 42 | networkResponse = null; 43 | } 44 | 45 | public VolleyError(Throwable cause) { 46 | super(cause); 47 | networkResponse = null; 48 | } 49 | 50 | /* package */ void setNetworkTimeMs(long networkTimeMs) { 51 | this.networkTimeMs = networkTimeMs; 52 | } 53 | 54 | public long getNetworkTimeMs() { 55 | return networkTimeMs; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app-catalog/volley/src/test/java/com/android/volley/mock/MockCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley.mock; 18 | 19 | import com.android.volley.Cache; 20 | 21 | public class MockCache implements Cache { 22 | 23 | public boolean clearCalled = false; 24 | @Override 25 | public void clear() { 26 | clearCalled = true; 27 | } 28 | 29 | public boolean getCalled = false; 30 | private Entry mFakeEntry = null; 31 | 32 | public void setEntryToReturn(Entry entry) { 33 | mFakeEntry = entry; 34 | } 35 | 36 | @Override 37 | public Entry get(String key) { 38 | getCalled = true; 39 | return mFakeEntry; 40 | } 41 | 42 | public boolean putCalled = false; 43 | public String keyPut = null; 44 | public Entry entryPut = null; 45 | 46 | @Override 47 | public void put(String key, Entry entry) { 48 | putCalled = true; 49 | keyPut = key; 50 | entryPut = entry; 51 | } 52 | 53 | @Override 54 | public void invalidate(String key, boolean fullExpire) { 55 | } 56 | 57 | @Override 58 | public void remove(String key) { 59 | } 60 | 61 | @Override 62 | public void initialize() { 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /app-catalog/volley/src/test/java/com/android/volley/mock/MockResponseDelivery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.volley.mock; 18 | 19 | import com.android.volley.Request; 20 | import com.android.volley.Response; 21 | import com.android.volley.ResponseDelivery; 22 | import com.android.volley.VolleyError; 23 | 24 | public class MockResponseDelivery implements ResponseDelivery { 25 | 26 | public boolean postResponse_called = false; 27 | public boolean postError_called = false; 28 | 29 | public boolean wasEitherResponseCalled() { 30 | return postResponse_called || postError_called; 31 | } 32 | 33 | public Response responsePosted = null; 34 | @Override 35 | public void postResponse(Request request, Response response) { 36 | postResponse_called = true; 37 | responsePosted = response; 38 | } 39 | 40 | @Override 41 | public void postResponse(Request request, Response response, Runnable runnable) { 42 | postResponse_called = true; 43 | responsePosted = response; 44 | runnable.run(); 45 | } 46 | 47 | @Override 48 | public void postError(Request request, VolleyError error) { 49 | postError_called = true; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/beans/AppInstallRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.beans; 20 | 21 | import java.io.Serializable; 22 | 23 | /** 24 | * This class represents the App installation request information. 25 | */ 26 | public class AppInstallRequest implements Serializable { 27 | 28 | private int applicationOperationId; 29 | private String applicationOperationCode; 30 | private String appUrl; 31 | 32 | public int getApplicationOperationId() { 33 | return applicationOperationId; 34 | } 35 | 36 | public void setApplicationOperationId(int applicationOperationId) { 37 | this.applicationOperationId = applicationOperationId; 38 | } 39 | 40 | public String getApplicationOperationCode() { 41 | return applicationOperationCode; 42 | } 43 | 44 | public void setApplicationOperationCode(String applicationOperationCode) { 45 | this.applicationOperationCode = applicationOperationCode; 46 | } 47 | 48 | public String getAppUrl() { 49 | return appUrl; 50 | } 51 | 52 | public void setAppUrl(String appUrl) { 53 | this.appUrl = appUrl; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/utils/Response.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.iot.agent.utils; 19 | 20 | import org.wso2.iot.agent.R; 21 | 22 | /** 23 | * This class describes the errors and their relevant error messages 24 | * in order to internationalize the message in the resources. 25 | */ 26 | public enum Response { 27 | INCOMPATIBLE(false, R.string.device_not_compatible_error), 28 | INCOMPATIBLE_OS(false, R.string.device_not_compatible_error_os), 29 | INCOMPATIBLE_ROOT(true, R.string.device_not_compatible_error_root), 30 | ANDROID_FOR_WORK_INCOMPATIBLE(false, R.string.device_not_compatible_with_android_for_work), 31 | ANDROID_FOR_WORK_COMPATIBLE(true, R.string.device_compatible_with_android_for_work), 32 | COMPATIBLE(true, R.string.device_not_compatible_error_os); 33 | 34 | private final boolean code; 35 | private final int descriptionResourceID; 36 | 37 | private Response(boolean code, int description) { 38 | this.code = code; 39 | this.descriptionResourceID = description; 40 | } 41 | 42 | public int getDescriptionResourceID() { 43 | return descriptionResourceID; 44 | } 45 | 46 | public boolean getCode() { 47 | return code; 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/events/publisher/SplunkLogPublisher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | package org.wso2.iot.agent.events.publisher; 19 | 20 | import android.content.Context; 21 | import com.splunk.mint.Mint; 22 | import com.splunk.mint.MintLogLevel; 23 | import org.wso2.iot.agent.api.DeviceInfo; 24 | import org.wso2.iot.agent.events.beans.EventPayload; 25 | 26 | import java.util.HashMap; 27 | 28 | /** 29 | * This class handles publishing of device logs to Splunk. 30 | */ 31 | public class SplunkLogPublisher implements DataPublisher { 32 | private static final String TAG = SplunkLogPublisher.class.getName(); 33 | private static String deviceIdentifier; 34 | 35 | public SplunkLogPublisher(Context context) { 36 | DeviceInfo deviceInfo = new DeviceInfo(context); 37 | deviceIdentifier = deviceInfo.getDeviceId(); 38 | } 39 | 40 | @Override 41 | public void publish(EventPayload eventPayload) { 42 | HashMap payload = new HashMap<>(); 43 | payload.put("deviceId", deviceIdentifier); 44 | payload.put("log", eventPayload.getPayload()); 45 | Mint.logEvent("EMM Logs", MintLogLevel.Info, payload); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/beans/AppUninstallRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.beans; 20 | 21 | import java.io.Serializable; 22 | 23 | /** 24 | * This class represents the App installation request information. 25 | */ 26 | public class AppUninstallRequest implements Serializable { 27 | 28 | private int applicationOperationId; 29 | private String applicationOperationCode; 30 | private String packageName; 31 | 32 | public int getApplicationOperationId() { 33 | return applicationOperationId; 34 | } 35 | 36 | public void setApplicationOperationId(int applicationOperationId) { 37 | this.applicationOperationId = applicationOperationId; 38 | } 39 | 40 | public String getApplicationOperationCode() { 41 | return applicationOperationCode; 42 | } 43 | 44 | public void setApplicationOperationCode(String applicationOperationCode) { 45 | this.applicationOperationCode = applicationOperationCode; 46 | } 47 | 48 | public String getPackageName() { 49 | return packageName; 50 | } 51 | 52 | public void setPackageName(String packageName) { 53 | this.packageName = packageName; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /client/client/src/main/java/org/wso2/iot/agent/transport/exception/TransportHandlerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. 3 | * 4 | * WSO2 Inc. licenses this file to you under the Apache License, 5 | * Version 2.0 (the "License"); you may not use this file except 6 | * in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, 12 | * software distributed under the License is distributed on an 13 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | * KIND, either express or implied. See the License for the 15 | * specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | package org.wso2.iot.agent.transport.exception; 20 | 21 | /** 22 | * This exception will be thrown when the mqtt transport fails. 23 | */ 24 | public class TransportHandlerException extends Exception { 25 | 26 | private String errorMessage; 27 | 28 | public String getErrorMessage() { 29 | return errorMessage; 30 | } 31 | 32 | public void setErrorMessage(String errorMessage) { 33 | this.errorMessage = errorMessage; 34 | } 35 | 36 | public TransportHandlerException(String msg, Exception nestedEx) { 37 | super(msg, nestedEx); 38 | setErrorMessage(msg); 39 | } 40 | 41 | public TransportHandlerException(String message, Throwable cause) { 42 | super(message, cause); 43 | setErrorMessage(message); 44 | } 45 | 46 | public TransportHandlerException(String msg) { 47 | super(msg); 48 | setErrorMessage(msg); 49 | } 50 | 51 | public TransportHandlerException() { 52 | super(); 53 | } 54 | 55 | public TransportHandlerException(Throwable cause) { 56 | super(cause); 57 | } 58 | } 59 | --------------------------------------------------------------------------------