├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── needs-attention.yml │ └── stale.yml ├── .gitignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.txt ├── NOTICE.txt ├── README.md ├── SECURITY.md ├── build.gradle.kts ├── buildSrc ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── Dependencies.kt ├── facebook-applinks ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── facebook │ └── applinks │ ├── AppLinkData.java │ ├── AppLinks.java │ └── FacebookAppLinkResolver.java ├── facebook-bolts ├── build.gradle.kts ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── facebook │ │ └── bolts │ │ ├── AggregateException.kt │ │ ├── AndroidExecutors.kt │ │ ├── AppLink.kt │ │ ├── AppLinkResolver.kt │ │ ├── AppLinks.kt │ │ ├── BoltsExecutors.kt │ │ ├── CancellationToken.kt │ │ ├── CancellationTokenRegistration.kt │ │ ├── CancellationTokenSource.kt │ │ ├── Continuation.kt │ │ ├── ExecutorException.kt │ │ ├── Task.kt │ │ ├── TaskCompletionSource.kt │ │ ├── UnobservedErrorNotifier.kt │ │ └── UnobservedTaskException.kt │ └── test │ └── kotlin │ └── com │ └── facebook │ └── bolts │ ├── AggregateExceptionTest.kt │ ├── AndroidExecutorsTest.kt │ ├── AppLinkTest.kt │ ├── AppLinksTest.kt │ ├── BoltsExecutorsTest.kt │ ├── CancellationTest.kt │ ├── CancellationTokenRegistrationTest.kt │ ├── CancellationTokenSourceTest.kt │ ├── CancellationTokenTest.kt │ ├── TaskCompletionSourceTest.kt │ ├── TaskTest.kt │ └── UnobservedErrorNotifierTest.kt ├── facebook-common ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── facebook │ │ │ ├── AccessTokenTracker.kt │ │ │ ├── AuthenticationTokenTracker.kt │ │ │ ├── CustomTabActivity.kt │ │ │ ├── CustomTabMainActivity.kt │ │ │ ├── FacebookActivity.kt │ │ │ ├── FacebookAuthorizationException.kt │ │ │ ├── FacebookButtonBase.kt │ │ │ ├── FacebookCallback.kt │ │ │ ├── FacebookDialog.kt │ │ │ ├── FacebookDialogException.kt │ │ │ ├── LoginStatusCallback.kt │ │ │ ├── WebDialog.kt │ │ │ ├── common │ │ │ └── Common.kt │ │ │ ├── devicerequests │ │ │ └── internal │ │ │ │ └── DeviceRequestsHelper.kt │ │ │ ├── internal │ │ │ ├── AppCall.kt │ │ │ ├── CustomTab.kt │ │ │ ├── CustomTabUtils.kt │ │ │ ├── DialogFeature.kt │ │ │ ├── DialogPresenter.kt │ │ │ ├── FacebookDialogBase.kt │ │ │ ├── FacebookDialogFragment.kt │ │ │ ├── FacebookGamingAction.kt │ │ │ ├── FacebookWebFallbackDialog.kt │ │ │ ├── FragmentWrapper.kt │ │ │ ├── InstagramCustomTab.kt │ │ │ ├── PlatformServiceClient.kt │ │ │ ├── WebDialog.kt │ │ │ └── logging │ │ │ │ └── dumpsys │ │ │ │ └── EndToEndDumper.kt │ │ │ ├── login │ │ │ ├── CodeChallengeMethod.kt │ │ │ ├── CustomTabLoginMethodHandler.kt │ │ │ ├── CustomTabPrefetchHelper.kt │ │ │ ├── DeviceAuthDialog.kt │ │ │ ├── DeviceAuthMethodHandler.kt │ │ │ ├── GetTokenClient.kt │ │ │ ├── GetTokenLoginMethodHandler.kt │ │ │ ├── InstagramAppLoginMethodHandler.kt │ │ │ ├── KatanaProxyLoginMethodHandler.kt │ │ │ ├── LoginBehavior.kt │ │ │ ├── LoginClient.kt │ │ │ ├── LoginConfiguration.kt │ │ │ ├── LoginFragment.kt │ │ │ ├── LoginLogger.kt │ │ │ ├── LoginManager.kt │ │ │ ├── LoginMethodHandler.kt │ │ │ ├── LoginResult.kt │ │ │ ├── LoginStatusClient.kt │ │ │ ├── NativeAppLoginMethodHandler.kt │ │ │ ├── NonceUtil.kt │ │ │ ├── PKCEUtil.kt │ │ │ ├── StartActivityDelegate.kt │ │ │ ├── WebLoginMethodHandler.kt │ │ │ └── WebViewLoginMethodHandler.kt │ │ │ └── share │ │ │ ├── ShareBuilder.kt │ │ │ ├── Sharer.kt │ │ │ ├── internal │ │ │ ├── CameraEffectFeature.kt │ │ │ ├── CameraEffectJSONUtility.kt │ │ │ ├── LegacyNativeDialogParameters.kt │ │ │ ├── NativeDialogParameters.kt │ │ │ ├── ResultProcessor.kt │ │ │ ├── ShareConstants.kt │ │ │ ├── ShareContentValidation.kt │ │ │ ├── ShareDialogFeature.kt │ │ │ ├── ShareFeedContent.kt │ │ │ ├── ShareInternalUtility.kt │ │ │ ├── ShareStoryFeature.kt │ │ │ └── WebDialogParameters.kt │ │ │ ├── model │ │ │ ├── AppGroupCreationContent.kt │ │ │ ├── CameraEffectArguments.kt │ │ │ ├── CameraEffectTextures.kt │ │ │ ├── GameRequestContent.kt │ │ │ ├── ShareCameraEffectContent.kt │ │ │ ├── ShareContent.kt │ │ │ ├── ShareHashtag.kt │ │ │ ├── ShareLinkContent.kt │ │ │ ├── ShareMedia.kt │ │ │ ├── ShareMediaContent.kt │ │ │ ├── ShareMessengerActionButton.kt │ │ │ ├── ShareMessengerURLActionButton.kt │ │ │ ├── ShareModel.kt │ │ │ ├── ShareModelBuilder.kt │ │ │ ├── SharePhoto.kt │ │ │ ├── SharePhotoContent.kt │ │ │ ├── ShareStoryContent.kt │ │ │ ├── ShareVideo.kt │ │ │ └── ShareVideoContent.kt │ │ │ └── widget │ │ │ └── ShareDialog.kt │ └── res │ │ ├── color │ │ └── com_facebook_button_text_color.xml │ │ ├── drawable-hdpi │ │ ├── com_facebook_button_like_icon_selected.png │ │ └── com_facebook_close.png │ │ ├── drawable-mdpi │ │ ├── com_facebook_button_like_icon_selected.png │ │ └── com_facebook_close.png │ │ ├── drawable-xhdpi │ │ ├── com_facebook_button_like_icon_selected.png │ │ └── com_facebook_close.png │ │ ├── drawable-xxhdpi │ │ ├── com_facebook_button_like_icon_selected.png │ │ └── com_facebook_close.png │ │ ├── drawable │ │ ├── com_facebook_auth_dialog_background.xml │ │ ├── com_facebook_auth_dialog_cancel_background.xml │ │ ├── com_facebook_auth_dialog_header_background.xml │ │ ├── com_facebook_button_background.xml │ │ ├── com_facebook_button_icon.xml │ │ ├── com_facebook_button_like_background.xml │ │ └── com_facebook_favicon_blue.xml │ │ ├── layout │ │ ├── com_facebook_activity_layout.xml │ │ ├── com_facebook_device_auth_dialog_fragment.xml │ │ ├── com_facebook_login_fragment.xml │ │ └── com_facebook_smart_device_dialog_fragment.xml │ │ ├── values-af │ │ └── strings.xml │ │ ├── values-ar │ │ └── strings.xml │ │ ├── values-bn │ │ └── strings.xml │ │ ├── values-cs │ │ └── strings.xml │ │ ├── values-da │ │ └── strings.xml │ │ ├── values-de │ │ └── strings.xml │ │ ├── values-el │ │ └── strings.xml │ │ ├── values-en-rGB │ │ └── strings.xml │ │ ├── values-es-rES │ │ └── strings.xml │ │ ├── values-es │ │ └── strings.xml │ │ ├── values-fi │ │ └── strings.xml │ │ ├── values-fr-rCA │ │ └── strings.xml │ │ ├── values-fr │ │ └── strings.xml │ │ ├── values-gu │ │ └── strings.xml │ │ ├── values-hi │ │ └── strings.xml │ │ ├── values-hr │ │ └── strings.xml │ │ ├── values-hu │ │ └── strings.xml │ │ ├── values-id │ │ └── strings.xml │ │ ├── values-in │ │ └── strings.xml │ │ ├── values-it │ │ └── strings.xml │ │ ├── values-iw │ │ └── strings.xml │ │ ├── values-ja │ │ └── strings.xml │ │ ├── values-kn │ │ └── strings.xml │ │ ├── values-ko │ │ └── strings.xml │ │ ├── values-ml │ │ └── strings.xml │ │ ├── values-mr │ │ └── strings.xml │ │ ├── values-ms │ │ └── strings.xml │ │ ├── values-nb │ │ └── strings.xml │ │ ├── values-nl │ │ └── strings.xml │ │ ├── values-pa │ │ └── strings.xml │ │ ├── values-pl │ │ └── strings.xml │ │ ├── values-pt-rPT │ │ └── strings.xml │ │ ├── values-pt │ │ └── strings.xml │ │ ├── values-ro │ │ └── strings.xml │ │ ├── values-ru │ │ └── strings.xml │ │ ├── values-sk │ │ └── strings.xml │ │ ├── values-sv │ │ └── strings.xml │ │ ├── values-ta │ │ └── strings.xml │ │ ├── values-te │ │ └── strings.xml │ │ ├── values-th │ │ └── strings.xml │ │ ├── values-tl │ │ └── strings.xml │ │ ├── values-tr │ │ └── strings.xml │ │ ├── values-uk │ │ └── strings.xml │ │ ├── values-vi │ │ └── strings.xml │ │ ├── values-zh-rCN │ │ └── strings.xml │ │ ├── values-zh-rHK │ │ └── strings.xml │ │ ├── values-zh-rTW │ │ └── strings.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── kotlin │ └── com │ └── facebook │ ├── AccessTokenTrackerTest.kt │ ├── AuthenticationTokenTrackerTest.kt │ ├── CustomTabActivityTest.kt │ ├── CustomTabMainActivityTest.kt │ ├── FacebookActivityTest.kt │ ├── FacebookButtonBaseTest.kt │ ├── TestUtils.kt │ ├── devicerequests │ └── internal │ │ └── DeviceRequestsHelperTest.kt │ ├── internal │ ├── AppCallTest.kt │ ├── CustomTabTest.kt │ ├── CustomTabUtilsTest.kt │ ├── DialogPresenterTest.kt │ ├── FacebookDialogBaseTest.kt │ ├── FacebookDialogFragmentTest.kt │ ├── FacebookWebFallbackDialogTest.kt │ ├── FragmentWrapperTest.kt │ ├── InstagramCustomTabTest.kt │ ├── PlatformServiceClientTest.kt │ └── WebDialogTest.kt │ ├── login │ ├── AuthenticationTokenTestUtil.kt │ ├── CustomTabLoginMethodHandlerTest.kt │ ├── CustomTabPrefetchHelperTest.kt │ ├── DeviceAuthDialogTest.kt │ ├── DeviceAuthMethodHandlerTest.kt │ ├── GetTokenClientTest.kt │ ├── GetTokenLoginMethodHandlerTest.kt │ ├── InstagramAppLoginMethodHandlerTest.kt │ ├── KatanaProxyLoginMethodHandlerTest.kt │ ├── LoginBehaviorTest.kt │ ├── LoginClientTest.kt │ ├── LoginConfigurationTest.kt │ ├── LoginFragmentTest.kt │ ├── LoginHandlerTestCase.kt │ ├── LoginLoggerTest.kt │ ├── LoginManagerTest.kt │ ├── LoginMethodHandlerTest.kt │ ├── LoginResultTest.kt │ ├── NativeAppLoginMethodHandlerTest.kt │ ├── NonceUtilTest.kt │ ├── PKCEUtilTest.kt │ ├── WebLoginMethodHandlerTest.kt │ └── WebViewLoginMethodHandlerTest.kt │ └── share │ ├── internal │ ├── CameraEffectJSONUtilityTest.kt │ ├── LegacyNativeDialogParametersTest.kt │ ├── NativeDialogParametersTest.kt │ ├── ResultProcessorTest.kt │ ├── ShareContentValidationTest.kt │ ├── ShareFeedContentTest.kt │ ├── ShareInternalUtilityTest.kt │ └── WebDialogParametersTest.kt │ ├── model │ ├── AppGroupCreationContentTest.kt │ ├── CameraEffectArgumentsTest.kt │ ├── CameraEffectTexturesTest.kt │ ├── GameRequestContentTest.kt │ ├── ShareCameraEffectContentTest.kt │ ├── ShareContentTest.kt │ ├── ShareHashtagTest.kt │ ├── ShareLinkContentTest.kt │ ├── ShareMediaContentTest.kt │ ├── ShareMediaTest.kt │ ├── ShareMessengerActionButtonTest.kt │ ├── ShareMessengerURLActionButtonTest.kt │ ├── SharePhotoContentTest.kt │ ├── SharePhotoTest.kt │ ├── ShareStoryContentTest.kt │ ├── ShareVideoContentTest.kt │ └── ShareVideoTest.kt │ └── widget │ └── ShareDialogTest.kt ├── facebook-core ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── aidl │ │ └── com │ │ │ └── facebook │ │ │ └── ppml │ │ │ └── receiver │ │ │ └── IReceiverService.aidl │ ├── java │ │ ├── android │ │ │ └── adservices │ │ │ │ └── topics │ │ │ │ ├── GetTopicsRequest.java │ │ │ │ ├── GetTopicsResponse.java │ │ │ │ ├── Topic.java │ │ │ │ └── TopicsManager.java │ │ └── com │ │ │ └── facebook │ │ │ ├── AccessToken.kt │ │ │ ├── AccessTokenCache.kt │ │ │ ├── AccessTokenManager.kt │ │ │ ├── AccessTokenSource.kt │ │ │ ├── AuthenticationToken.kt │ │ │ ├── AuthenticationTokenCache.kt │ │ │ ├── AuthenticationTokenClaims.kt │ │ │ ├── AuthenticationTokenHeader.kt │ │ │ ├── AuthenticationTokenManager.kt │ │ │ ├── CallbackManager.kt │ │ │ ├── CurrentAccessTokenExpirationBroadcastReceiver.kt │ │ │ ├── FacebookBroadcastReceiver.kt │ │ │ ├── FacebookContentProvider.kt │ │ │ ├── FacebookException.kt │ │ │ ├── FacebookGraphResponseException.kt │ │ │ ├── FacebookOperationCanceledException.kt │ │ │ ├── FacebookRequestError.kt │ │ │ ├── FacebookSdk.kt │ │ │ ├── FacebookSdkNotInitializedException.kt │ │ │ ├── FacebookSdkVersion.kt │ │ │ ├── FacebookServiceException.kt │ │ │ ├── GraphRequest.kt │ │ │ ├── GraphRequestAsyncTask.kt │ │ │ ├── GraphRequestBatch.kt │ │ │ ├── GraphResponse.kt │ │ │ ├── HttpMethod.kt │ │ │ ├── LegacyTokenHelper.kt │ │ │ ├── LoggingBehavior.kt │ │ │ ├── Profile.kt │ │ │ ├── ProfileCache.kt │ │ │ ├── ProfileManager.kt │ │ │ ├── ProfileTracker.kt │ │ │ ├── ProgressNoopOutputStream.kt │ │ │ ├── ProgressOutputStream.kt │ │ │ ├── RequestOutputStream.kt │ │ │ ├── RequestProgress.kt │ │ │ ├── UserSettingsManager.kt │ │ │ ├── appevents │ │ │ ├── AccessTokenAppIdPair.kt │ │ │ ├── AnalyticsUserIDStore.kt │ │ │ ├── AppEvent.kt │ │ │ ├── AppEventCollection.kt │ │ │ ├── AppEventDiskStore.kt │ │ │ ├── AppEventQueue.kt │ │ │ ├── AppEventStore.kt │ │ │ ├── AppEventsConstants.kt │ │ │ ├── AppEventsLogger.kt │ │ │ ├── AppEventsLoggerImpl.kt │ │ │ ├── AppEventsManager.kt │ │ │ ├── FacebookSDKJSInterface.kt │ │ │ ├── FlushReason.kt │ │ │ ├── FlushResult.kt │ │ │ ├── FlushStatistics.kt │ │ │ ├── InternalAppEventsLogger.kt │ │ │ ├── OperationalData.kt │ │ │ ├── PersistedEvents.kt │ │ │ ├── SessionEventsState.kt │ │ │ ├── UserDataStore.kt │ │ │ ├── aam │ │ │ │ ├── MetadataIndexer.kt │ │ │ │ ├── MetadataMatcher.kt │ │ │ │ ├── MetadataRule.kt │ │ │ │ └── MetadataViewObserver.kt │ │ │ ├── cloudbridge │ │ │ │ ├── AppEventsCAPIManager.kt │ │ │ │ ├── AppEventsConversionsAPITransformer.kt │ │ │ │ └── AppEventsConversionsAPITransformerWebRequests.kt │ │ │ ├── codeless │ │ │ │ ├── CodelessLoggingEventListener.kt │ │ │ │ ├── CodelessManager.kt │ │ │ │ ├── CodelessMatcher.kt │ │ │ │ ├── RCTCodelessLoggingEventListener.kt │ │ │ │ ├── ViewIndexer.kt │ │ │ │ ├── ViewIndexingTrigger.kt │ │ │ │ └── internal │ │ │ │ │ ├── Constants.kt │ │ │ │ │ ├── EventBinding.kt │ │ │ │ │ ├── ParameterComponent.kt │ │ │ │ │ ├── PathComponent.kt │ │ │ │ │ ├── SensitiveUserDataUtils.kt │ │ │ │ │ ├── UnityReflection.kt │ │ │ │ │ └── ViewHierarchy.kt │ │ │ ├── eventdeactivation │ │ │ │ └── EventDeactivationManager.kt │ │ │ ├── gps │ │ │ │ ├── GpsDebugLogger.kt │ │ │ │ ├── ara │ │ │ │ │ └── GpsAraTriggersManager.kt │ │ │ │ ├── pa │ │ │ │ │ └── PACustomAudienceClient.kt │ │ │ │ └── topics │ │ │ │ │ ├── GpsTopicsManager.kt │ │ │ │ │ └── TopicData.kt │ │ │ ├── iap │ │ │ │ ├── InAppPurchase.kt │ │ │ │ ├── InAppPurchaseActivityLifecycleTracker.kt │ │ │ │ ├── InAppPurchaseAutoLogger.kt │ │ │ │ ├── InAppPurchaseBillingClientWrapper.kt │ │ │ │ ├── InAppPurchaseBillingClientWrapperV2V4.kt │ │ │ │ ├── InAppPurchaseBillingClientWrapperV5V7.kt │ │ │ │ ├── InAppPurchaseConstants.kt │ │ │ │ ├── InAppPurchaseDedupeConfig.kt │ │ │ │ ├── InAppPurchaseEventManager.kt │ │ │ │ ├── InAppPurchaseLoggerManager.kt │ │ │ │ ├── InAppPurchaseManager.kt │ │ │ │ ├── InAppPurchaseSkuDetailsWrapper.kt │ │ │ │ └── InAppPurchaseUtils.kt │ │ │ ├── integrity │ │ │ │ ├── BannedParamManager.kt │ │ │ │ ├── BlocklistEventsManager.kt │ │ │ │ ├── IntegrityManager.kt │ │ │ │ ├── MACARuleMatchingManager.kt │ │ │ │ ├── ProtectedModeManager.kt │ │ │ │ ├── RedactedEventsManager.kt │ │ │ │ ├── SensitiveParamsManager.kt │ │ │ │ └── StdParamsEnforcementManager.kt │ │ │ ├── internal │ │ │ │ ├── ActivityLifecycleTracker.kt │ │ │ │ ├── AppEventUtility.kt │ │ │ │ ├── AppEventsLoggerUtility.kt │ │ │ │ ├── AppLinkManager.kt │ │ │ │ ├── AutomaticAnalyticsLogger.kt │ │ │ │ ├── Constants.kt │ │ │ │ ├── FileDownloadTask.kt │ │ │ │ ├── HashUtils.kt │ │ │ │ ├── SessionInfo.kt │ │ │ │ ├── SessionLogger.kt │ │ │ │ ├── SourceApplicationInfo.kt │ │ │ │ └── ViewHierarchyConstants.kt │ │ │ ├── ml │ │ │ │ ├── MTensor.kt │ │ │ │ ├── Model.kt │ │ │ │ ├── ModelManager.kt │ │ │ │ ├── Operator.kt │ │ │ │ └── Utils.kt │ │ │ ├── ondeviceprocessing │ │ │ │ ├── OnDeviceProcessingManager.kt │ │ │ │ ├── RemoteServiceParametersHelper.kt │ │ │ │ └── RemoteServiceWrapper.kt │ │ │ ├── restrictivedatafilter │ │ │ │ └── RestrictiveDataManager.kt │ │ │ └── suggestedevents │ │ │ │ ├── FeatureExtractor.kt │ │ │ │ ├── PredictionHistoryManager.kt │ │ │ │ ├── SuggestedEventViewHierarchy.kt │ │ │ │ ├── SuggestedEventsManager.kt │ │ │ │ ├── ViewObserver.kt │ │ │ │ └── ViewOnClickListener.kt │ │ │ ├── core │ │ │ └── Core.kt │ │ │ ├── internal │ │ │ ├── AnalyticsEvents.kt │ │ │ ├── AttributionIdentifiers.kt │ │ │ ├── BoltsMeasurementEventListener.kt │ │ │ ├── BundleJSONConverter.kt │ │ │ ├── CallbackManagerImpl.kt │ │ │ ├── FacebookInitProvider.kt │ │ │ ├── FacebookRequestErrorClassification.kt │ │ │ ├── FacebookSignatureValidator.kt │ │ │ ├── FeatureManager.kt │ │ │ ├── FetchedAppGateKeepersManager.kt │ │ │ ├── FetchedAppSettings.kt │ │ │ ├── FetchedAppSettingsManager.kt │ │ │ ├── FileLruCache.kt │ │ │ ├── ImageDownloader.kt │ │ │ ├── ImageRequest.kt │ │ │ ├── ImageResponse.kt │ │ │ ├── ImageResponseCache.kt │ │ │ ├── InstallReferrerUtil.kt │ │ │ ├── InternalSettings.kt │ │ │ ├── LockOnGetVariable.kt │ │ │ ├── Logger.kt │ │ │ ├── NativeAppCallAttachmentStore.kt │ │ │ ├── NativeProtocol.kt │ │ │ ├── ProfileInformationCache.kt │ │ │ ├── ServerProtocol.kt │ │ │ ├── SmartLoginOption.kt │ │ │ ├── UrlRedirectCache.kt │ │ │ ├── Utility.kt │ │ │ ├── Validate.kt │ │ │ ├── WorkQueue.kt │ │ │ ├── gatekeeper │ │ │ │ ├── GateKeeper.kt │ │ │ │ └── GateKeeperRuntimeCache.kt │ │ │ ├── instrument │ │ │ │ ├── ExceptionAnalyzer.kt │ │ │ │ ├── InstrumentData.kt │ │ │ │ ├── InstrumentManager.kt │ │ │ │ ├── InstrumentUtility.kt │ │ │ │ ├── anrreport │ │ │ │ │ ├── ANRDetector.kt │ │ │ │ │ └── ANRHandler.kt │ │ │ │ ├── crashreport │ │ │ │ │ └── CrashHandler.kt │ │ │ │ ├── crashshield │ │ │ │ │ ├── AutoHandleExceptions.kt │ │ │ │ │ ├── CrashShieldHandler.kt │ │ │ │ │ └── NoAutoExceptionHandling.kt │ │ │ │ ├── errorreport │ │ │ │ │ ├── ErrorReportData.kt │ │ │ │ │ └── ErrorReportHandler.kt │ │ │ │ └── threadcheck │ │ │ │ │ └── ThreadCheckHandler.kt │ │ │ ├── package-info.md │ │ │ ├── qualityvalidation │ │ │ │ ├── Excuse.kt │ │ │ │ └── ExcusesForDesignViolations.kt │ │ │ └── security │ │ │ │ └── OidcSecurityUtil.kt │ │ │ └── login │ │ │ ├── DefaultAudience.kt │ │ │ └── LoginTargetApp.kt │ └── res │ │ └── xml │ │ └── ad_services_config.xml │ └── test │ └── kotlin │ └── com │ └── facebook │ ├── AccessTokenCacheTest.kt │ ├── AccessTokenManagerTest.kt │ ├── AccessTokenSourceTest.kt │ ├── AccessTokenTest.kt │ ├── AccessTokenTestHelper.kt │ ├── AuthenticationTokenCacheTest.kt │ ├── AuthenticationTokenClaimsTest.kt │ ├── AuthenticationTokenHeaderTest.kt │ ├── AuthenticationTokenManagerTest.kt │ ├── AuthenticationTokenTest.kt │ ├── CurrentAccessTokenExpirationBroadcastReceiverTest.kt │ ├── FacebookBroadcastReceiverTest.kt │ ├── FacebookContentProviderTest.kt │ ├── FacebookExceptionTest.kt │ ├── FacebookGraphResponseExceptionTest.kt │ ├── FacebookRequestErrorTest.kt │ ├── FacebookSdkTest.kt │ ├── GraphErrorTest.kt │ ├── GraphRequestAsyncTaskTest.kt │ ├── GraphRequestBatchTest.kt │ ├── GraphRequestTest.kt │ ├── GraphResponseTest.kt │ ├── LegacyTokenCacheTest.kt │ ├── LegacyTokenHelperTest.kt │ ├── ProfileCacheTest.kt │ ├── ProfileManagerTest.kt │ ├── ProfileTest.kt │ ├── ProfileTrackerTest.kt │ ├── ProgressNoopOutputStreamTest.kt │ ├── ProgressOutputStreamTest.kt │ ├── RequestProgressTest.kt │ ├── UserSettingsManagerTest.kt │ ├── appevents │ ├── AccessTokenAppIdPairTest.kt │ ├── AnalyticsUserIDStoreTest.kt │ ├── AppEventCollectionTest.kt │ ├── AppEventDiskStoreTest.kt │ ├── AppEventQueueTest.kt │ ├── AppEventStoreTest.kt │ ├── AppEventTest.kt │ ├── AppEventTestUtilities.kt │ ├── AppEventsLoggerImplTest.kt │ ├── AppEventsLoggerTest.kt │ ├── AppEventsManagerTest.kt │ ├── AutomaticAnalyticsTest.kt │ ├── FacebookSDKJSInterfaceTest.kt │ ├── InternalAppEventsLoggerTest.kt │ ├── OperationalDataTest.kt │ ├── PersistedEventsTest.kt │ ├── SessionEventsStateTest.kt │ ├── UserDataStoreTest.kt │ ├── aam │ │ ├── MetadataIndexerTest.kt │ │ ├── MetadataMatcherTest.kt │ │ ├── MetadataRuleTest.kt │ │ └── MetadataViewObserverTest.kt │ ├── cloudbridge │ │ ├── AppEventsCAPIManagerTest.kt │ │ ├── AppEventsConversionsAPITransformerTest.kt │ │ └── AppEventsConversionsAPITransformerWebRequestsTest.kt │ ├── codeless │ │ ├── CodelessLoggingEventListenerTest.kt │ │ ├── CodelessManagerTest.kt │ │ ├── CodelessMatcherTest.kt │ │ ├── CodelessTestBase.kt │ │ ├── RCTCodelessLoggingEventListenerTest.kt │ │ ├── ViewIndexerTest.kt │ │ ├── ViewIndexingTriggerTest.kt │ │ ├── ViewTrackerTest.kt │ │ └── internal │ │ │ ├── EventBindingTest.kt │ │ │ ├── ParameterComponentTest.kt │ │ │ ├── SensitiveUserDataUtilsTest.kt │ │ │ ├── UnityReflectionTest.kt │ │ │ └── ViewHierarchyTest.kt │ ├── eventdeactivation │ │ └── EventDeactivationManagerTest.kt │ ├── gps │ │ ├── ara │ │ │ └── GpsAraTriggersManagerTest.kt │ │ ├── pa │ │ │ └── PACustomAudienceClientTest.kt │ │ └── topics │ │ │ └── GpsTopicsManagerTest.kt │ ├── iap │ │ ├── InAppPurchaseActivityLifecycleTrackerTest.kt │ │ ├── InAppPurchaseAutoLoggerTest.kt │ │ ├── InAppPurchaseBillingClientWrapperV2V4Test.kt │ │ ├── InAppPurchaseBillingClientWrapperV5V7Test.kt │ │ ├── InAppPurchaseDedupeConfigTest.kt │ │ ├── InAppPurchaseEventManagerTest.kt │ │ ├── InAppPurchaseLoggerManagerTest.kt │ │ ├── InAppPurchaseManagerTest.kt │ │ ├── InAppPurchaseSkuDetailsWrapperTest.kt │ │ ├── InAppPurchaseUtilsTest.kt │ │ └── PurchasesUpdatedListener.kt │ ├── integrity │ │ ├── BannedParamsManagerTest.kt │ │ ├── BlocklistEventsManagerTest.kt │ │ ├── IntegrityManagerTest.kt │ │ ├── MACARuleMatchingManagerTest.kt │ │ ├── ProtectedModeManagerTest.kt │ │ ├── RedactedEventsManagerTest.kt │ │ ├── SensitiveParamsManagerTest.kt │ │ └── StdParamEnforcementManagerTest.kt │ ├── internal │ │ ├── ActivityLifecycleTrackerTest.kt │ │ ├── AppEventUtilityTest.kt │ │ ├── AppEventsLoggerUtilityTest.kt │ │ ├── AppLinkManagerTest.kt │ │ ├── AutomaticAnalyticsLoggerTest.kt │ │ ├── FileDownloadTaskTest.kt │ │ ├── HashUtilsTest.kt │ │ ├── SessionInfoTest.kt │ │ ├── SessionLoggerTest.kt │ │ └── SourceApplicationInfoTest.kt │ ├── ml │ │ ├── MTensorTest.kt │ │ ├── ModelManagerTest.kt │ │ ├── ModelTest.kt │ │ ├── OperatorTest.kt │ │ ├── TensorTestUtils.kt │ │ └── UtilsTest.kt │ ├── ondeviceprocessing │ │ ├── OnDeviceProcessingManagerTest.kt │ │ ├── RemoteServiceParametersHelperTest.kt │ │ └── RemoteServiceWrapperTest.kt │ ├── restrictivedatafilter │ │ └── RestrictiveDataManagerTest.kt │ └── suggestedevents │ │ ├── FeatureExtractorTest.kt │ │ ├── PredictionHistoryManagerTest.kt │ │ ├── SuggestedEventViewHierarchyTest.kt │ │ ├── SuggestedEventsManagerTest.kt │ │ ├── ViewObserverTest.kt │ │ └── ViewOnClickListenerTest.kt │ ├── internal │ ├── AttributionIdentifiersTest.kt │ ├── BoltsMeasurementEventListenerTest.kt │ ├── BundleJSONConverterTest.kt │ ├── CallbackManagerImplTest.kt │ ├── FacebookInitProviderTest.kt │ ├── FacebookRequestErrorClassificationTest.kt │ ├── FacebookSignatureValidatorTest.kt │ ├── FeatureManagerTest.kt │ ├── FetchedAppGateKeepersManagerTest.kt │ ├── FetchedAppSettingsManagerTest.kt │ ├── FetchedAppSettingsTest.kt │ ├── FileLruCacheTest.kt │ ├── ImageDownloaderTest.kt │ ├── ImageRequestTest.kt │ ├── ImageResponseCacheTest.kt │ ├── InstallReferrerUtilTest.kt │ ├── LockOnGetVariableTest.kt │ ├── LoggerTest.kt │ ├── NativeAppCallAttachmentStoreTest.kt │ ├── NativeProtocolTest.kt │ ├── ServerProtocolTest.kt │ ├── SmartLoginOptionTest.kt │ ├── UrlRedirectCacheTest.kt │ ├── UtilityTest.kt │ ├── ValidateTest.kt │ ├── WorkQueueTest.kt │ ├── gatekeeper │ │ └── GateKeeperRuntimeCacheTest.kt │ ├── instrument │ │ ├── ExceptionAnalyzerTest.kt │ │ ├── InstrumentDataTest.kt │ │ ├── InstrumentManagerTest.kt │ │ ├── InstrumentUtilityTest.kt │ │ ├── anrreport │ │ │ ├── ANRDetectorTest.kt │ │ │ └── ANRHandlerTest.kt │ │ ├── crashreport │ │ │ └── CrashHandlerTest.kt │ │ ├── crashshield │ │ │ ├── CrashShieldHandlerDebugTest.kt │ │ │ └── CrashShieldHandlerTest.kt │ │ ├── errorreport │ │ │ ├── ErrorReportDataTest.kt │ │ │ └── ErrorReportHandlerTest.kt │ │ └── threadcheck │ │ │ └── ThreadCheckHandlerTest.kt │ └── security │ │ └── OidcSecurityUtilTest.kt │ ├── login │ └── LoginTargetAppTest.kt │ └── util │ └── common │ ├── AuthenticationTokenTestUtil.kt │ └── ProfileTestHelper.kt ├── facebook-gamingservices ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── facebook │ │ └── gamingservices │ │ ├── ContextChooseDialog.kt │ │ ├── ContextCreateDialog.kt │ │ ├── ContextSwitchDialog.kt │ │ ├── CustomUpdate.kt │ │ ├── FriendFinderDialog.java │ │ ├── GameRequestDialog.java │ │ ├── GamingContext.kt │ │ ├── GamingGroupIntegration.java │ │ ├── GamingImageUploader.java │ │ ├── GamingPayload.java │ │ ├── GamingServices.kt │ │ ├── GamingVideoUploader.java │ │ ├── OpenGamingMediaDialog.java │ │ ├── Tournament.kt │ │ ├── TournamentConfig.kt │ │ ├── TournamentFetcher.kt │ │ ├── TournamentJoinDialog.kt │ │ ├── TournamentShareDialog.kt │ │ ├── TournamentUpdater.kt │ │ ├── cloudgaming │ │ ├── AppToUserNotificationSender.java │ │ ├── CloudGameLoginHandler.java │ │ ├── DaemonReceiver.java │ │ ├── DaemonRequest.java │ │ ├── GameFeaturesLibrary.java │ │ ├── InAppAdLibrary.java │ │ ├── InAppPurchaseLibrary.java │ │ ├── PlayableAdsLibrary.java │ │ └── internal │ │ │ ├── SDKAnalyticsEvents.java │ │ │ ├── SDKConstants.java │ │ │ ├── SDKLogger.java │ │ │ ├── SDKMessageEnum.java │ │ │ └── SDKShareIntentEnum.java │ │ ├── internal │ │ ├── DateFormatter.kt │ │ ├── GamingMediaUploader.kt │ │ ├── TournamentJoinDialogURIBuilder.kt │ │ ├── TournamentScoreType.kt │ │ ├── TournamentShareDialogURIBuilder.kt │ │ └── TournamentSortOrder.kt │ │ └── model │ │ ├── ContextChooseContent.kt │ │ ├── ContextCreateContent.kt │ │ ├── ContextSwitchContent.kt │ │ └── CustomUpdateContent.kt │ └── test │ └── kotlin │ └── com │ └── facebook │ ├── CustomUpdateContentTest.kt │ └── TournamentJoinDialogURIBuilderTest.kt ├── facebook-login ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── facebook │ │ └── login │ │ ├── DeviceLoginManager.kt │ │ ├── Login.kt │ │ └── widget │ │ ├── DeviceLoginButton.kt │ │ ├── LoginButton.kt │ │ ├── ProfilePictureView.kt │ │ └── ToolTipPopup.kt │ └── res │ ├── drawable-hdpi │ ├── com_facebook_tooltip_black_background.9.png │ ├── com_facebook_tooltip_black_bottomnub.png │ ├── com_facebook_tooltip_black_topnub.png │ ├── com_facebook_tooltip_black_xout.png │ ├── com_facebook_tooltip_blue_background.9.png │ ├── com_facebook_tooltip_blue_bottomnub.png │ ├── com_facebook_tooltip_blue_topnub.png │ └── com_facebook_tooltip_blue_xout.png │ ├── drawable-mdpi │ ├── com_facebook_profile_picture_blank_portrait.png │ ├── com_facebook_profile_picture_blank_square.png │ ├── com_facebook_tooltip_black_background.9.png │ ├── com_facebook_tooltip_black_bottomnub.png │ ├── com_facebook_tooltip_black_topnub.png │ ├── com_facebook_tooltip_black_xout.png │ ├── com_facebook_tooltip_blue_background.9.png │ ├── com_facebook_tooltip_blue_bottomnub.png │ ├── com_facebook_tooltip_blue_topnub.png │ └── com_facebook_tooltip_blue_xout.png │ ├── drawable-xhdpi │ ├── com_facebook_tooltip_black_background.9.png │ ├── com_facebook_tooltip_black_bottomnub.png │ ├── com_facebook_tooltip_black_topnub.png │ ├── com_facebook_tooltip_black_xout.png │ ├── com_facebook_tooltip_blue_background.9.png │ ├── com_facebook_tooltip_blue_bottomnub.png │ ├── com_facebook_tooltip_blue_topnub.png │ └── com_facebook_tooltip_blue_xout.png │ ├── layout │ └── com_facebook_tooltip_bubble.xml │ ├── values-af │ └── strings.xml │ ├── values-ar │ └── strings.xml │ ├── values-bn │ └── strings.xml │ ├── values-cs │ └── strings.xml │ ├── values-da │ └── strings.xml │ ├── values-de │ └── strings.xml │ ├── values-el │ └── strings.xml │ ├── values-en-rGB │ └── strings.xml │ ├── values-es-rES │ └── strings.xml │ ├── values-es │ └── strings.xml │ ├── values-fi │ └── strings.xml │ ├── values-fr-rCA │ └── strings.xml │ ├── values-fr │ └── strings.xml │ ├── values-gu │ └── strings.xml │ ├── values-hi │ └── strings.xml │ ├── values-hr │ └── strings.xml │ ├── values-hu │ └── strings.xml │ ├── values-in │ └── strings.xml │ ├── values-it │ └── strings.xml │ ├── values-iw │ └── strings.xml │ ├── values-ja │ └── strings.xml │ ├── values-kn │ └── strings.xml │ ├── values-ko │ └── strings.xml │ ├── values-ml │ └── strings.xml │ ├── values-mr │ └── strings.xml │ ├── values-ms │ └── strings.xml │ ├── values-nb │ └── strings.xml │ ├── values-nl │ └── strings.xml │ ├── values-pa │ └── strings.xml │ ├── values-pl │ └── strings.xml │ ├── values-pt-rPT │ └── strings.xml │ ├── values-pt │ └── strings.xml │ ├── values-ro │ └── strings.xml │ ├── values-ru │ └── strings.xml │ ├── values-sk │ └── strings.xml │ ├── values-sv │ └── strings.xml │ ├── values-ta │ └── strings.xml │ ├── values-te │ └── strings.xml │ ├── values-th │ └── strings.xml │ ├── values-tl │ └── strings.xml │ ├── values-tr │ └── strings.xml │ ├── values-uk │ └── strings.xml │ ├── values-vi │ └── strings.xml │ ├── values-zh-rCN │ └── strings.xml │ ├── values-zh-rHK │ └── strings.xml │ ├── values-zh-rTW │ └── strings.xml │ └── values │ ├── attrs.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── facebook-messenger ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── facebook │ │ └── messenger │ │ ├── Messenger.kt │ │ ├── MessengerThreadParams.kt │ │ ├── MessengerUtils.kt │ │ ├── ShareToMessengerParams.kt │ │ └── ShareToMessengerParamsBuilder.java │ └── res │ ├── drawable-hdpi │ ├── messenger_bubble_large_blue.png │ ├── messenger_bubble_large_white.png │ ├── messenger_bubble_small_blue.png │ ├── messenger_bubble_small_white.png │ └── messenger_button_send_round_shadow.png │ ├── drawable-mdpi │ ├── messenger_bubble_large_blue.png │ ├── messenger_bubble_large_white.png │ ├── messenger_bubble_small_blue.png │ ├── messenger_bubble_small_white.png │ └── messenger_button_send_round_shadow.png │ ├── drawable-xhdpi │ ├── messenger_bubble_large_blue.png │ ├── messenger_bubble_large_white.png │ ├── messenger_bubble_small_blue.png │ ├── messenger_bubble_small_white.png │ └── messenger_button_send_round_shadow.png │ ├── drawable-xxhdpi │ ├── messenger_bubble_large_blue.png │ ├── messenger_bubble_large_white.png │ ├── messenger_bubble_small_blue.png │ ├── messenger_bubble_small_white.png │ └── messenger_button_send_round_shadow.png │ ├── drawable │ ├── messenger_button_blue_bg_round.xml │ ├── messenger_button_blue_bg_selector.xml │ ├── messenger_button_white_bg_round.xml │ └── messenger_button_white_bg_selector.xml │ ├── layout │ ├── messenger_button_send_blue_large.xml │ ├── messenger_button_send_blue_round.xml │ ├── messenger_button_send_blue_small.xml │ ├── messenger_button_send_white_large.xml │ ├── messenger_button_send_white_round.xml │ └── messenger_button_send_white_small.xml │ └── values │ ├── messenger_button_strings.xml │ └── messenger_button_styles.xml ├── facebook-share ├── .gitignore ├── build.gradle.kts ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── facebook │ │ ├── internal │ │ ├── CollectionMapper.java │ │ └── Mutable.java │ │ └── share │ │ ├── Share.kt │ │ ├── ShareApi.java │ │ ├── internal │ │ ├── GameRequestValidation.java │ │ ├── MessageDialogFeature.java │ │ └── VideoUploader.java │ │ └── widget │ │ ├── GameRequestDialog.java │ │ ├── MessageDialog.java │ │ ├── SendButton.java │ │ ├── ShareButton.java │ │ └── ShareButtonBase.java │ └── res │ ├── color │ └── com_facebook_send_button_text_color.xml │ ├── drawable-hdpi │ ├── com_facebook_button_send_icon_blue.png │ └── com_facebook_button_send_icon_white.png │ ├── drawable-mdpi │ ├── com_facebook_button_send_icon_blue.png │ └── com_facebook_button_send_icon_white.png │ ├── drawable-xhdpi │ ├── com_facebook_button_send_icon_blue.png │ └── com_facebook_button_send_icon_white.png │ ├── drawable-xxhdpi │ └── com_facebook_button_send_icon_white.png │ ├── drawable │ ├── com_facebook_button_send_background.xml │ └── com_facebook_send_button_icon.xml │ └── values │ └── styles.xml ├── facebook-testutil ├── build.gradle.kts └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ ├── com │ └── facebook │ │ ├── FacebookPowerMockTestCase.kt │ │ ├── FacebookTestCase.kt │ │ ├── FacebookTestUtility.kt │ │ ├── MockSharedPreference.kt │ │ └── util │ │ └── common │ │ ├── CaptureExecutor.kt │ │ └── TestHelpers.kt │ └── org │ └── mockito │ └── configuration │ └── MockitoConfiguration.kt ├── facebook ├── build.gradle.kts ├── lint.xml ├── proguard-project.txt └── src │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── facebook │ │ └── all │ │ └── All.kt │ └── test │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── facebook │ │ ├── ErrorClassificationTest.kt │ │ ├── FacebookFuzzyInputPowerMockTestCase.java │ │ ├── LoadAppSettingsFuzzyTest.java │ │ ├── PowerMockIntegrationTest.kt │ │ ├── TestUtils.kt │ │ ├── applinks │ │ └── AppLinkDataTest.java │ │ ├── internal │ │ ├── JsonUtil.kt │ │ └── JsonUtilTest.kt │ │ └── messenger │ │ └── MessengerUtilsTest.kt │ └── resources │ ├── drawable-hdpi │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── layout │ └── activity_main.xml │ ├── menu │ └── menu_main.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jacoco.gradle.kts ├── maven.gradle ├── samples ├── FBLoginSample │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── facebook │ │ │ └── fbloginsample │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── facebook │ │ │ │ └── fbloginsample │ │ │ │ ├── FBLoginSampleApp.kt │ │ │ │ ├── FacebookLoginActivity.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── PermissionsActivity.kt │ │ │ │ ├── PostFeedActivity.kt │ │ │ │ ├── ProfileActivity.kt │ │ │ │ ├── Util.kt │ │ │ │ ├── adapters │ │ │ │ └── PostAdapter.kt │ │ │ │ ├── callbacks │ │ │ │ ├── GetPostsCallback.kt │ │ │ │ ├── GetUserCallback.kt │ │ │ │ ├── PermissionCallback.kt │ │ │ │ └── PublishPostCallback.kt │ │ │ │ ├── entities │ │ │ │ ├── Post.kt │ │ │ │ └── User.kt │ │ │ │ └── requests │ │ │ │ ├── PermissionRequest.kt │ │ │ │ ├── PostsRequest.kt │ │ │ │ └── UserRequest.kt │ │ └── res │ │ │ ├── drawable │ │ │ └── placeholder.jpg │ │ │ ├── layout │ │ │ ├── activity_facebook_login.xml │ │ │ ├── activity_main.xml │ │ │ ├── activity_permissions.xml │ │ │ ├── activity_post_feed.xml │ │ │ ├── activity_profile.xml │ │ │ └── news_feed_item.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── facebook │ │ └── fbloginsample │ │ └── ExampleUnitTest.kt ├── HelloFacebookSample │ ├── AndroidManifest.xml │ ├── build.gradle │ ├── proguard-project.txt │ ├── res │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-mdpi │ │ │ └── icon.png │ │ ├── drawable-xhdpi │ │ │ └── icon.png │ │ ├── drawable │ │ │ └── icon.png │ │ ├── layout │ │ │ └── main.xml │ │ └── values │ │ │ └── strings.xml │ └── src │ │ └── com │ │ └── example │ │ └── hellofacebook │ │ ├── HelloFacebookBroadcastReceiver.kt │ │ └── HelloFacebookSampleActivity.java └── KotlinSampleApp │ ├── AndroidManifest.xml │ ├── README.md │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── ic_launcher-playstore.png │ ├── proguard-rules.pro │ ├── res │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ ├── drawable │ │ ├── black.png │ │ ├── green.png │ │ ├── red.png │ │ └── user_picture_placeholder.jpg │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ │ └── ic_launcher_foreground.png │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_foreground.png │ │ └── ic_launcher_round.png │ ├── raw │ │ └── test.mp4 │ └── values │ │ ├── ic_launcher_background.xml │ │ └── strings.xml │ ├── settings.gradle │ └── src │ └── com │ └── facebook │ └── samples │ └── kotlinsampleapp │ ├── App.kt │ ├── MainActivity.kt │ ├── SampleApplication.kt │ ├── appevents │ └── AppEventsScreen.kt │ ├── common │ └── MenuItem.kt │ ├── home │ ├── HomeScreen.kt │ ├── HomeViewModel.kt │ └── ProfileView.kt │ ├── login │ └── LoginMenuScreen.kt │ └── sharing │ ├── Sharing.kt │ └── SharingScreen.kt ├── scripts ├── build_documentation.sh ├── build_fbsdk_documentation.sh ├── cleanup_code_formatting.sh ├── configure_unit_tests.sh └── fix_copyright_headers.sh ├── secring.gpg.enc └── settings.gradle.kts /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Facebook Developer Support 4 | url: https://developers.facebook.com/support/ 5 | about: This issue tracker is not for support questsions and platform bugs. Please go to Facebook Developer Support for rasing these questions. 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: Tell us something you want to see in this project 3 | labels: enhancement,needs-triage 4 | title: "Feature Request: " 5 | body: 6 | - type: checkboxes 7 | attributes: 8 | label: Checklist before submitting a feature request 9 | options: 10 | - label: "I've updated to the latest released version of the SDK" 11 | required: true 12 | - label: "I've searched for existing [Github issues](https://github.com/facebook/facebook-android-sdk/issues)" 13 | required: true 14 | - label: "I've read the [Code of Conduct](CODE_OF_CONDUCT.md)" 15 | required: true 16 | - type: textarea 17 | id: goals 18 | attributes: 19 | label: Goals 20 | description: "What do you want to achieve?" 21 | validations: 22 | required: true 23 | - type: textarea 24 | id: expected 25 | attributes: 26 | label: Expected results 27 | description: "What do you expect to happen?" 28 | validations: 29 | required: true 30 | - type: textarea 31 | id: code-samples 32 | attributes: 33 | label: Code samples & details 34 | description: "Please provide a code sample, as well as any additional details, to help us track down the issue. If you can provide a link to a test project that allows us to reproduce the issue, this helps us immensely in both the speed and quality of the feature request. 35 | **Note:** Remember to format your code for readability. 36 | " 37 | value: "// INSERT YOUR CODE HERE" 38 | render: java 39 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thanks for proposing a pull request! 2 | 3 | To help us review the request, please complete the following: 4 | 5 | - [ ] sign [contributor license agreement](https://developers.facebook.com/opensource/cla) 6 | - [ ] I've ensured that all existing tests pass and added tests (when/where necessary) 7 | - [ ] I've updated the documentation (when/where necessary) and [Changelog](CHANGELOG.md) (when/where necessary) 8 | - [ ] I've added the proper label to this pull request (e.g. `bug` for bug fixes) 9 | 10 | ## Pull Request Details 11 | 12 | Describe what you accomplished in this pull request (for example, what happens before the change, and after the change) 13 | 14 | ## Test Plan 15 | 16 | Test Plan: **Add your test plan here** 17 | -------------------------------------------------------------------------------- /.github/workflows/needs-attention.yml: -------------------------------------------------------------------------------- 1 | name: Issue Needs Attention 2 | # This workflow is triggered on issue comments. 3 | on: 4 | issue_comment: 5 | types: created 6 | 7 | jobs: 8 | applyNeedsAttentionLabel: 9 | name: Apply Needs Attention Label 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - name: Apply Needs Attention Label 14 | uses: hramos/needs-attention@v1 15 | with: 16 | repo-token: ${{ secrets.GITHUB_TOKEN }} 17 | response-required-label: 'waiting-for-response' 18 | needs-attention-label: 'needs-triage' 19 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: 'Close stale issues and PRs' 2 | on: 3 | schedule: 4 | - cron: '30 5 * * *' 5 | 6 | jobs: 7 | stale: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/stale@v4 11 | with: 12 | close-issue-message: 'Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.' 13 | stale-issue-message: 'Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.' 14 | days-before-stale: 90 15 | days-before-close: 7 16 | enable-statistics: true 17 | operations-per-run: 60 18 | exempt-issue-labels: 'acknowledged,needs-triage' 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.aar 4 | *.ap_ 5 | *.aab 6 | 7 | # Files for the ART/Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | out/ 17 | jacoco.exec 18 | 19 | # Gradle files 20 | .gradle/ 21 | build/ 22 | 23 | # Local configuration file (sdk path, etc) 24 | local.properties 25 | local.gradle 26 | 27 | # Proguard folder generated by Eclipse 28 | proguard/ 29 | 30 | # Log Files 31 | *.log 32 | *.ipr 33 | *.iws 34 | .idea/ 35 | 36 | # Android Studio Navigation editor temp files 37 | .navigation/ 38 | 39 | # Android Studio captures folder 40 | .gradle 41 | captures/ 42 | 43 | # Android Studio output 44 | BUCK* 45 | .buckconfig 46 | .buck-java11 47 | keystores/ 48 | /buck-cache/ 49 | /buck-out/ 50 | /.buckconfig.local 51 | /.buckd 52 | /.nobuckcheck 53 | output.json 54 | 55 | # IntelliJ 56 | *.iml 57 | .idea/ 58 | misc.xml 59 | deploymentTargetDropDown.xml 60 | render.experimental.xml 61 | 62 | # External native build folder generated in Android Studio 2.2 and later 63 | .externalNativeBuild 64 | .cxx/ 65 | out/ 66 | facebook/doc/ 67 | facebook/tests/lint.xml 68 | facebook/src/androidTest/assets/config.json 69 | gradle-app.setting 70 | 71 | # lint 72 | lint/intermediates/ 73 | lint/generated/ 74 | lint/outputs/ 75 | lint/tmp/ 76 | 77 | # MacOS 78 | .DS_Store 79 | 80 | # Keystore files 81 | *.jks 82 | *.keystore 83 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Facebook welcomes contributions to our SDKs. 2 | 3 | All contributors must sign a CLA (contributor license agreement) here: 4 | 5 | https://code.facebook.com/cla 6 | 7 | To contribute on behalf of your employer, sign the company CLA. 8 | 9 | To contribute on behalf of yourself, sign the individual CLA. 10 | 11 | All contributions: 12 | 13 | 1. MUST be licensed using the Apache License, Version 2.0 14 | 2. Authors MAY retain copyright by adding their copyright notice to the appropriate files 15 | 16 | More information on the Apache License can be found here: http://www.apache.org/foundation/license-faq.html 17 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. 2 | 3 | You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | copy, modify, and distribute this software in source code or binary form for use 5 | in connection with the web services and APIs provided by Facebook. 6 | 7 | As with any software that integrates with the Facebook platform, your use of 8 | this software is subject to the Facebook Platform Policy 9 | [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | included in all copies or substantial portions of the software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | Please do not open GitHub issues or pull requests - this makes the problem immediately visible to everyone, including malicious actors. Security issues in the SDK can be safely reported via Facebook's Whitehat Bug Bounty program: 4 | 5 | [facebook.com/whitehat](https://www.facebook.com/whitehat) 6 | 7 | Facebook's security team will triage your report and determine whether or not is it eligible for a bounty under our program. 8 | -------------------------------------------------------------------------------- /build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 10 | 11 | buildscript { 12 | repositories { 13 | maven { url = uri("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") } 14 | mavenCentral() 15 | google() 16 | } 17 | 18 | dependencies { 19 | classpath(Plugins.android_gradle) 20 | classpath(Plugins.kotlin_gradle) 21 | classpath(Plugins.dokka) 22 | classpath(Plugins.jacoco) 23 | } 24 | } 25 | 26 | allprojects { 27 | repositories { 28 | mavenCentral() 29 | google() 30 | maven { url = uri("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") } 31 | maven { url = uri("https://jitpack.io") } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /buildSrc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | 10 | @file:Suppress("UnstableApiUsage") 11 | plugins { 12 | `kotlin-dsl` 13 | } 14 | 15 | repositories { mavenCentral() } 16 | -------------------------------------------------------------------------------- /facebook-applinks/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /facebook-applinks/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /facebook-applinks/src/main/java/com/facebook/applinks/AppLinks.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.applinks; 10 | 11 | public final class AppLinks { 12 | 13 | private AppLinks() {} 14 | } 15 | -------------------------------------------------------------------------------- /facebook-bolts/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | # To enable ProGuard in your project, edit project.properties 8 | # to define the proguard.config property as described in that file. 9 | # 10 | # Add project specific ProGuard rules here. 11 | # By default, the flags in this file are appended to flags specified 12 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 13 | # You can edit the include path and order by changing the ProGuard 14 | # include property in project.properties. 15 | # 16 | # For more details, see 17 | # http://developer.android.com/guide/developing/tools/proguard.html 18 | 19 | # Add any project specific keep options here: 20 | 21 | # If your project uses WebView with JS, uncomment the following 22 | # and specify the fully qualified class name to the JavaScript interface 23 | # class: 24 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 25 | # public *; 26 | #} 27 | 28 | -keepclassmembers class * implements java.io.Serializable { 29 | private static final java.io.ObjectStreamField[] serialPersistentFields; 30 | private void writeObject(java.io.ObjectOutputStream); 31 | private void readObject(java.io.ObjectInputStream); 32 | java.lang.Object writeReplace(); 33 | java.lang.Object readResolve(); 34 | } 35 | -------------------------------------------------------------------------------- /facebook-bolts/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /facebook-bolts/src/main/java/com/facebook/bolts/AppLinkResolver.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.bolts 10 | 11 | import android.net.Uri 12 | 13 | /** 14 | * Implement this interface to provide an alternate strategy for resolving App Links that may 15 | * include pre-fetching, caching, or querying for App Link data from an index provided by a service 16 | * provider. 17 | */ 18 | fun interface AppLinkResolver { 19 | /** 20 | * Asynchronously resolves App Link data for a given URL. 21 | * 22 | * @param url the URL to resolve into an App Link. 23 | * @return the [AppLink] for the given URL. 24 | */ 25 | fun getAppLinkFromUrlInBackground(url: Uri): Task 26 | } 27 | -------------------------------------------------------------------------------- /facebook-bolts/src/main/java/com/facebook/bolts/CancellationTokenRegistration.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.bolts 10 | 11 | import java.io.Closeable 12 | 13 | /** 14 | * Represents a callback delegate that has been registered with a [CancellationToken]. 15 | * 16 | * @see CancellationToken.register 17 | */ 18 | class CancellationTokenRegistration 19 | internal constructor(tokenSource: CancellationTokenSource, private var action: Runnable?) : 20 | Closeable { 21 | private var closed = false 22 | private var tokenSource: CancellationTokenSource? = tokenSource 23 | 24 | /** Unregisters the callback runnable from the cancellation token. */ 25 | override fun close() { 26 | synchronized(this) { 27 | if (closed) { 28 | return 29 | } 30 | closed = true 31 | tokenSource?.unregister(this) 32 | tokenSource = null 33 | action = null 34 | } 35 | } 36 | 37 | internal fun runAction() { 38 | synchronized(this) { 39 | throwIfClosed() 40 | action?.run() 41 | close() 42 | } 43 | } 44 | 45 | private fun throwIfClosed() { 46 | check(!closed) { "Object already closed" } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /facebook-bolts/src/main/java/com/facebook/bolts/Continuation.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.bolts 10 | 11 | /** 12 | * A function to be called after a task completes. 13 | * 14 | * If you wish to have the Task from a Continuation that does not return a Task be cancelled then 15 | * throw a [java.util.concurrent.CancellationException] from the Continuation. 16 | * 17 | * @see Task 18 | */ 19 | fun interface Continuation { 20 | /** 21 | * The function to be called when the task in the parameter is competed. 22 | * 23 | * @param task the completed task. See [Task.continueWith] for more details. 24 | * @return a nullable result of this function. 25 | */ 26 | @Throws(Exception::class) fun then(task: Task): TContinuationResult? 27 | } 28 | -------------------------------------------------------------------------------- /facebook-bolts/src/main/java/com/facebook/bolts/ExecutorException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.bolts 10 | 11 | /** 12 | * This is a wrapper class for emphasizing that task failed due to bad `Executor`, rather than the 13 | * continuation block it self. 14 | */ 15 | class ExecutorException(e: Exception) : 16 | RuntimeException("An exception was thrown by an Executor", e) 17 | -------------------------------------------------------------------------------- /facebook-bolts/src/main/java/com/facebook/bolts/UnobservedErrorNotifier.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.bolts 10 | 11 | import androidx.annotation.VisibleForTesting 12 | 13 | /** 14 | * This class is used to retain a faulted task until either its error is observed or it is 15 | * finalized. If it is finalized with a task, then the uncaught exception handler is executed with 16 | * an UnobservedTaskException. 17 | */ 18 | internal class UnobservedErrorNotifier(private var task: Task<*>?) { 19 | @VisibleForTesting(otherwise = VisibleForTesting.PROTECTED) 20 | fun finalize() { 21 | val faultedTask = task 22 | if (faultedTask != null) { 23 | val ueh = Task.getUnobservedExceptionHandler() 24 | ueh?.unobservedException(faultedTask, UnobservedTaskException(faultedTask.error)) 25 | } 26 | } 27 | 28 | fun setObserved() { 29 | task = null 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /facebook-bolts/src/main/java/com/facebook/bolts/UnobservedTaskException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.bolts 10 | 11 | import java.lang.RuntimeException 12 | 13 | /** Used to signify that a Task's error went unobserved. */ 14 | class UnobservedTaskException(cause: Throwable?) : RuntimeException(cause) 15 | -------------------------------------------------------------------------------- /facebook-bolts/src/test/kotlin/com/facebook/bolts/AppLinkTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.bolts 10 | 11 | import com.facebook.FacebookPowerMockTestCase 12 | import org.assertj.core.api.Assertions.assertThat 13 | import org.junit.Test 14 | import org.mockito.kotlin.mock 15 | 16 | class AppLinkTest : FacebookPowerMockTestCase() { 17 | @Test 18 | fun `test constructor with null targets`() { 19 | val appLink = AppLink(mock(), null, mock()) 20 | assertThat(appLink.targets).isEmpty() 21 | } 22 | 23 | @Test(expected = UnsupportedOperationException::class) 24 | fun `test targets getter return an unmodifiable copy`() { 25 | val targets = arrayListOf(mock(), mock()) 26 | val appLink = AppLink(mock(), targets, mock()) 27 | val gotTargets = appLink.targets as MutableList 28 | gotTargets.removeAt(0) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /facebook-bolts/src/test/kotlin/com/facebook/bolts/AppLinksTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.bolts 10 | 11 | import android.content.Intent 12 | import android.os.Bundle 13 | import com.facebook.FacebookTestCase 14 | import org.assertj.core.api.Assertions.assertThat 15 | import org.junit.Test 16 | 17 | class AppLinksTest : FacebookTestCase() { 18 | companion object { 19 | private const val TEST_KEY = "test key" 20 | private const val TEST_DATA = "test value" 21 | } 22 | 23 | @Test 24 | fun `test get app link data`() { 25 | val intent = Intent() 26 | val bundle = Bundle() 27 | val extraBundle = Bundle() 28 | extraBundle.putString(TEST_KEY, TEST_DATA) 29 | bundle.putBundle(AppLinks.KEY_NAME_EXTRAS, extraBundle) 30 | intent.putExtra(AppLinks.KEY_NAME_APPLINK_DATA, bundle) 31 | 32 | assertThat(AppLinks.getAppLinkData(intent)).isEqualTo(bundle) 33 | assertThat(AppLinks.getAppLinkExtras(intent)?.getString(TEST_KEY)).isEqualTo(TEST_DATA) 34 | } 35 | 36 | @Test 37 | fun `test empty intent won't crash`() { 38 | val intent = Intent() 39 | assertThat(AppLinks.getAppLinkExtras(intent)).isNull() 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /facebook-bolts/src/test/kotlin/com/facebook/bolts/CancellationTokenTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.bolts 10 | 11 | import com.facebook.FacebookPowerMockTestCase 12 | import org.assertj.core.api.Assertions.assertThat 13 | import org.junit.Test 14 | import org.mockito.kotlin.mock 15 | import org.mockito.kotlin.verify 16 | import org.mockito.kotlin.whenever 17 | 18 | class CancellationTokenTest : FacebookPowerMockTestCase() { 19 | private lateinit var mockCancellationTokenSource: CancellationTokenSource 20 | override fun setup() { 21 | mockCancellationTokenSource = mock() 22 | } 23 | 24 | @Test 25 | fun `test register action on cancellation token`() { 26 | val token = CancellationToken(mockCancellationTokenSource) 27 | val mockAction = mock() 28 | token.register(mockAction) 29 | verify(mockCancellationTokenSource).register(mockAction) 30 | } 31 | 32 | @Test 33 | fun `test checking cancel status`() { 34 | val token = CancellationToken(mockCancellationTokenSource) 35 | whenever(mockCancellationTokenSource.isCancellationRequested).thenReturn(false) 36 | assertThat(token.isCancellationRequested).isFalse 37 | whenever(mockCancellationTokenSource.isCancellationRequested).thenReturn(true) 38 | assertThat(token.isCancellationRequested).isTrue 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /facebook-common/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/FacebookAuthorizationException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | /** An Exception indicating that Login failed. */ 12 | class FacebookAuthorizationException : FacebookException { 13 | /** Constructs a FacebookAuthorizationException with no additional information. */ 14 | constructor() : super() {} 15 | 16 | /** 17 | * Constructs a FacebookAuthorizationException with a message. 18 | * 19 | * @param message A String to be returned from getMessage. 20 | */ 21 | constructor(message: String?) : super(message) {} 22 | 23 | /** 24 | * Constructs a FacebookAuthorizationException with a message and inner error. 25 | * 26 | * @param message A String to be returned from getMessage. 27 | * @param throwable A Throwable to be returned from getCause. 28 | */ 29 | constructor(message: String?, throwable: Throwable?) : super(message, throwable) {} 30 | 31 | /** 32 | * Constructs a FacebookAuthorizationException with an inner error. 33 | * 34 | * @param throwable A Throwable to be returned from getCause. 35 | */ 36 | constructor(throwable: Throwable?) : super(throwable) {} 37 | 38 | companion object { 39 | const val serialVersionUID: Long = 1 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/FacebookCallback.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | /** A callback class for the Facebook SDK. */ 12 | interface FacebookCallback { 13 | /** 14 | * Called when the dialog completes without error. 15 | * 16 | * Note: This will be called instead of [.onCancel] if any of the following conditions are true. 17 | * 18 | * * [com.facebook.share.widget.MessageDialog] is used. 19 | * * The logged in Facebook user has not authorized the app that has initiated the dialog. 20 | * 21 | * @param result Result from the dialog 22 | */ 23 | fun onSuccess(result: RESULT) 24 | 25 | /** 26 | * Called when the dialog is canceled. 27 | * 28 | * Note: [.onSuccess] will be called instead if any of the following conditions are true. 29 | * 30 | * * [com.facebook.share.widget.MessageDialog] is used. 31 | * * The logged in Facebook user has not authorized the app that has initiated the dialog. 32 | */ 33 | fun onCancel() 34 | 35 | /** 36 | * Called when the dialog finishes with an error. 37 | * 38 | * @param error The error that occurred 39 | */ 40 | fun onError(error: FacebookException) 41 | } 42 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/FacebookDialogException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | /** Represents an error condition relating to displaying a Facebook Web dialog. */ 12 | class FacebookDialogException 13 | /** Constructs a new FacebookException. */ 14 | ( 15 | message: String?, 16 | /** 17 | * The error code received by the WebView. See: 18 | * http://developer.android.com/reference/android/webkit/WebViewClient.html 19 | */ 20 | val errorCode: Int, 21 | /** The URL that the dialog was trying to load. */ 22 | val failingUrl: String? 23 | ) : FacebookException(message) { 24 | override fun toString(): String { 25 | return StringBuilder() 26 | .append("{FacebookDialogException: ") 27 | .append("errorCode: ") 28 | .append(errorCode) 29 | .append(", message: ") 30 | .append(message) 31 | .append(", url: ") 32 | .append(failingUrl) 33 | .append("}") 34 | .toString() 35 | } 36 | 37 | companion object { 38 | const val serialVersionUID: Long = 1 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/LoginStatusCallback.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | /** A callback class for getting the Login Status of a user. */ 12 | interface LoginStatusCallback { 13 | /** 14 | * Called when an access token is able to be retrieved successfully. 15 | * 16 | * @param accessToken The access token retrieved for the user 17 | */ 18 | fun onCompleted(accessToken: AccessToken) 19 | 20 | /** Called when an access token could not be retrieved. */ 21 | fun onFailure() 22 | 23 | /** 24 | * Called when there was an error getting the login status of a user. 25 | * 26 | * @param exception The error that occurred 27 | */ 28 | fun onError(exception: Exception) 29 | } 30 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/WebDialog.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | object WebDialog { 12 | /** 13 | * Gets the theme used by [com.facebook.internal.WebDialog] 14 | * 15 | * @return the theme 16 | */ 17 | @JvmStatic 18 | fun getWebDialogTheme(): Int { 19 | return com.facebook.internal.WebDialog.getWebDialogTheme() 20 | } 21 | /** 22 | * Sets the theme used by [com.facebook.internal.WebDialog] 23 | * 24 | * @param theme A theme to use 25 | */ 26 | @JvmStatic 27 | fun setWebDialogTheme(theme: Int) { 28 | com.facebook.internal.WebDialog.setWebDialogTheme(theme) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/common/Common.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.common 10 | 11 | class Common 12 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/internal/DialogFeature.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal 10 | 11 | /** 12 | * com.facebook.internal is solely for the use of other packages within the Facebook SDK for 13 | * Android. Use of any of the classes in this package is unsupported, and they may be modified or 14 | * removed without warning at any time. 15 | */ 16 | interface DialogFeature { 17 | /** This method is for internal use only. */ 18 | fun getAction(): String 19 | 20 | /** This method is for internal use only. */ 21 | fun getMinVersion(): Int 22 | 23 | /** 24 | * This method is for internal use only. 25 | * 26 | * For all Enums that implement this interface, the name() method (in Java) or the name property 27 | * (in Kotlin) is already present. It returns the String representation of the Enum value, 28 | * verbatim. 29 | */ 30 | @Suppress("INAPPLICABLE_JVM_NAME") @get:JvmName("name") val name: String 31 | } 32 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/internal/FacebookGamingAction.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal 10 | 11 | enum class GamingAction(val rawValue: String) { 12 | ContextChoose("context_choose"), 13 | JoinTournament("join_tournament"); 14 | } -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/internal/logging/dumpsys/EndToEndDumper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal.logging.dumpsys 10 | 11 | import java.io.PrintWriter 12 | 13 | /** This interface is used by Facebook internal end-to-end tests. */ 14 | fun interface EndToEndDumper { 15 | /** Try to dump. Return whether it succeeds. */ 16 | fun maybeDump(prefix: String, writer: PrintWriter, args: Array?): Boolean 17 | 18 | companion object { 19 | var instance: EndToEndDumper? = null 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/login/CodeChallengeMethod.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.login 10 | 11 | enum class CodeChallengeMethod(s: String = "S256") { 12 | S256("S256"), 13 | PLAIN("plain") 14 | } 15 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/login/GetTokenClient.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.login 10 | 11 | import android.content.Context 12 | import android.os.Bundle 13 | import com.facebook.internal.NativeProtocol 14 | import com.facebook.internal.PlatformServiceClient 15 | 16 | internal class GetTokenClient(context: Context, request: LoginClient.Request) : 17 | PlatformServiceClient( 18 | context, 19 | NativeProtocol.MESSAGE_GET_ACCESS_TOKEN_REQUEST, 20 | NativeProtocol.MESSAGE_GET_ACCESS_TOKEN_REPLY, 21 | NativeProtocol.PROTOCOL_VERSION_20121101, 22 | request.applicationId, 23 | request.nonce) { 24 | override fun populateRequestBundle(data: Bundle) = Unit 25 | } 26 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/login/LoginResult.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.login 10 | 11 | import com.facebook.AccessToken 12 | import com.facebook.AuthenticationToken 13 | 14 | /** 15 | * Represents the results of a login operation. 16 | * 17 | * @property accessToken The new access token. 18 | * @property authenticationToken The new authentication token 19 | * @property recentlyGrantedPermissions The recently granted permissions. 20 | * @property recentlyDeniedPermissions The recently denied permissions. 21 | */ 22 | data class LoginResult 23 | @JvmOverloads 24 | constructor( 25 | val accessToken: AccessToken, 26 | val authenticationToken: AuthenticationToken? = null, 27 | val recentlyGrantedPermissions: Set, 28 | val recentlyDeniedPermissions: Set 29 | ) 30 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/login/NonceUtil.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.login 10 | 11 | object NonceUtil { 12 | @JvmStatic 13 | fun isValidNonce(nonce: String?): Boolean { 14 | if (nonce.isNullOrEmpty()) { 15 | return false 16 | } 17 | 18 | val hasWhiteSpace = nonce.indexOf(' ') >= 0 19 | return !hasWhiteSpace 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/login/StartActivityDelegate.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.login 10 | 11 | import android.app.Activity 12 | import android.content.Intent 13 | 14 | internal interface StartActivityDelegate { 15 | fun startActivityForResult(intent: Intent, requestCode: Int) 16 | val activityContext: Activity? 17 | } 18 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/share/ShareBuilder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.share 10 | 11 | /** 12 | * Interface for builders related to sharing. 13 | * 14 | * @param The class of the object to be built. 15 | * @param The concrete builder class. 16 | */ 17 | fun interface ShareBuilder> { 18 | /** 19 | * Builds the object. 20 | * 21 | * @return The built object. 22 | */ 23 | fun build(): M 24 | } 25 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/share/internal/CameraEffectFeature.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.share.internal 10 | 11 | import com.facebook.internal.DialogFeature 12 | import com.facebook.internal.NativeProtocol 13 | 14 | /** 15 | * com.facebook.share.internal is solely for the use of other packages within the Facebook SDK for 16 | * Android. Use of any of the classes in this package is unsupported, and they may be modified or 17 | * removed without warning at any time. 18 | */ 19 | enum class CameraEffectFeature(private val minVersion: Int) : DialogFeature { 20 | SHARE_CAMERA_EFFECT(NativeProtocol.PROTOCOL_VERSION_20170417); 21 | 22 | /** This method is for internal use only. */ 23 | override fun getAction(): String = NativeProtocol.ACTION_CAMERA_EFFECT 24 | 25 | /** This method is for internal use only. */ 26 | override fun getMinVersion(): Int = minVersion 27 | } 28 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/share/internal/ResultProcessor.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.share.internal 10 | 11 | import android.os.Bundle 12 | import com.facebook.FacebookCallback 13 | import com.facebook.FacebookException 14 | import com.facebook.internal.AppCall 15 | 16 | /** 17 | * com.facebook.share.internal is solely for the use of other packages within the Facebook SDK for 18 | * Android. Use of any of the classes in this package is unsupported, and they may be modified or 19 | * removed without warning at any time. 20 | * 21 | * Callback class to allow derivations of FacebookDialogBase to do custom operations 22 | */ 23 | abstract class ResultProcessor(private val appCallback: FacebookCallback<*>?) { 24 | abstract fun onSuccess(appCall: AppCall, results: Bundle?) 25 | 26 | /** Override this if anything needs to be done on cancellation (e.g. Logging) */ 27 | open fun onCancel(appCall: AppCall) { 28 | appCallback?.onCancel() 29 | } 30 | 31 | /** Override this if anything needs to be done on error (e.g. Logging) */ 32 | open fun onError(appCall: AppCall, error: FacebookException) { 33 | appCallback?.onError(error) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/share/internal/ShareStoryFeature.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.share.internal 10 | 11 | import com.facebook.internal.DialogFeature 12 | import com.facebook.internal.NativeProtocol 13 | 14 | /** 15 | * com.facebook.share.internal is solely for the use of other packages within the Facebook SDK for 16 | * Android. Use of any of the classes in this package is unsupported, and they may be modified or 17 | * removed without warning at any time. 18 | */ 19 | enum class ShareStoryFeature(private val minVersion: Int) : DialogFeature { 20 | SHARE_STORY_ASSET(NativeProtocol.PROTOCOL_VERSION_20170417); 21 | 22 | /** This method is for internal use only. */ 23 | override fun getAction(): String = NativeProtocol.ACTION_SHARE_STORY 24 | 25 | /** This method is for internal use only. */ 26 | override fun getMinVersion(): Int = minVersion 27 | } 28 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/share/model/ShareModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.share.model 10 | 11 | import android.os.Parcelable 12 | 13 | /** Base interface for share models. */ 14 | interface ShareModel : Parcelable 15 | -------------------------------------------------------------------------------- /facebook-common/src/main/java/com/facebook/share/model/ShareModelBuilder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.share.model 10 | 11 | import com.facebook.share.ShareBuilder 12 | 13 | /** 14 | * Interface for builders related to sharing. 15 | * 16 | * @param The model protocol to be built. 17 | * @param The concrete builder class. 18 | */ 19 | interface ShareModelBuilder> : ShareBuilder { 20 | /** 21 | * Reads the values from a ShareModel into the builder. 22 | * 23 | * @param model The source ShareModel 24 | * @return The builder. 25 | */ 26 | fun readFrom(model: M?): B 27 | } 28 | -------------------------------------------------------------------------------- /facebook-common/src/main/res/color/com_facebook_button_text_color.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 14 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable-hdpi/com_facebook_button_like_icon_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-common/src/main/res/drawable-hdpi/com_facebook_button_like_icon_selected.png -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable-hdpi/com_facebook_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-common/src/main/res/drawable-hdpi/com_facebook_close.png -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable-mdpi/com_facebook_button_like_icon_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-common/src/main/res/drawable-mdpi/com_facebook_button_like_icon_selected.png -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable-mdpi/com_facebook_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-common/src/main/res/drawable-mdpi/com_facebook_close.png -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable-xhdpi/com_facebook_button_like_icon_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-common/src/main/res/drawable-xhdpi/com_facebook_button_like_icon_selected.png -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable-xhdpi/com_facebook_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-common/src/main/res/drawable-xhdpi/com_facebook_close.png -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable-xxhdpi/com_facebook_button_like_icon_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-common/src/main/res/drawable-xxhdpi/com_facebook_button_like_icon_selected.png -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable-xxhdpi/com_facebook_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-common/src/main/res/drawable-xxhdpi/com_facebook_close.png -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable/com_facebook_auth_dialog_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable/com_facebook_auth_dialog_cancel_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable/com_facebook_auth_dialog_header_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable/com_facebook_button_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable/com_facebook_button_icon.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 19 | 31 | 32 | -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable/com_facebook_button_like_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /facebook-common/src/main/res/drawable/com_facebook_favicon_blue.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /facebook-common/src/main/res/layout/com_facebook_activity_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /facebook-common/src/main/res/layout/com_facebook_login_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /facebook-common/src/main/res/values-en-rGB/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Log In With Facebook 8 | AndroidManifest error 9 | WebView login requires Internet permission 10 | You\'re in control – choose what information you want to share with apps. 11 | 12 | -------------------------------------------------------------------------------- /facebook-common/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 2dp 12 | 14 | 4dp 15 | 4dp 16 | 17 | 11.0sp 18 | 2dp 19 | 6dp 20 | 21 | 6dp 22 | 3dp 23 | 3dp 24 | 1dp 25 | 11.0sp 26 | 6dp 27 | 28 | -------------------------------------------------------------------------------- /facebook-common/src/test/kotlin/com/facebook/internal/InstagramCustomTabTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal 10 | 11 | import android.os.Bundle 12 | import com.facebook.FacebookPowerMockTestCase 13 | import com.facebook.FacebookSdk 14 | import com.facebook.login.CustomTabLoginMethodHandler 15 | import org.assertj.core.api.Assertions.assertThat 16 | import org.junit.Test 17 | 18 | class InstagramCustomTabTest : FacebookPowerMockTestCase() { 19 | @Test 20 | fun `test get URI for oauth action`() { 21 | val parameters = Bundle() 22 | parameters.putString(ServerProtocol.DIALOG_PARAM_SCOPE, "user_name,user_birthday") 23 | val uri = 24 | InstagramCustomTab.getURIForAction(CustomTabLoginMethodHandler.OAUTH_DIALOG, parameters) 25 | assertThat(uri.toString()) 26 | .isEqualTo("https://m.instagram.com/oauth/authorize?scope=user_name%2Cuser_birthday") 27 | } 28 | 29 | @Test 30 | fun `test get URI for other action`() { 31 | val parameters = Bundle() 32 | parameters.putString("status", "Hi Instagram") 33 | val uri = InstagramCustomTab.getURIForAction("share", parameters) 34 | val version = FacebookSdk.getGraphApiVersion() 35 | assertThat(uri.toString()) 36 | .isEqualTo("https://m.instagram.com/$version/dialog/share?status=Hi%20Instagram") 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /facebook-common/src/test/kotlin/com/facebook/login/GetTokenClientTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.login 10 | 11 | import android.content.Context 12 | import com.facebook.FacebookPowerMockTestCase 13 | import org.assertj.core.api.Assertions.assertThat 14 | import org.junit.Test 15 | import org.powermock.api.mockito.PowerMockito.mock 16 | 17 | class GetTokenClientTest : FacebookPowerMockTestCase() { 18 | 19 | @Test 20 | fun `test constructor make sure it can be created with correct input`() { 21 | val contextMock = mock(Context::class.java) 22 | val request = 23 | LoginClient.Request( 24 | LoginBehavior.NATIVE_WITH_FALLBACK, 25 | null, 26 | DefaultAudience.FRIENDS, 27 | "rerequest", 28 | "1234", 29 | "5678", 30 | null, 31 | AuthenticationTokenTestUtil.NONCE, 32 | null, 33 | null, 34 | null) 35 | val getTokenClient = GetTokenClient(contextMock, request) 36 | assertThat(getTokenClient).isNotNull 37 | assertThat(getTokenClient.nonce).isEqualTo(AuthenticationTokenTestUtil.NONCE) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /facebook-common/src/test/kotlin/com/facebook/login/NonceUtilTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.login 10 | 11 | import com.facebook.FacebookPowerMockTestCase 12 | import org.assertj.core.api.Assertions.assertThat 13 | import org.junit.Test 14 | 15 | class NonceUtilTest : FacebookPowerMockTestCase() { 16 | 17 | @Test 18 | fun `test valid nonce`() { 19 | assertThat(NonceUtil.isValidNonce(AuthenticationTokenTestUtil.NONCE)).isTrue 20 | } 21 | 22 | @Test 23 | fun `test invalid nonce`() { 24 | assertThat(NonceUtil.isValidNonce("nonce ")).isFalse 25 | } 26 | 27 | @Test 28 | fun `test empty nonce`() { 29 | assertThat(NonceUtil.isValidNonce("")).isFalse 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /facebook-core/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /facebook-core/src/main/aidl/com/facebook/ppml/receiver/IReceiverService.aidl: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.ppml.receiver; 10 | 11 | interface IReceiverService { 12 | int sendEvents(in Bundle eventsBundle); 13 | } 14 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/android/adservices/topics/GetTopicsRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package android.adservices.topics; 10 | 11 | import androidx.annotation.NonNull; 12 | 13 | public final class GetTopicsRequest { 14 | GetTopicsRequest() { 15 | throw new RuntimeException("Stub!"); 16 | } 17 | 18 | @NonNull 19 | public String getAdsSdkName() { 20 | throw new RuntimeException("Stub!"); 21 | } 22 | 23 | public boolean shouldRecordObservation() { 24 | throw new RuntimeException("Stub!"); 25 | } 26 | 27 | public static final class Builder { 28 | public Builder() { 29 | throw new RuntimeException("Stub!"); 30 | } 31 | 32 | @NonNull 33 | public Builder setAdsSdkName(@NonNull String adsSdkName) { 34 | throw new RuntimeException("Stub!"); 35 | } 36 | 37 | @NonNull 38 | public Builder setShouldRecordObservation(boolean recordObservation) { 39 | throw new RuntimeException("Stub!"); 40 | } 41 | 42 | @NonNull 43 | public GetTopicsRequest build() { 44 | throw new RuntimeException("Stub!"); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/android/adservices/topics/GetTopicsResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package android.adservices.topics; 10 | 11 | import androidx.annotation.NonNull; 12 | import java.util.List; 13 | 14 | public final class GetTopicsResponse { 15 | GetTopicsResponse() { 16 | throw new RuntimeException("Stub!"); 17 | } 18 | 19 | @NonNull 20 | public List getTopics() { 21 | throw new RuntimeException("Stub!"); 22 | } 23 | 24 | public boolean equals(Object o) { 25 | throw new RuntimeException("Stub!"); 26 | } 27 | 28 | public int hashCode() { 29 | throw new RuntimeException("Stub!"); 30 | } 31 | 32 | public static final class Builder { 33 | public Builder(@NonNull List topics) { 34 | throw new RuntimeException("Stub!"); 35 | } 36 | 37 | @NonNull 38 | public GetTopicsResponse build() { 39 | throw new RuntimeException("Stub!"); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/android/adservices/topics/Topic.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package android.adservices.topics; 10 | 11 | import androidx.annotation.NonNull; 12 | 13 | import java.util.List; 14 | 15 | public final class Topic { 16 | Topic() { 17 | throw new RuntimeException("Stub!"); 18 | } 19 | 20 | public long getModelVersion() { 21 | throw new RuntimeException("Stub!"); 22 | } 23 | 24 | public long getTaxonomyVersion() { 25 | throw new RuntimeException("Stub!"); 26 | } 27 | 28 | public int getTopicId() { 29 | throw new RuntimeException("Stub!"); 30 | } 31 | 32 | public boolean equals(Object o) { 33 | throw new RuntimeException("Stub!"); 34 | } 35 | 36 | public int hashCode() { 37 | throw new RuntimeException("Stub!"); 38 | } 39 | 40 | public static final class Builder { 41 | public Builder(@NonNull List topics) { 42 | throw new RuntimeException("Stub!"); 43 | } 44 | 45 | @NonNull 46 | public Topic build() { 47 | throw new RuntimeException("Stub!"); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/android/adservices/topics/TopicsManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package android.adservices.topics; 10 | 11 | import androidx.annotation.NonNull; 12 | import android.content.Context; 13 | import android.os.OutcomeReceiver; 14 | import java.util.concurrent.Executor; 15 | 16 | public final class TopicsManager { 17 | TopicsManager() { 18 | throw new RuntimeException("Stub!"); 19 | } 20 | 21 | @NonNull 22 | public static TopicsManager get(@NonNull Context context) { 23 | throw new RuntimeException("Stub!"); 24 | } 25 | 26 | @NonNull 27 | public void getTopics(@NonNull GetTopicsRequest getTopicsRequest, @NonNull Executor executor, @NonNull OutcomeReceiver callback) { 28 | throw new RuntimeException("Stub!"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/CurrentAccessTokenExpirationBroadcastReceiver.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | import android.content.BroadcastReceiver 12 | import android.content.Context 13 | import android.content.Intent 14 | 15 | /** This class is notified when the current [AccessToken] has expired. */ 16 | class CurrentAccessTokenExpirationBroadcastReceiver : BroadcastReceiver() { 17 | override fun onReceive(context: Context, intent: Intent) { 18 | if (AccessTokenManager.ACTION_CURRENT_ACCESS_TOKEN_CHANGED == intent.action && 19 | FacebookSdk.isInitialized()) { 20 | AccessTokenManager.getInstance().currentAccessTokenChanged() 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/FacebookOperationCanceledException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | /** An Exception indicating that an operation was canceled before it completed. */ 12 | class FacebookOperationCanceledException : FacebookException { 13 | /** Constructs a FacebookOperationCanceledException with no additional information. */ 14 | constructor() : super() 15 | 16 | /** 17 | * Constructs a FacebookOperationCanceledException with a message. 18 | * 19 | * @param message A String to be returned from getMessage. 20 | */ 21 | constructor(message: String?) : super(message) 22 | 23 | /** 24 | * Constructs a FacebookOperationCanceledException with a message and inner error. 25 | * 26 | * @param message A String to be returned from getMessage. 27 | * @param throwable A Throwable to be returned from getCause. 28 | */ 29 | constructor(message: String?, throwable: Throwable?) : super(message, throwable) 30 | 31 | /** 32 | * Constructs a FacebookOperationCanceledException with an inner error. 33 | * 34 | * @param throwable A Throwable to be returned from getCause. 35 | */ 36 | constructor(throwable: Throwable?) : super(throwable) 37 | 38 | companion object { 39 | const val serialVersionUID: Long = 1 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/FacebookSdkNotInitializedException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | /** An Exception indicating that the Facebook SDK has not been correctly initialized. */ 12 | class FacebookSdkNotInitializedException : FacebookException { 13 | /** Constructs a FacebookSdkNotInitializedException with no additional information. */ 14 | constructor() : super() {} 15 | 16 | /** 17 | * Constructs a FacebookSdkNotInitializedException with a message. 18 | * 19 | * @param message A String to be returned from getMessage. 20 | */ 21 | constructor(message: String?) : super(message) {} 22 | 23 | /** 24 | * Constructs a FacebookSdkNotInitializedException with a message and inner error. 25 | * 26 | * @param message A String to be returned from getMessage. 27 | * @param throwable A Throwable to be returned from getCause. 28 | */ 29 | constructor(message: String?, throwable: Throwable?) : super(message, throwable) {} 30 | 31 | /** 32 | * Constructs a FacebookSdkNotInitializedException with an inner error. 33 | * 34 | * @param throwable A Throwable to be returned from getCause. 35 | */ 36 | constructor(throwable: Throwable?) : super(throwable) {} 37 | 38 | companion object { 39 | const val serialVersionUID: Long = 1 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/FacebookSdkVersion.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | internal object FacebookSdkVersion { 12 | const val BUILD = "18.0.3" 13 | } 14 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/FacebookServiceException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | /** Represents an error returned from the Facebook service in response to a request. */ 12 | class FacebookServiceException 13 | /** 14 | * Constructs a new FacebookServiceException. 15 | * 16 | * @param error the error from the request 17 | */ 18 | (val requestError: FacebookRequestError, errorMessage: String?) : FacebookException(errorMessage) { 19 | /** 20 | * Returns an object that encapsulates complete information representing the error returned by 21 | * Facebook. 22 | * 23 | * @return complete information representing the error. 24 | */ 25 | override fun toString(): String { 26 | return StringBuilder() 27 | .append("{FacebookServiceException: ") 28 | .append("httpResponseCode: ") 29 | .append(requestError.requestStatusCode) 30 | .append(", facebookErrorCode: ") 31 | .append(requestError.errorCode) 32 | .append(", facebookErrorType: ") 33 | .append(requestError.errorType) 34 | .append(", message: ") 35 | .append(requestError.errorMessage) 36 | .append("}") 37 | .toString() 38 | } 39 | 40 | companion object { 41 | private const val serialVersionUID: Long = 1 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/HttpMethod.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | /** Enumeration of HTTP methods supported by Request */ 12 | enum class HttpMethod { 13 | /** Use HTTP method "GET" for the request */ 14 | GET, 15 | 16 | /** Use HTTP method "POST" for the request */ 17 | POST, 18 | 19 | /** Use HTTP method "DELETE" for the request */ 20 | DELETE 21 | } 22 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/RequestOutputStream.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | internal fun interface RequestOutputStream { 12 | fun setCurrentRequest(r: GraphRequest?) 13 | } 14 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/appevents/FlushReason.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.appevents 10 | 11 | internal enum class FlushReason { 12 | EXPLICIT, 13 | TIMER, 14 | SESSION_CHANGE, 15 | PERSISTED_EVENTS, 16 | EVENT_THRESHOLD, 17 | EAGER_FLUSHING_EVENT 18 | } 19 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/appevents/FlushResult.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.appevents 10 | 11 | enum class FlushResult { 12 | SUCCESS, 13 | SERVER_ERROR, 14 | NO_CONNECTIVITY, 15 | UNKNOWN_ERROR 16 | } 17 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/appevents/FlushStatistics.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.appevents 10 | 11 | internal class FlushStatistics { 12 | var numEvents = 0 13 | var result = FlushResult.SUCCESS 14 | } 15 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/appevents/codeless/internal/Constants.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.appevents.codeless.internal 10 | 11 | object Constants { 12 | const val MAX_TREE_DEPTH = 25 13 | const val IS_CODELESS_EVENT_KEY = "_is_fb_codeless" 14 | const val EVENT_MAPPING_PATH_TYPE_KEY = "path_type" 15 | const val PATH_TYPE_RELATIVE = "relative" 16 | const val PATH_TYPE_ABSOLUTE = "absolute" 17 | const val PLATFORM = "android" 18 | const val APP_INDEXING_SCHEDULE_INTERVAL_MS = 1000 19 | const val APP_INDEXING_ENABLED = "is_app_indexing_enabled" 20 | const val DEVICE_SESSION_ID = "device_session_id" 21 | const val EXTINFO = "extinfo" 22 | const val APP_INDEXING = "app_indexing" 23 | const val BUTTON_SAMPLING = "button_sampling" 24 | } 25 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/appevents/codeless/internal/ParameterComponent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.appevents.codeless.internal 10 | 11 | import org.json.JSONObject 12 | 13 | class ParameterComponent(component: JSONObject) { 14 | val name: String = component.getString(PARAMETER_NAME_KEY) 15 | val value: String = component.optString(PARAMETER_VALUE_KEY) 16 | val path: List 17 | val pathType: String = 18 | component.optString(Constants.EVENT_MAPPING_PATH_TYPE_KEY, Constants.PATH_TYPE_ABSOLUTE) 19 | 20 | companion object { 21 | private const val PARAMETER_NAME_KEY = "name" 22 | private const val PARAMETER_PATH_KEY = "path" 23 | private const val PARAMETER_VALUE_KEY = "value" 24 | } 25 | 26 | init { 27 | val pathComponents = arrayListOf() 28 | val jsonPathArray = component.optJSONArray(PARAMETER_PATH_KEY) 29 | if (jsonPathArray != null) { 30 | for (i in 0 until jsonPathArray.length()) { 31 | val pathComponent = PathComponent(jsonPathArray.getJSONObject(i)) 32 | pathComponents.add(pathComponent) 33 | } 34 | } 35 | path = pathComponents 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/appevents/gps/GpsDebugLogger.kt: -------------------------------------------------------------------------------- 1 | package com.facebook.appevents.gps 2 | 3 | import android.content.Context 4 | import android.os.Bundle 5 | import com.facebook.appevents.InternalAppEventsLogger 6 | import kotlin.random.Random 7 | 8 | class GpsDebugLogger(context: Context) { 9 | private val internalAppEventsLogger: InternalAppEventsLogger = InternalAppEventsLogger(context) 10 | 11 | fun log(eventName: String?, parameters: Bundle?) { 12 | if (shouldLog && isGPSDebugEvent(eventName)) internalAppEventsLogger.logEventImplicitly(eventName, parameters) 13 | } 14 | 15 | private fun isGPSDebugEvent(eventName: String?): Boolean { 16 | return eventName?.contains(GPS_PREFIX) ?: false 17 | } 18 | 19 | companion object { 20 | private const val LOGGING_SAMPLING_RATE = 0.0001 21 | private const val GPS_PREFIX = "gps" 22 | private val shouldLog = Random.nextDouble() <= LOGGING_SAMPLING_RATE 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/appevents/gps/topics/TopicData.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.appevents.gps.topics 10 | 11 | data class TopicData( 12 | val taxonomyVersion: Long, 13 | val modelVersion: Long, 14 | val topicId: Int, 15 | ) 16 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/appevents/iap/InAppPurchase.kt: -------------------------------------------------------------------------------- 1 | package com.facebook.appevents.iap 2 | 3 | import java.util.Currency 4 | 5 | data class InAppPurchase(val eventName: String, val amount: Double, val currency: Currency) 6 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/appevents/iap/InAppPurchaseBillingClientWrapper.kt: -------------------------------------------------------------------------------- 1 | package com.facebook.appevents.iap 2 | 3 | interface InAppPurchaseBillingClientWrapper { 4 | val billingClient: Any 5 | fun queryPurchases(productType: InAppPurchaseUtils.IAPProductType, completionHandler: Runnable) 6 | fun queryPurchaseHistory( 7 | productType: InAppPurchaseUtils.IAPProductType, 8 | completionHandler: Runnable 9 | ) 10 | } 11 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/appevents/ml/MTensor.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.appevents.ml 10 | 11 | import kotlin.math.min 12 | 13 | class MTensor(private var shape: IntArray) { 14 | private var capacity: Int = getCapacity(shape) 15 | var data: FloatArray = FloatArray(capacity) 16 | private set 17 | val shapeSize: Int 18 | get() = shape.size 19 | 20 | fun getShape(i: Int) = shape[i] 21 | 22 | /** 23 | * Reshape the shape 24 | * 25 | * @param shape to reshape 26 | */ 27 | fun reshape(shape: IntArray) { 28 | this.shape = shape 29 | val newCapacity = getCapacity(shape) 30 | val newData = FloatArray(newCapacity) 31 | System.arraycopy(data, 0, newData, 0, min(capacity, newCapacity)) 32 | data = newData 33 | capacity = newCapacity 34 | } 35 | 36 | companion object { 37 | private fun getCapacity(shape: IntArray) = shape.reduce { acc, i -> acc * i } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/core/Core.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.core 10 | 11 | class Core 12 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/internal/ImageResponse.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal 10 | 11 | import android.graphics.Bitmap 12 | 13 | /** 14 | * com.facebook.internal is solely for the use of other packages within the Facebook SDK for 15 | * Android. Use of any of the classes in this package is unsupported, and they may be modified or 16 | * removed without warning at any time. 17 | */ 18 | class ImageResponse 19 | internal constructor( 20 | val request: ImageRequest, 21 | val error: Exception?, 22 | val isCachedRedirect: Boolean, 23 | val bitmap: Bitmap? 24 | ) 25 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/internal/InternalSettings.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal 10 | 11 | object InternalSettings { 12 | /** 13 | * This value is used by the unity sdk to set the custom version. The user agent format is 14 | * sdk_version/custom_user_agent For example FBAndroidSDK.4.2.0/Unity.7.0.1 15 | */ 16 | private const val UNITY_PREFIX = "Unity." 17 | 18 | @Volatile private var customUserAgent: String? = null 19 | 20 | @JvmStatic fun getCustomUserAgent(): String? = customUserAgent 21 | @JvmStatic 22 | fun setCustomUserAgent(value: String) { 23 | customUserAgent = value 24 | } 25 | 26 | @JvmStatic 27 | val isUnityApp: Boolean 28 | get() = customUserAgent?.startsWith(UNITY_PREFIX) == true 29 | } 30 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/internal/LockOnGetVariable.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal 10 | 11 | import com.facebook.FacebookSdk 12 | import java.util.concurrent.Callable 13 | import java.util.concurrent.CountDownLatch 14 | import java.util.concurrent.FutureTask 15 | 16 | class LockOnGetVariable { 17 | private var storedValue: T? = null 18 | private var initLatch: CountDownLatch? = null 19 | 20 | val value: T? 21 | get() { 22 | waitOnInit() 23 | return storedValue 24 | } 25 | 26 | constructor(value: T) { 27 | this.storedValue = value 28 | } 29 | 30 | constructor(callable: Callable) { 31 | initLatch = CountDownLatch(1) 32 | FacebookSdk.getExecutor() 33 | .execute( 34 | FutureTask { 35 | try { 36 | storedValue = callable.call() 37 | } finally { 38 | initLatch?.countDown() 39 | } 40 | null 41 | }) 42 | } 43 | 44 | private fun waitOnInit() { 45 | val latch = initLatch ?: return 46 | try { 47 | latch.await() 48 | } catch (ex: InterruptedException) { 49 | // ignore 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/internal/ProfileInformationCache.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal 10 | 11 | import java.util.concurrent.ConcurrentHashMap 12 | import org.json.JSONObject 13 | 14 | /** 15 | * com.facebook.internal is solely for the use of other packages within the Facebook SDK for 16 | * Android. Use of any of the classes in this package is unsupported, and they may be modified or 17 | * removed without warning at any time. 18 | * 19 | * Caches the profile information associated to a specific access token. This minimizes the number 20 | * of request we need to make to the server. 21 | */ 22 | internal object ProfileInformationCache { 23 | private val infoCache = ConcurrentHashMap() 24 | 25 | @JvmStatic 26 | fun getProfileInformation(accessToken: String): JSONObject? { 27 | return infoCache[accessToken] 28 | } 29 | 30 | @JvmStatic 31 | fun putProfileInformation(key: String, value: JSONObject) { 32 | infoCache[key] = value 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/internal/SmartLoginOption.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal 10 | 11 | import java.util.EnumSet 12 | 13 | enum class SmartLoginOption(val value: Long) { 14 | None(0), 15 | Enabled(1), 16 | RequireConfirm(2); 17 | 18 | companion object { 19 | private val ALL: EnumSet = EnumSet.allOf(SmartLoginOption::class.java) 20 | 21 | @JvmStatic 22 | fun parseOptions(bitmask: Long): EnumSet { 23 | val result = EnumSet.noneOf(SmartLoginOption::class.java) 24 | for (opt in ALL) { 25 | if (bitmask and opt.value != 0L) { 26 | result.add(opt) 27 | } 28 | } 29 | return result 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/internal/gatekeeper/GateKeeper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal.gatekeeper 10 | 11 | data class GateKeeper(val name: String, val value: Boolean) 12 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/internal/instrument/crashshield/AutoHandleExceptions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal.instrument.crashshield 10 | 11 | @kotlin.annotation.Retention(AnnotationRetention.BINARY) annotation class AutoHandleExceptions 12 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/internal/instrument/crashshield/NoAutoExceptionHandling.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal.instrument.crashshield 10 | 11 | @kotlin.annotation.Retention(AnnotationRetention.BINARY) annotation class NoAutoExceptionHandling 12 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/internal/package-info.md: -------------------------------------------------------------------------------- 1 | # Package com.facebook.internal 2 | 3 | This package is solely for the use of other packages within the Facebook Android SDK, use of any of the classes in this package is unsupported, and they may be modified or removed without warning at any time. 4 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/internal/qualityvalidation/Excuse.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal.qualityvalidation 10 | 11 | import java.lang.annotation.Retention 12 | import java.lang.annotation.RetentionPolicy 13 | 14 | /** @see ExcusesForDesignViolations */ 15 | @Retention(RetentionPolicy.SOURCE) 16 | @Target 17 | annotation class Excuse(val type: String, val reason: String) 18 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/internal/qualityvalidation/ExcusesForDesignViolations.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal.qualityvalidation 10 | 11 | import java.lang.annotation.Retention 12 | import java.lang.annotation.RetentionPolicy 13 | 14 | /** 15 | * Annotations to mark code files as having known design issues and avoid failing the design 16 | * integration test on them 17 | * 18 | *

