Log relevant stuff for some Office 365 projects
adb -s [device] logcat -s Retrofit AuthenticationContext StorageHelp TokenCacheItem HttpWebRequest Oauth BasicWebViewClient BasicWebViewClientonPageStarted MyMeetingsService eglCodecCommon:S *:s| /* | |
| * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. | |
| * Portions of this class are adapted from the AuthenticationController.java file from Microsoft Open Technologies, Inc. | |
| * located at https://github.com/OfficeDev/Office-365-SDK-for-Android/blob/master/samples/outlook/app/src/main/java/com/microsoft/services/controllers/AuthenticationController.java | |
| */ | |
| package com.microsoft.office365.connect; | |
| import android.app.Activity; | |
| import android.util.Log; |
| // Devices with API level lower than 18 must setup an encryption key. | |
| if (Build.VERSION.SDK_INT < 18 && AuthenticationSettings.INSTANCE.getSecretKeyData() == null) { | |
| AuthenticationSettings.INSTANCE.setSecretKey(generateSecretKey()); | |
| } | |
| /** | |
| * Randomly generates an encryption key for devices with API level lower than 18. | |
| * @return The encryption key in a 32 byte long array. | |
| */ | |
| protected byte[] generateSecretKey() { |
| // We're not using Microsoft Intune's Company portal app, | |
| // skip the broker check. | |
| AuthenticationSettings.INSTANCE.setSkipBroker(true); |
| /** | |
| * This activity gets notified about the completion of the ADAL activity through this method. | |
| * @param requestCode The integer request code originally supplied to startActivityForResult(), | |
| * allowing you to identify who this result came from. | |
| * @param resultCode The integer result code returned by the child activity through its | |
| * setResult(). | |
| * @param data An Intent, which can return result data to the caller (various data | |
| * can be attached to Intent "extras"). | |
| */ | |
| @Override |
| <!-- Required to connect to Office 365 --> | |
| <uses-permission android:name="android.permission.INTERNET" /> | |
| <!-- Required to use outlook services --> | |
| <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
| // base OData library: | |
| compile group: 'com.microsoft.services', name: 'odata-engine-core', version: '0.12.1' | |
| compile group: 'com.microsoft.services', name: 'odata-engine-android-impl', version: '0.12.1', ext:'aar' | |
| // choose the discovery and outlook services | |
| compile group: 'com.microsoft.services', name: 'discovery-services', version: '0.12.1' | |
| compile group: 'com.microsoft.services', name: 'outlook-services', version: '0.12.1' | |
| // Azure Active Directory Library | |
| compile group: 'com.microsoft.aad', name: 'adal', version: '1.1.1' |
| private void disconnect(){ | |
| //Clear tokens. | |
| AuthenticationManager | |
| .getInstance() | |
| .getAuthenticationContext() | |
| .getCache() | |
| .removeAll(); | |
| //Set manager objects to null. | |
| MailManager.resetInstance(); |
| /* | |
| * Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file. | |
| */ | |
| package com.microsoft.office365.profile; | |
| interface Constants { | |
| public static final String AUTHORITY_URL = "https://login.microsoftonline.com/common"; | |
| public static final String DISCOVERY_RESOURCE_URL = "https://api.office.com/discovery/v1.0/me/"; | |
| public static final String DISCOVERY_RESOURCE_ID = "https://api.office.com/discovery/"; | |
| public static final String MAIL_CAPABILITY = "Mail"; |
| bash -o igncr <script_file> |
Log relevant stuff for some Office 365 projects
adb -s [device] logcat -s Retrofit AuthenticationContext StorageHelp TokenCacheItem HttpWebRequest Oauth BasicWebViewClient BasicWebViewClientonPageStarted MyMeetingsService eglCodecCommon:S *:s