Please avoid using it for everything that can be fixed trivially, and delaying fixes to future 19 | * diffs without a good reason. 20 | * 21 | *

To use it list one of the type of issue you want to ignore, and supply and extra string 22 | * explaining why this is okay for this case. 23 | * 24 | *

{@code
25 |  * @ExcusesForDesignViolations(
26 |  * @Excuse(type = "STORY_VIEWER_CAPITALIZATION", reason = "Legacy"),
27 |  * @Excuse(type = "MISSING_JAVA_DOC", reason = "DI Module") ) }
28 | */ 29 | @Retention(RetentionPolicy.SOURCE) 30 | @Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CLASS) 31 | annotation class ExcusesForDesignViolations(vararg val value: Excuse) 32 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/login/DefaultAudience.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.login 10 | 11 | import com.facebook.internal.NativeProtocol 12 | 13 | /** 14 | * Certain operations such as publishing a status or publishing a photo require an audience. When 15 | * the user grants an application permission to perform a publish operation, a default audience is 16 | * selected as the publication ceiling for the application. This enumerated value allows the 17 | * application to select which audience to ask the user to grant publish permission for. 18 | */ 19 | enum class DefaultAudience(val nativeProtocolAudience: String?) { 20 | /** Represents an invalid default audience value, can be used when only reading. */ 21 | NONE(null), 22 | 23 | /** Indicates only the user is able to see posts made by the application. */ 24 | ONLY_ME(NativeProtocol.AUDIENCE_ME), 25 | 26 | /** Indicates that the user's friends are able to see posts made by the application. */ 27 | FRIENDS(NativeProtocol.AUDIENCE_FRIENDS), 28 | /** Indicates that all Facebook users are able to see posts made by the application. */ 29 | EVERYONE(NativeProtocol.AUDIENCE_EVERYONE) 30 | } 31 | -------------------------------------------------------------------------------- /facebook-core/src/main/java/com/facebook/login/LoginTargetApp.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.login 10 | 11 | enum class LoginTargetApp(private val targetApp: String) { 12 | FACEBOOK("facebook"), 13 | INSTAGRAM("instagram"); 14 | 15 | override fun toString(): String = targetApp 16 | 17 | companion object { 18 | /** 19 | * Return the LoginTargetApp by given string 20 | * 21 | * @param stringValue 22 | * @return LoginTargetApp default return LoginTargetApp.FACEBOOK 23 | */ 24 | @JvmStatic 25 | fun fromString(stringValue: String?): LoginTargetApp { 26 | for (targetApp in values()) { 27 | if (targetApp.toString() == stringValue) { 28 | return targetApp 29 | } 30 | } 31 | return FACEBOOK 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /facebook-core/src/main/res/xml/ad_services_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /facebook-core/src/test/kotlin/com/facebook/AccessTokenSourceTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | import org.assertj.core.api.Assertions.assertThat 12 | import org.junit.Test 13 | 14 | class AccessTokenSourceTest : FacebookTestCase() { 15 | @Test 16 | fun `test token sources from Instagram`() { 17 | assertThat(AccessTokenSource.INSTAGRAM_APPLICATION_WEB.fromInstagram()).isTrue() 18 | assertThat(AccessTokenSource.INSTAGRAM_CUSTOM_CHROME_TAB.fromInstagram()).isTrue() 19 | assertThat(AccessTokenSource.INSTAGRAM_WEB_VIEW.fromInstagram()).isTrue() 20 | } 21 | 22 | @Test 23 | fun `test token sources from Facebook`() { 24 | assertThat(AccessTokenSource.FACEBOOK_APPLICATION_WEB.fromInstagram()).isFalse() 25 | assertThat(AccessTokenSource.FACEBOOK_APPLICATION_NATIVE.fromInstagram()).isFalse() 26 | assertThat(AccessTokenSource.FACEBOOK_APPLICATION_SERVICE.fromInstagram()).isFalse() 27 | assertThat(AccessTokenSource.WEB_VIEW.fromInstagram()).isFalse() 28 | assertThat(AccessTokenSource.CHROME_CUSTOM_TAB.fromInstagram()).isFalse() 29 | } 30 | 31 | @Test 32 | fun `test non-extensible token type`() { 33 | assertThat(AccessTokenSource.NONE.canExtendToken()).isFalse() 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /facebook-core/src/test/kotlin/com/facebook/AccessTokenTestHelper.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | import android.os.Bundle 12 | 13 | object AccessTokenTestHelper { 14 | fun toLegacyCacheBundle(accessToken: AccessToken): Bundle { 15 | val bundle = Bundle() 16 | LegacyTokenHelper.putToken(bundle, accessToken.token) 17 | LegacyTokenHelper.putExpirationDate(bundle, accessToken.expires) 18 | LegacyTokenHelper.putPermissions(bundle, accessToken.permissions as Set) 19 | LegacyTokenHelper.putDeclinedPermissions(bundle, accessToken.declinedPermissions as Set) 20 | LegacyTokenHelper.putExpiredPermissions(bundle, accessToken.expiredPermissions as Set) 21 | LegacyTokenHelper.putSource(bundle, accessToken.source) 22 | LegacyTokenHelper.putLastRefreshDate(bundle, accessToken.lastRefresh) 23 | LegacyTokenHelper.putApplicationId(bundle, accessToken.applicationId) 24 | return bundle 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /facebook-core/src/test/kotlin/com/facebook/FacebookExceptionTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | import org.junit.Assert.assertEquals 12 | import org.junit.Test 13 | 14 | class FacebookExceptionTest { 15 | @Test 16 | fun `test facebook exception`() { 17 | var exception = FacebookException() 18 | assertEquals("", exception.toString()) 19 | 20 | exception = FacebookException("exception") 21 | assertEquals("exception", exception.toString()) 22 | 23 | exception = FacebookException("%s exception", "test") 24 | assertEquals("test exception", exception.toString()) 25 | 26 | val throwable = Throwable("throwable exception") 27 | exception = FacebookException(throwable) 28 | assertEquals(throwable.toString(), exception.toString()) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /facebook-core/src/test/kotlin/com/facebook/FacebookGraphResponseExceptionTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | import org.junit.Assert 12 | import org.junit.Test 13 | import org.mockito.kotlin.mock 14 | import org.mockito.kotlin.whenever 15 | 16 | class FacebookGraphResponseExceptionTest : FacebookPowerMockTestCase() { 17 | @Test 18 | fun `test exception to string`() { 19 | val mockResponse = mock() 20 | val mockRequestError = mock() 21 | whenever(mockRequestError.requestStatusCode).thenReturn(404) 22 | whenever(mockRequestError.errorCode).thenReturn(1) 23 | whenever(mockRequestError.errorMessage).thenReturn("Not found") 24 | whenever(mockRequestError.errorType).thenReturn("an error type") 25 | whenever(mockResponse.error).thenReturn(mockRequestError) 26 | val errorMessage = "an error message" 27 | val exception = FacebookGraphResponseException(mockResponse, errorMessage) 28 | 29 | Assert.assertEquals( 30 | "{FacebookGraphResponseException: an error message httpResponseCode: 404, facebookErrorCode: 1, facebookErrorType: an error type, message: Not found}", 31 | exception.toString()) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /facebook-core/src/test/kotlin/com/facebook/appevents/AppEventDiskStoreTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.appevents 10 | 11 | import com.facebook.FacebookPowerMockTestCase 12 | import org.junit.Assert 13 | import org.junit.Test 14 | 15 | /** TODO T118389820 Add unit tests for AppEventDiskStore static methods */ 16 | class AppEventDiskStoreTest : FacebookPowerMockTestCase() { 17 | 18 | @Test 19 | fun testReadAndClearStore() { 20 | // TODO T118389820 Add unit tests for AppEventDiskStore static methods 21 | Assert.assertTrue(true) 22 | } 23 | 24 | @Test 25 | fun testSaveEventsToDisk() { 26 | // TODO T118389820 Add unit tests for AppEventDiskStore static methods 27 | Assert.assertTrue(true) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /facebook-core/src/test/kotlin/com/facebook/appevents/codeless/CodelessTestBase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.appevents.codeless 10 | 11 | import android.app.Activity 12 | import android.widget.LinearLayout 13 | import android.widget.TextView 14 | import com.facebook.FacebookPowerMockTestCase 15 | import org.junit.Before 16 | import org.robolectric.Robolectric 17 | 18 | abstract class CodelessTestBase : FacebookPowerMockTestCase() { 19 | protected lateinit var root: LinearLayout 20 | protected lateinit var activity: Activity 21 | @Before 22 | override fun setup() { 23 | super.setup() 24 | activity = Robolectric.buildActivity(Activity::class.java).create().get() 25 | root = LinearLayout(activity) 26 | activity.setContentView(root) 27 | val outerLabel = TextView(activity) 28 | outerLabel.text = "Outer Label" 29 | root.addView(outerLabel) 30 | val inner = LinearLayout(activity) 31 | root.addView(inner) 32 | val innerLabel = TextView(activity) 33 | innerLabel.text = "Inner Label" 34 | inner.addView(innerLabel) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /facebook-core/src/test/kotlin/com/facebook/appevents/iap/PurchasesUpdatedListener.kt: -------------------------------------------------------------------------------- 1 | package com.facebook.appevents.iap 2 | 3 | interface PurchasesUpdatedListener { 4 | fun onPurchasesUpdated() 5 | } 6 | -------------------------------------------------------------------------------- /facebook-core/src/test/kotlin/com/facebook/internal/SmartLoginOptionTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.internal 10 | 11 | import java.util.EnumSet 12 | import org.junit.Assert.assertEquals 13 | import org.junit.Assert.assertNotEquals 14 | import org.junit.Test 15 | 16 | class SmartLoginOptionTest { 17 | 18 | @Test 19 | fun `test SmartLoginOption parseOptions method`() { 20 | assertEquals(SmartLoginOption.parseOptions(0), EnumSet.noneOf(SmartLoginOption::class.java)) 21 | assertEquals(SmartLoginOption.parseOptions(1), EnumSet.of(SmartLoginOption.Enabled)) 22 | assertEquals(SmartLoginOption.parseOptions(2), EnumSet.of(SmartLoginOption.RequireConfirm)) 23 | assertNotEquals(SmartLoginOption.parseOptions(3), EnumSet.of(SmartLoginOption.Enabled)) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /facebook-core/src/test/kotlin/com/facebook/login/LoginTargetAppTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.login 10 | 11 | import com.facebook.FacebookTestCase 12 | import org.assertj.core.api.Assertions.assertThat 13 | import org.junit.Test 14 | 15 | class LoginTargetAppTest : FacebookTestCase() { 16 | @Test 17 | fun `test conversion to string`() { 18 | assertThat(LoginTargetApp.FACEBOOK.toString()).isEqualTo("facebook") 19 | assertThat(LoginTargetApp.INSTAGRAM.toString()).isEqualTo("instagram") 20 | } 21 | 22 | @Test 23 | fun `test conversion from string`() { 24 | assertThat(LoginTargetApp.fromString("facebook")).isEqualTo(LoginTargetApp.FACEBOOK) 25 | assertThat(LoginTargetApp.fromString("instagram")).isEqualTo(LoginTargetApp.INSTAGRAM) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /facebook-gamingservices/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /facebook-gamingservices/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /facebook-gamingservices/src/main/java/com/facebook/gamingservices/CustomUpdate.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.gamingservices 10 | 11 | import com.facebook.AccessToken 12 | import com.facebook.GraphRequest 13 | import com.facebook.gamingservices.model.CustomUpdateContent 14 | 15 | object CustomUpdate { 16 | /** 17 | * Returns a request to perform a CustomUpdate 18 | * 19 | * This informs facebook that the player has taken an action and will notify other players in the 20 | * same GamingContext. Please check CustomUpdateContent.Builder for details on all the fields that 21 | * allow customizing the update. 22 | * 23 | * @returns A GraphRequest that is ready to execute 24 | */ 25 | @JvmStatic 26 | fun newCustomUpdateRequest( 27 | content: CustomUpdateContent, 28 | callback: GraphRequest.Callback? 29 | ): GraphRequest { 30 | return GraphRequest.newPostRequest( 31 | AccessToken.getCurrentAccessToken(), 32 | "me/custom_update", 33 | content.toGraphRequestContent(), 34 | callback) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /facebook-gamingservices/src/main/java/com/facebook/gamingservices/GamingServices.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.gamingservices 10 | 11 | class GamingServices 12 | -------------------------------------------------------------------------------- /facebook-gamingservices/src/main/java/com/facebook/gamingservices/cloudgaming/internal/SDKShareIntentEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.gamingservices.cloudgaming.internal; 10 | 11 | import androidx.annotation.Nullable; 12 | 13 | public enum SDKShareIntentEnum { 14 | INVITE("INVITE"), 15 | REQUEST("REQUEST"), 16 | CHALLENGE("CHALLENGE"), 17 | SHARE("SHARE"); 18 | 19 | private final String mStringValue; 20 | 21 | SDKShareIntentEnum(String stringValue) { 22 | this.mStringValue = stringValue; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return mStringValue; 28 | } 29 | 30 | public static @Nullable String validate(String intentType) { 31 | for (SDKShareIntentEnum intentEnum : SDKShareIntentEnum.values()) { 32 | if (intentEnum.toString().equals(intentType)) { 33 | return intentType; 34 | } 35 | } 36 | return null; 37 | } 38 | 39 | public static @Nullable SDKShareIntentEnum fromString(String intentType) { 40 | for (SDKShareIntentEnum intentEnum : SDKShareIntentEnum.values()) { 41 | if (intentEnum.toString().equals(intentType)) { 42 | return intentEnum; 43 | } 44 | } 45 | return null; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /facebook-gamingservices/src/main/java/com/facebook/gamingservices/internal/DateFormatter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.gamingservices.internal 10 | 11 | import android.os.Build 12 | import java.time.ZonedDateTime 13 | import java.time.format.DateTimeFormatter 14 | 15 | internal object DateFormatter { 16 | 17 | internal fun format(isoDate: String): ZonedDateTime? { 18 | return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 19 | val formatter: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ") 20 | ZonedDateTime.parse(isoDate, formatter) 21 | } else { 22 | return null 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /facebook-gamingservices/src/main/java/com/facebook/gamingservices/internal/TournamentScoreType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.gamingservices.internal 10 | 11 | /// The type of score a tournament can handle 12 | enum class TournamentScoreType { 13 | NUMERIC, 14 | TIME, 15 | } 16 | -------------------------------------------------------------------------------- /facebook-gamingservices/src/main/java/com/facebook/gamingservices/internal/TournamentSortOrder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.gamingservices.internal 10 | 11 | // The sort order for how scores are ranked in the tournament. 12 | enum class TournamentSortOrder(val rawValue: String) { 13 | LowerIsBetter("LOWER_IS_BETTER"), 14 | HigherIsBetter("HIGHER_IS_BETTER"); 15 | 16 | override fun toString(): String { 17 | return rawValue 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /facebook-login/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /facebook-login/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /facebook-login/src/main/java/com/facebook/login/DeviceLoginManager.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.login 10 | 11 | import android.net.Uri 12 | import com.facebook.internal.instrument.crashshield.AutoHandleExceptions 13 | 14 | /** This class manages device login and permissions for Facebook. */ 15 | @AutoHandleExceptions 16 | class DeviceLoginManager : LoginManager() { 17 | 18 | /** 19 | * Uri to redirect the user to after they complete the device login flow on the external device. 20 | * 21 | * The Uri must be configured in your App Settings -> Advanced -> OAuth Redirect URIs. 22 | */ 23 | var deviceRedirectUri: Uri? = null 24 | 25 | /** Target user id for the device request, if any. */ 26 | var deviceAuthTargetUserId: String? = null 27 | 28 | override fun createLoginRequest(permissions: Collection?): LoginClient.Request { 29 | val request = super.createLoginRequest(permissions) 30 | deviceRedirectUri?.let { request.deviceRedirectUriString = it.toString() } 31 | deviceAuthTargetUserId?.let { request.deviceAuthTargetUserId = it } 32 | return request 33 | } 34 | 35 | companion object { 36 | val instance: DeviceLoginManager by lazy { DeviceLoginManager() } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /facebook-login/src/main/java/com/facebook/login/Login.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.login 10 | 11 | class Login 12 | -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_black_background.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_black_background.9.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_black_bottomnub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_black_bottomnub.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_black_topnub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_black_topnub.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_black_xout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_black_xout.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_blue_background.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_blue_background.9.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_blue_bottomnub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_blue_bottomnub.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_blue_topnub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_blue_topnub.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_blue_xout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-hdpi/com_facebook_tooltip_blue_xout.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-mdpi/com_facebook_profile_picture_blank_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-mdpi/com_facebook_profile_picture_blank_portrait.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-mdpi/com_facebook_profile_picture_blank_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-mdpi/com_facebook_profile_picture_blank_square.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_black_background.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_black_background.9.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_black_bottomnub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_black_bottomnub.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_black_topnub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_black_topnub.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_black_xout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_black_xout.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_blue_background.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_blue_background.9.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_blue_bottomnub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_blue_bottomnub.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_blue_topnub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_blue_topnub.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_blue_xout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-mdpi/com_facebook_tooltip_blue_xout.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_black_background.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_black_background.9.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_black_bottomnub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_black_bottomnub.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_black_topnub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_black_topnub.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_black_xout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_black_xout.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_blue_background.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_blue_background.9.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_blue_bottomnub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_blue_bottomnub.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_blue_topnub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_blue_topnub.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_blue_xout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook-login/src/main/res/drawable-xhdpi/com_facebook_tooltip_blue_xout.png -------------------------------------------------------------------------------- /facebook-login/src/main/res/values-en-rGB/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Log In With Facebook 8 | AndroidManifest error 9 | WebView login requires Internet permission 10 | You\'re in control – choose what information you want to share with apps. 11 | 12 | -------------------------------------------------------------------------------- /facebook-login/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 3dp 12 | 13 | 50dp 14 | 100dp 15 | 180dp 16 | 17 | 18 | -------------------------------------------------------------------------------- /facebook-login/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 19 | 20 | 21 | 22 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /facebook-testutil/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /facebook-testutil/src/main/java/com/facebook/FacebookTestCase.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | import org.junit.Before 12 | import org.junit.runner.RunWith 13 | import org.mockito.MockitoAnnotations 14 | import org.robolectric.RobolectricTestRunner 15 | import org.robolectric.annotation.Config 16 | import org.robolectric.shadows.ShadowLog 17 | 18 | // ShadowLog is used to redirect the android.util.Log calls to System.out 19 | @Config(shadows = [ShadowLog::class], sdk = [21]) 20 | @RunWith(RobolectricTestRunner::class) 21 | /** 22 | * Base class for Robolectric tests. Important: the classes that derive from this should end with 23 | * Test (i.e. not Tests) otherwise the gradle task "test" doesn't pick them up. 24 | */ 25 | abstract class FacebookTestCase { 26 | @Before 27 | open fun setUp() { 28 | ShadowLog.stream = System.out 29 | MockitoAnnotations.initMocks(this) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /facebook-testutil/src/main/java/com/facebook/util/common/CaptureExecutor.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.util.common 10 | 11 | import java.util.concurrent.Executor 12 | 13 | /** 14 | * CaptureExecutor will capture the runnable for execution. Then the tests can run the runnable 15 | * object by themselves. 16 | */ 17 | class CaptureExecutor : Executor { 18 | var capturedRunnable: Runnable? = null 19 | override fun execute(task: Runnable?) { 20 | capturedRunnable = task 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /facebook-testutil/src/main/java/org/mockito/configuration/MockitoConfiguration.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package org.mockito.configuration 10 | 11 | class MockitoConfiguration : DefaultMockitoConfiguration() { 12 | override fun enableClassCache(): Boolean { 13 | return false 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /facebook/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /facebook/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /facebook/src/main/java/com/facebook/all/All.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.all 10 | 11 | class All 12 | -------------------------------------------------------------------------------- /facebook/src/test/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /facebook/src/test/java/com/facebook/PowerMockIntegrationTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook 10 | 11 | import com.facebook.FacebookSdk.getApplicationId 12 | import com.facebook.FacebookSdk.getClientToken 13 | import org.junit.Assert.assertEquals 14 | import org.junit.Test 15 | import org.mockito.kotlin.whenever 16 | import org.powermock.api.mockito.PowerMockito.mockStatic 17 | import org.powermock.core.classloader.annotations.PrepareForTest 18 | 19 | /** This test makes sure PowerMock integration works. */ 20 | @PrepareForTest(FacebookSdk::class) 21 | class PowerMockIntegrationTest : FacebookPowerMockTestCase() { 22 | @Test 23 | fun testStaticMethodOverrides() { 24 | mockStatic(FacebookSdk::class.java) 25 | val applicationId = "1234" 26 | 27 | whenever(getApplicationId()).thenReturn(applicationId) 28 | assertEquals(applicationId, getApplicationId()) 29 | 30 | val clientToken = "clienttoken" 31 | whenever(getClientToken()).thenReturn(clientToken) 32 | assertEquals(clientToken, getClientToken()) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /facebook/src/test/resources/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook/src/test/resources/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /facebook/src/test/resources/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook/src/test/resources/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /facebook/src/test/resources/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook/src/test/resources/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /facebook/src/test/resources/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/facebook/src/test/resources/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /facebook/src/test/resources/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 18 | 19 | 23 | 24 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /facebook/src/test/resources/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | 17 | 18 | -------------------------------------------------------------------------------- /facebook/src/test/resources/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 13 | 64dp 14 | 15 | -------------------------------------------------------------------------------- /facebook/src/test/resources/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 16dp 12 | 16dp 13 | 14 | -------------------------------------------------------------------------------- /facebook/src/test/resources/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | junitTests 13 | Hello world! 14 | Settings 15 | 16 | 17 | -------------------------------------------------------------------------------- /facebook/src/test/resources/values/styles.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | android.useAndroidX=true 2 | org.gradle.jvmargs=-Xmx4g 3 | android.jetifier.ignorelist=bcprov-jdk15on 4 | org.gradle.parallel=true 5 | android.suppressUnsupportedCompileSdk=34 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Oct 09 10:08:32 PDT 2020 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-7.5-all.zip 7 | -------------------------------------------------------------------------------- /samples/FBLoginSample/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Facebook welcomes contributions to our SDKs and sample apps. 2 | 3 | All contributors must sign a CLA (contributor license agreement) here: 4 | 5 | https://developers.facebook.com/opensource/cla 6 | 7 | To contribute on behalf of your employer, sign the company CLA 8 | To contribute on behalf of yourself, sign the individual CLA 9 | 10 | By contributing to, you agree that your contributions will be licensed 11 | under the LICENSE file in the root directory of this source tree. 12 | -------------------------------------------------------------------------------- /samples/FBLoginSample/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. 2 | 3 | You are hereby granted a non-exclusive, worldwide, royalty-free license to use, 4 | copy, modify, and distribute this software in source code or binary form for use 5 | in connection with the web services and APIs provided by Facebook. 6 | 7 | As with any software that integrates with the Facebook platform, your use of 8 | this software is subject to the Facebook Platform Policy 9 | [http://developers.facebook.com/policy/]. This copyright notice shall be 10 | included in all copies or substantial portions of the software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 14 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 15 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 16 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 17 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /samples/FBLoginSample/gradle.properties: -------------------------------------------------------------------------------- 1 | android.enableJetifier=true 2 | android.useAndroidX=true 3 | org.gradle.jvmargs=-Xmx4g 4 | android.jetifier.ignorelist=bcprov-jdk15on 5 | -------------------------------------------------------------------------------- /samples/FBLoginSample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Copyright (c) Meta Platforms, Inc. and affiliates. 2 | # All rights reserved. 3 | # 4 | # This source code is licensed under the license found in the 5 | # LICENSE file in the root directory of this source tree. 6 | 7 | # Add project specific ProGuard rules here. 8 | # By default, the flags in this file are appended to flags specified 9 | # in /Users/inathan/Library/Android/sdk/tools/proguard/proguard-android.txt 10 | # You can edit the include path and order by changing the proguardFiles 11 | # directive in build.gradle. 12 | # 13 | # For more details, see 14 | # http://developer.android.com/guide/developing/tools/proguard.html 15 | 16 | # Add any project specific keep options here: 17 | 18 | # If your project uses WebView with JS, uncomment the following 19 | # and specify the fully qualified class name to the JavaScript interface 20 | # class: 21 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 22 | # public *; 23 | #} 24 | 25 | # Uncomment this to preserve the line number information for 26 | # debugging stack traces. 27 | #-keepattributes SourceFile,LineNumberTable 28 | 29 | # If you keep the line number information, uncomment this to 30 | # hide the original source file name. 31 | #-renamesourcefileattribute SourceFile 32 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/androidTest/java/com/facebook/fbloginsample/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.fbloginsample 10 | 11 | import androidx.test.ext.junit.runners.AndroidJUnit4 12 | import androidx.test.platform.app.InstrumentationRegistry 13 | import org.junit.Assert 14 | import org.junit.Test 15 | import org.junit.runner.RunWith 16 | 17 | /** 18 | * Instrumented test, which will execute on an Android device. 19 | * 20 | * See [testing documentation](http://d.android.com/tools/testing). 21 | */ 22 | @RunWith(AndroidJUnit4::class) 23 | class ExampleInstrumentedTest { 24 | @Test 25 | fun useAppContext() { 26 | // Context of the app under test. 27 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 28 | Assert.assertEquals("com.facebook.fbloginsample", appContext.packageName) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/java/com/facebook/fbloginsample/FBLoginSampleApp.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.fbloginsample 10 | 11 | import android.app.Application 12 | import com.facebook.drawee.backends.pipeline.Fresco 13 | 14 | class FBLoginSampleApp : Application() { 15 | override fun onCreate() { 16 | super.onCreate() 17 | Fresco.initialize(this) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/java/com/facebook/fbloginsample/Util.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.fbloginsample 10 | 11 | import java.text.ParsePosition 12 | import java.text.SimpleDateFormat 13 | import java.util.Date 14 | import java.util.Locale 15 | 16 | object Util { 17 | fun makePrettyDate(getCreatedTime: String): String { 18 | val formatter = SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ", Locale.US) 19 | val pos = ParsePosition(0) 20 | val then = formatter.parse(getCreatedTime, pos).time 21 | val now = Date().time 22 | val seconds = (now - then) / 1000 23 | val minutes = seconds / 60 24 | val hours = minutes / 60 25 | val days = hours / 24 26 | var friendly: String? 27 | val num: Long 28 | when { 29 | days > 0 -> { 30 | num = days 31 | friendly = "$days day" 32 | } 33 | hours > 0 -> { 34 | num = hours 35 | friendly = "$hours hour" 36 | } 37 | minutes > 0 -> { 38 | num = minutes 39 | friendly = "$minutes minute" 40 | } 41 | else -> { 42 | num = seconds 43 | friendly = "$seconds second" 44 | } 45 | } 46 | if (num > 1) { 47 | friendly += "s" 48 | } 49 | return "$friendly ago" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/java/com/facebook/fbloginsample/callbacks/PermissionCallback.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.fbloginsample.callbacks 10 | 11 | import com.facebook.GraphRequest 12 | import com.facebook.GraphResponse 13 | 14 | class PermissionCallback(caller: IPermissionResponse) { 15 | interface IPermissionResponse { 16 | fun onCompleted(response: GraphResponse?) 17 | } 18 | 19 | val callback = GraphRequest.Callback { response: GraphResponse? -> caller.onCompleted(response) } 20 | } 21 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/java/com/facebook/fbloginsample/callbacks/PublishPostCallback.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.fbloginsample.callbacks 10 | 11 | import com.facebook.FacebookCallback 12 | import com.facebook.FacebookException 13 | import com.facebook.GraphRequest 14 | import com.facebook.share.Sharer 15 | 16 | class PublishPostCallback(caller: IPublishPostResponse) { 17 | interface IPublishPostResponse { 18 | fun onPublishCompleted() 19 | } 20 | 21 | val graphRequestCallback = 22 | GraphRequest.Callback { // Handled by PostFeedActivity 23 | caller.onPublishCompleted() 24 | } 25 | 26 | val shareCallback = 27 | object : FacebookCallback { 28 | override fun onSuccess(result: Sharer.Result) { 29 | // Handled by PostFeedActivity 30 | caller.onPublishCompleted() 31 | } 32 | 33 | override fun onCancel() { 34 | // Handle user cancel ... 35 | } 36 | 37 | override fun onError(error: FacebookException) { 38 | // Handle exception ... 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/java/com/facebook/fbloginsample/entities/Post.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.fbloginsample.entities 10 | 11 | class Post( 12 | val message: String?, 13 | val createdTime: String, 14 | val id: String, 15 | val picture: String?, 16 | val fromName: String, 17 | val fromId: String 18 | ) 19 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/java/com/facebook/fbloginsample/entities/User.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.fbloginsample.entities 10 | 11 | import android.net.Uri 12 | 13 | class User( 14 | val picture: Uri, 15 | val name: String, 16 | val id: String, 17 | val email: String?, 18 | val permissions: String 19 | ) 20 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/java/com/facebook/fbloginsample/requests/PermissionRequest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.fbloginsample.requests 10 | 11 | import com.facebook.AccessToken.Companion.getCurrentAccessToken 12 | import com.facebook.GraphRequest 13 | import com.facebook.GraphRequest.Companion.newGraphPathRequest 14 | import com.facebook.HttpMethod 15 | 16 | object PermissionRequest { 17 | private const val PERMISSIONS_ENDPOINT = "/me/permissions" 18 | private const val APP = "app" 19 | 20 | @JvmStatic 21 | fun makeRevokePermRequest(permission: String, callback: GraphRequest.Callback?) { 22 | val graphPath = 23 | if (permission == APP) { 24 | PERMISSIONS_ENDPOINT 25 | } else { 26 | "$PERMISSIONS_ENDPOINT/$permission" 27 | } 28 | val request = newGraphPathRequest(getCurrentAccessToken(), graphPath, callback) 29 | request.httpMethod = HttpMethod.DELETE 30 | request.executeAsync() 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/java/com/facebook/fbloginsample/requests/UserRequest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | package com.facebook.fbloginsample.requests 9 | 10 | import android.os.Bundle 11 | import com.facebook.AccessToken.Companion.getCurrentAccessToken 12 | import com.facebook.GraphRequest 13 | import com.facebook.HttpMethod.GET 14 | 15 | object UserRequest { 16 | private const val ME_ENDPOINT = "/me" 17 | 18 | fun makeUserRequest(callback: GraphRequest.Callback?) { 19 | val params = Bundle() 20 | params.putString("fields", "picture,name,id,email,permissions") 21 | val request = GraphRequest(getCurrentAccessToken(), ME_ENDPOINT, params, GET, callback) 22 | request.executeAsync() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/drawable/placeholder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/FBLoginSample/src/main/res/drawable/placeholder.jpg -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/layout/activity_facebook_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 23 | 24 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/FBLoginSample/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/FBLoginSample/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/FBLoginSample/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/FBLoginSample/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/FBLoginSample/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/FBLoginSample/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/FBLoginSample/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/FBLoginSample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/FBLoginSample/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/FBLoginSample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | #3F51B5 12 | #303F9F 13 | #FF4081 14 | 15 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 4dp 3 | 4dp 4 | 2dp 5 | 4dp 6 | 7 | 18sp 8 | 14sp 9 | 10 | 11 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | FB Login Sample 4 | ENTER_YOUR_FB_APP_ID_HERE 5 | 6 | ENTER_YOUR_FB_CLIENT_TOKEN_HERE 7 | fb{ENTER_YOUR_FB_APP_ID_HERE} 8 | 9 | 10 | Posts 11 | Logout 12 | Compose a post 13 | Profile 14 | Permissions 15 | Email Permission 16 | User Posts Permission 17 | Make Post Permission 18 | Entire App Permission 19 | Permissions Granted without FB Review 20 | Permissions Requiring FB Review 21 | Email permission not granted 22 | 23 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/FBLoginSample/src/test/java/com/facebook/fbloginsample/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.fbloginsample 10 | 11 | import org.junit.Assert.assertEquals 12 | import org.junit.Test 13 | 14 | /** 15 | * Example local unit test, which will execute on the development machine (host). 16 | * 17 | * See [testing documentation](http://d.android.com/tools/testing). 18 | */ 19 | class ExampleUnitTest { 20 | @Test 21 | fun addition_isCorrect() { 22 | assertEquals(4, 2 + 2) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/HelloFacebookSample/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 | -------------------------------------------------------------------------------- /samples/HelloFacebookSample/res/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/HelloFacebookSample/res/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /samples/HelloFacebookSample/res/drawable-mdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/HelloFacebookSample/res/drawable-mdpi/icon.png -------------------------------------------------------------------------------- /samples/HelloFacebookSample/res/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/HelloFacebookSample/res/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /samples/HelloFacebookSample/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/HelloFacebookSample/res/drawable/icon.png -------------------------------------------------------------------------------- /samples/HelloFacebookSample/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | HelloFacebookSample 12 | HelloFBSample 13 | Cancelled 14 | Unable to perform selected action because permissions were not granted. 15 | OK 16 | Hello %1$s! 17 | Success 18 | Post ID: %1$s 19 | Error 20 | Updating status for %1$s at %2$s 21 | Photo Post 22 | You picked: 23 | <No friends selected> 24 | <No place selected> 25 | Pick a Seattle Place 26 | 355198514515820 27 | fb355198514515820 28 | Exception: %1$s 29 | 30 | -------------------------------------------------------------------------------- /samples/HelloFacebookSample/src/com/example/hellofacebook/HelloFacebookBroadcastReceiver.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.example.hellofacebook; 10 | 11 | import android.os.Bundle 12 | import android.util.Log 13 | import com.facebook.FacebookBroadcastReceiver 14 | 15 | /** 16 | * This is a simple example to demonstrate how an app could extend FacebookBroadcastReceiver to 17 | * handle notifications that long-running operations such as photo uploads have finished. 18 | */ 19 | class HelloFacebookBroadcastReceiver: FacebookBroadcastReceiver() { 20 | override fun onSuccessfulAppCall(appCallId: String, action: String, extras: Bundle) { 21 | // A real app could update UI or notify the user that their photo was uploaded. 22 | Log.d("HelloFacebook", "Photo uploaded by call $appCallId succeeded.") 23 | } 24 | 25 | override fun onFailedAppCall(appCallId: String, action: String, extras: Bundle) { 26 | // A real app could update UI or notify the user that their photo was not uploaded. 27 | Log.d("HelloFacebook", "Photo uploaded by call $appCallId failed.") 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /samples/KotlinSampleApp/README.md: -------------------------------------------------------------------------------- 1 | KotlinSampleApp 2 | === 3 | This is the new Facebook Android SDK sample app. It features: 4 | * Fully Kotlin 5 | * Using Jetpack Compose to follow the latest Android developing best practice. 6 | * Containing most widely-used features including login, sharing and AppEvents. 7 | * Compatible with the latest Facebook Android SDK. 8 | 9 | ## Usage 10 | Please open [string.xml](res/values/strings.xml) and follow the instructions in its comment to add 11 | the App ID and the client token before building this sample App. 12 | 13 | We recommend to build it with Android Studio Arctic Fox or newer versions. You can download it from 14 | [Android Studio homepage](https://developer.android.com/studio). 15 | 16 | ## Feedback and Questions 17 | Feedback and pull requests are welcomed! You can simply create an issue or submit a pull request on 18 | our Github repo. 19 | 20 | If you have any questions about the Facebook Platform, you can contact 21 | [Facebook Developer Support](https://developers.facebook.com/support/). 22 | -------------------------------------------------------------------------------- /samples/KotlinSampleApp/gradle.properties: -------------------------------------------------------------------------------- 1 | android.useAndroidX=true 2 | -------------------------------------------------------------------------------- /samples/KotlinSampleApp/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/KotlinSampleApp/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Sep 09 16:18:04 PDT 2019 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-6.7.1-bin.zip 7 | 8 | -------------------------------------------------------------------------------- /samples/KotlinSampleApp/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/ic_launcher-playstore.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/drawable/black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/drawable/black.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/drawable/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/drawable/green.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/drawable/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/drawable/red.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/drawable/user_picture_placeholder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/drawable/user_picture_placeholder.jpg -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/raw/test.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/samples/KotlinSampleApp/res/raw/test.mp4 -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #415E9B 4 | -------------------------------------------------------------------------------- /samples/KotlinSampleApp/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 12 | 13 | KotlinSampleApp 14 | {app_id} 15 | fb{app_id} 16 | {client_token} 17 | com.facebook.app.FacebookContentProvider{app_id} 18 | 19 | -------------------------------------------------------------------------------- /samples/KotlinSampleApp/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':KotlinSampleApp' 2 | -------------------------------------------------------------------------------- /samples/KotlinSampleApp/src/com/facebook/samples/kotlinsampleapp/MainActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.samples.kotlinsampleapp 10 | 11 | import android.os.Bundle 12 | import androidx.activity.compose.setContent 13 | import androidx.activity.viewModels 14 | import androidx.appcompat.app.AppCompatActivity 15 | import com.facebook.samples.kotlinsampleapp.home.HomeViewModel 16 | 17 | class MainActivity : AppCompatActivity() { 18 | 19 | override fun onCreate(savedInstanceState: Bundle?) { 20 | super.onCreate(savedInstanceState) 21 | val homeViewModel: HomeViewModel by viewModels() 22 | setContent { App(homeViewModel) } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/KotlinSampleApp/src/com/facebook/samples/kotlinsampleapp/SampleApplication.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.samples.kotlinsampleapp 10 | 11 | import android.app.Application 12 | import com.facebook.appevents.AppEventsLogger 13 | 14 | class SampleApplication : Application() { 15 | override fun onCreate() { 16 | super.onCreate() 17 | AppEventsLogger.activateApp(this) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /samples/KotlinSampleApp/src/com/facebook/samples/kotlinsampleapp/appevents/AppEventsScreen.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | package com.facebook.samples.kotlinsampleapp.appevents 10 | 11 | import android.content.Context 12 | import androidx.compose.foundation.layout.Arrangement 13 | import androidx.compose.foundation.layout.Column 14 | import androidx.compose.foundation.layout.padding 15 | import androidx.compose.material.Text 16 | import androidx.compose.runtime.Composable 17 | import androidx.compose.ui.Modifier 18 | import androidx.compose.ui.platform.LocalContext 19 | import androidx.compose.ui.unit.dp 20 | import com.facebook.appevents.AppEventsLogger 21 | import com.facebook.samples.kotlinsampleapp.common.MenuItem 22 | 23 | @Composable 24 | fun AppEventScreen() { 25 | val context = LocalContext.current 26 | val logEvent = { ctx: Context, eventName: String -> 27 | AppEventsLogger.newLogger(ctx).logEvent(eventName) 28 | } 29 | 30 | Column(verticalArrangement = Arrangement.spacedBy(4.dp), modifier = Modifier.padding(16.dp)) { 31 | Text("This screen shows how to emit custom events using FB SDK") 32 | MenuItem("Log event", onClick = { logEvent(context, "EMIT_EVENT_CLICK") }) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /scripts/build_fbsdk_documentation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (c) Meta Platforms, Inc. and affiliates. 4 | # All rights reserved. 5 | # 6 | # This source code is licensed under the license found in the 7 | # LICENSE file in the root directory of this source tree. 8 | 9 | # This script builds the API documentation from source-level comments. 10 | 11 | pushd "$(dirname ${BASH_SOURCE[0]})" > /dev/null || exit 1 12 | FB_SDK_SCRIPT=$(pwd) 13 | popd >/dev/null || exit 1 14 | FB_SDK_ROOT=$(dirname "$FB_SDK_SCRIPT") 15 | 16 | DOC_OUT_FOLDER="$FB_SDK_ROOT/out/docs" 17 | mkdir -p "$DOC_OUT_FOLDER" 18 | 19 | cd "$FB_SDK_ROOT" || exit 1 20 | ./gradlew facebook:dokkaJavadoc 21 | cd "$FB_SDK_ROOT/facebook/build/dokka/" || exit 1 22 | cp -r javadoc "$DOC_OUT_FOLDER/facebook" 23 | cd "$DOC_OUT_FOLDER" || exit 1 24 | zip --quiet --recurse-paths facebook.zip facebook 25 | 26 | echo "" 27 | echo "Generated docs in $DOC_OUT_FOLDER/facebook" 28 | echo "... zipped as $DOC_OUT_FOLDER/facebook.zip" 29 | echo "" 30 | -------------------------------------------------------------------------------- /scripts/cleanup_code_formatting.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) Meta Platforms, Inc. and affiliates. 4 | # All rights reserved. 5 | # 6 | # This source code is licensed under the license found in the 7 | # LICENSE file in the root directory of this source tree. 8 | 9 | 10 | # This script runs a few shell commands for additional code formatting cleanup 11 | 12 | # cd up one level if run from the scripts dir 13 | CURRENT_DIR_NAME="${PWD##*/}" 14 | if [ "$CURRENT_DIR_NAME" = "scripts" ]; then 15 | cd .. 16 | fi 17 | 18 | # Convert functions that return a single expression to single-expression functions 19 | # https://kotlinlang.org/docs/functions.html#single-expression-functions 20 | find . -name '*.kt' -print0 | xargs -0 perl -0777 -pi -e 's/(fun.*) {\n\s*return ([\w\.]+)\n\s*}/\1 = \2/g' 21 | 22 | # Ensure a blank line above the package statement 23 | find . -name '*.kt' -print0 | xargs -0 perl -0777 -pi -e 's/( \*\/)\n(package)/\1\n\n\2/g' 24 | -------------------------------------------------------------------------------- /secring.gpg.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/facebook/facebook-android-sdk/ade6cec4c97be018302f1ba3da5a8ccae1118c3c/secring.gpg.enc -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | // Facebook SDK 10 | include(":facebook-testutil") 11 | 12 | include(":facebook-core") 13 | 14 | include(":facebook-bolts") 15 | 16 | include( 17 | ":facebook-common", 18 | ":facebook-login", 19 | ":facebook-share", 20 | ":facebook-applinks", 21 | ":facebook-messenger") 22 | 23 | include(":facebook-livestreaming") // @fb-only 24 | 25 | include(":facebook-beta") // @fb-only 26 | 27 | include(":facebook-gamingservices") 28 | 29 | include(":facebook") 30 | 31 | // Samples 32 | include(":samples:HelloFacebookSample") 33 | 34 | include(":samples:Iconicus") 35 | 36 | include(":samples:LoginSample") // @fb-only 37 | 38 | include(":samples:Scrumptious") 39 | 40 | include(":samples:FBLoginSample") 41 | 42 | include(":samples:KotlinSampleApp") 43 | 44 | if (file("internal/internal-settings.gradle").exists()) { 45 | apply("internal/internal-settings.gradle") 46 | } 47 | 48 | if (file("local.gradle").exists()) { 49 | apply("local.gradle") 50 | } 51 | 52 | project(":facebook-beta").projectDir = File("internal/facebook-beta") // @fb-only 53 | --------------------------------------------------------------------------------