├── .gitignore
├── LICENSE.txt
├── README.md
└── facebook
├── AndroidManifest.xml
├── pom.xml
├── project.properties
├── res
├── drawable-hdpi
│ ├── com_facebook_button_blue_focused.9.png
│ ├── com_facebook_button_blue_normal.9.png
│ ├── com_facebook_button_blue_pressed.9.png
│ ├── com_facebook_button_grey_focused.9.png
│ ├── com_facebook_button_grey_normal.9.png
│ ├── com_facebook_button_grey_pressed.9.png
│ ├── com_facebook_close.png
│ ├── com_facebook_inverse_icon.png
│ ├── com_facebook_logo.png
│ ├── com_facebook_picker_magnifier.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-ldpi
│ └── com_facebook_close.png
├── drawable-mdpi
│ ├── com_facebook_button_blue_focused.9.png
│ ├── com_facebook_button_blue_normal.9.png
│ ├── com_facebook_button_blue_pressed.9.png
│ ├── com_facebook_inverse_icon.png
│ ├── com_facebook_picker_magnifier.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_button_blue_focused.9.png
│ ├── com_facebook_button_blue_normal.9.png
│ ├── com_facebook_button_blue_pressed.9.png
│ ├── com_facebook_button_grey_focused.9.png
│ ├── com_facebook_button_grey_normal.9.png
│ ├── com_facebook_button_grey_pressed.9.png
│ ├── com_facebook_close.png
│ ├── com_facebook_inverse_icon.png
│ ├── com_facebook_logo.png
│ ├── com_facebook_picker_magnifier.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
│ ├── com_facebook_button_blue.xml
│ ├── com_facebook_button_blue_focused.9.png
│ ├── com_facebook_button_blue_normal.9.png
│ ├── com_facebook_button_blue_pressed.9.png
│ ├── com_facebook_button_check.xml
│ ├── com_facebook_button_check_off.png
│ ├── com_facebook_button_check_on.png
│ ├── com_facebook_button_grey_focused.9.png
│ ├── com_facebook_button_grey_normal.9.png
│ ├── com_facebook_button_grey_pressed.9.png
│ ├── com_facebook_close.png
│ ├── com_facebook_inverse_icon.png
│ ├── com_facebook_list_divider.9.png
│ ├── com_facebook_list_section_header_background.9.png
│ ├── com_facebook_loginbutton_silver.xml
│ ├── com_facebook_logo.png
│ ├── com_facebook_picker_item_background.xml
│ ├── com_facebook_picker_list_focused.9.png
│ ├── com_facebook_picker_list_longpressed.9.png
│ ├── com_facebook_picker_list_pressed.9.png
│ ├── com_facebook_picker_list_selector.xml
│ ├── com_facebook_picker_list_selector_background_transition.xml
│ ├── com_facebook_picker_list_selector_disabled.9.png
│ ├── com_facebook_picker_top_button.xml
│ ├── com_facebook_place_default_icon.png
│ ├── com_facebook_profile_default_icon.png
│ ├── com_facebook_profile_picture_blank_portrait.png
│ ├── com_facebook_profile_picture_blank_square.png
│ ├── com_facebook_top_background.xml
│ ├── com_facebook_top_button.xml
│ └── com_facebook_usersettingsfragment_background_gradient.xml
├── layout
│ ├── com_facebook_friendpickerfragment.xml
│ ├── com_facebook_login_activity_layout.xml
│ ├── com_facebook_picker_activity_circle_row.xml
│ ├── com_facebook_picker_checkbox.xml
│ ├── com_facebook_picker_image.xml
│ ├── com_facebook_picker_list_row.xml
│ ├── com_facebook_picker_list_section_header.xml
│ ├── com_facebook_picker_search_box.xml
│ ├── com_facebook_picker_title_bar.xml
│ ├── com_facebook_picker_title_bar_stub.xml
│ ├── com_facebook_placepickerfragment.xml
│ ├── com_facebook_placepickerfragment_list_row.xml
│ ├── com_facebook_search_bar_layout.xml
│ ├── com_facebook_tooltip_bubble.xml
│ └── com_facebook_usersettingsfragment.xml
├── values-es
│ └── strings.xml
├── values-hdpi
│ └── dimens.xml
├── values-he
│ └── strings.xml
├── values-iw
│ └── strings.xml
├── values-ldpi
│ └── dimens.xml
├── values-mdpi
│ └── dimens.xml
├── values-xhdpi
│ └── dimens.xml
└── values
│ ├── attrs.xml
│ ├── colors.xml
│ ├── drawables.xml
│ ├── strings.xml
│ └── styles.xml
└── src
└── main
└── java
└── com
└── facebook
├── AccessToken.java
├── AccessTokenSource.java
├── AppEventsConstants.java
├── AppEventsLogger.java
├── AppLinkData.java
├── AuthorizationClient.java
├── BoltsMeasurementEventListener.java
├── FacebookAppLinkResolver.java
├── FacebookAuthorizationException.java
├── FacebookBroadcastReceiver.java
├── FacebookDialogException.java
├── FacebookException.java
├── FacebookGraphObjectException.java
├── FacebookOperationCanceledException.java
├── FacebookRequestError.java
├── FacebookSdkVersion.java
├── FacebookServiceException.java
├── FacebookTimeSpentData.java
├── GetTokenClient.java
├── HttpMethod.java
├── InsightsLogger.java
├── LegacyHelper.java
├── LoggingBehavior.java
├── LoginActivity.java
├── NativeAppCallAttachmentStore.java
├── NativeAppCallContentProvider.java
├── NonCachingTokenCachingStrategy.java
├── ProgressNoopOutputStream.java
├── ProgressOutputStream.java
├── Request.java
├── RequestAsyncTask.java
├── RequestBatch.java
├── RequestOutputStream.java
├── RequestProgress.java
├── Response.java
├── Session.java
├── SessionDefaultAudience.java
├── SessionLoginBehavior.java
├── SessionState.java
├── Settings.java
├── SharedPreferencesTokenCachingStrategy.java
├── TestSession.java
├── TokenCachingStrategy.java
├── UiLifecycleHelper.java
├── android
├── AsyncFacebookRunner.java
├── DialogError.java
├── Facebook.java
├── FacebookError.java
├── FbDialog.java
└── Util.java
├── internal
├── AnalyticsEvents.java
├── AttributionIdentifiers.java
├── CacheableRequestBatch.java
├── FileLruCache.java
├── ImageDownloader.java
├── ImageRequest.java
├── ImageResponse.java
├── ImageResponseCache.java
├── Logger.java
├── NativeProtocol.java
├── PlatformServiceClient.java
├── ServerProtocol.java
├── SessionAuthorizationType.java
├── SessionTracker.java
├── UrlRedirectCache.java
├── Utility.java
├── Validate.java
├── WorkQueue.java
└── package-info.java
├── model
├── CreateGraphObject.java
├── GraphLocation.java
├── GraphMultiResult.java
├── GraphObject.java
├── GraphObjectList.java
├── GraphPlace.java
├── GraphUser.java
├── JsonUtil.java
├── OpenGraphAction.java
├── OpenGraphObject.java
└── PropertyName.java
└── widget
├── FacebookDialog.java
├── FacebookFragment.java
├── FriendPickerFragment.java
├── GraphObjectAdapter.java
├── GraphObjectCursor.java
├── GraphObjectPagingLoader.java
├── LoginButton.java
├── PickerFragment.java
├── PlacePickerFragment.java
├── ProfilePictureView.java
├── SimpleGraphObjectCursor.java
├── ToolTipPopup.java
├── UserSettingsFragment.java
└── WebDialog.java
/.gitignore:
--------------------------------------------------------------------------------
1 | .classpath
2 | .project
3 | .settings/
4 | target/
5 | gen/
6 | bin/
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Facebook Android SDK for Maven & Gradle
2 |
3 | Current port is based on the v3.18.0 available at https://developers.facebook.com/android/
4 | The API is packaged as an **aar** and available from Maven Central Repository for use with **Maven** or **Gradle**.
5 |
6 | [](https://coinbase.com/checkouts/0c34d3ca1be50e54a20bc83446b4db00)
7 |
8 | ###How to use
9 |
10 | ####Maven
11 |
12 | The **aar** dependency requires the use of the maven-android-plugin 3.8.1+ with maven 3.1.1+ :
13 |
14 | ```xml
15 |
16 | fr.avianey
17 | facebook-android-api
18 | 3.18.0
19 | aar
20 |
21 | ```
22 |
23 | If you want to use a newer version of the android-support-v4 dependency, exclude the old one with this line :
24 |
25 | ```xml
26 |
27 | fr.avianey
28 | facebook-android-api
29 | ...
30 |
31 |
32 | support-v4
33 | com.google.android
34 |
35 |
36 |
37 | ```
38 |
39 | You might want to add the **jar** dependency as well to support code completion in Eclipse ADT. Adding the **jar** will result in **DEX** errors at build time as the Facebook API classes will be added twice to the generated **apk**. To solve the problem, build your project from command line and reference the **jar** dependency in the **m2e** (Eclipse only) Maven profile :
40 |
41 | ```xml
42 |
43 |
44 | m2e
45 |
46 |
47 | m2e.version
48 |
49 |
50 |
51 |
52 | fr.avianey
53 | facebook-android-api
54 | 3.18.0
55 | jar
56 |
57 |
58 | support-v4
59 | com.google.android
60 |
61 |
62 |
63 |
64 |
65 |
66 | ```
67 |
68 | ####Gradle
69 |
70 | Add the following dependency to your build.gradle
71 |
72 | ```javascript
73 | dependencies {
74 | compile 'fr.avianey:facebook-android-api:+@aar'
75 | // other dependencies
76 | }
77 | ```
78 |
79 | If you want to use a newer version of the android-support-v4 dependency, exclude the old one with this line :
80 |
81 | ```javascript
82 | configurations.all {
83 | exclude group: 'com.google.android', module: 'support-v4', version: 'r7'
84 | // other configurations
85 | }
86 | ```
87 |
--------------------------------------------------------------------------------
/facebook/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/facebook/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | android.library=true
14 | # Project target.
15 | target=android-9
16 |
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_button_blue_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_button_blue_focused.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_button_blue_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_button_blue_normal.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_button_blue_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_button_blue_pressed.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_button_grey_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_button_grey_focused.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_button_grey_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_button_grey_normal.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_button_grey_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_button_grey_pressed.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_close.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_inverse_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_inverse_icon.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_logo.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_picker_magnifier.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_picker_magnifier.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_tooltip_black_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_tooltip_black_background.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_tooltip_black_bottomnub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_tooltip_black_bottomnub.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_tooltip_black_topnub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_tooltip_black_topnub.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_tooltip_black_xout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_tooltip_black_xout.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_tooltip_blue_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_tooltip_blue_background.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_tooltip_blue_bottomnub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_tooltip_blue_bottomnub.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_tooltip_blue_topnub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_tooltip_blue_topnub.png
--------------------------------------------------------------------------------
/facebook/res/drawable-hdpi/com_facebook_tooltip_blue_xout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-hdpi/com_facebook_tooltip_blue_xout.png
--------------------------------------------------------------------------------
/facebook/res/drawable-ldpi/com_facebook_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-ldpi/com_facebook_close.png
--------------------------------------------------------------------------------
/facebook/res/drawable-mdpi/com_facebook_button_blue_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-mdpi/com_facebook_button_blue_focused.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-mdpi/com_facebook_button_blue_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-mdpi/com_facebook_button_blue_normal.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-mdpi/com_facebook_button_blue_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-mdpi/com_facebook_button_blue_pressed.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-mdpi/com_facebook_inverse_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-mdpi/com_facebook_inverse_icon.png
--------------------------------------------------------------------------------
/facebook/res/drawable-mdpi/com_facebook_picker_magnifier.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-mdpi/com_facebook_picker_magnifier.png
--------------------------------------------------------------------------------
/facebook/res/drawable-mdpi/com_facebook_tooltip_black_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-mdpi/com_facebook_tooltip_black_background.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-mdpi/com_facebook_tooltip_black_bottomnub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-mdpi/com_facebook_tooltip_black_bottomnub.png
--------------------------------------------------------------------------------
/facebook/res/drawable-mdpi/com_facebook_tooltip_black_topnub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-mdpi/com_facebook_tooltip_black_topnub.png
--------------------------------------------------------------------------------
/facebook/res/drawable-mdpi/com_facebook_tooltip_black_xout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-mdpi/com_facebook_tooltip_black_xout.png
--------------------------------------------------------------------------------
/facebook/res/drawable-mdpi/com_facebook_tooltip_blue_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-mdpi/com_facebook_tooltip_blue_background.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-mdpi/com_facebook_tooltip_blue_bottomnub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-mdpi/com_facebook_tooltip_blue_bottomnub.png
--------------------------------------------------------------------------------
/facebook/res/drawable-mdpi/com_facebook_tooltip_blue_topnub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-mdpi/com_facebook_tooltip_blue_topnub.png
--------------------------------------------------------------------------------
/facebook/res/drawable-mdpi/com_facebook_tooltip_blue_xout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-mdpi/com_facebook_tooltip_blue_xout.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_button_blue_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_button_blue_focused.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_button_blue_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_button_blue_normal.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_button_blue_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_button_blue_pressed.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_button_grey_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_button_grey_focused.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_button_grey_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_button_grey_normal.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_button_grey_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_button_grey_pressed.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_close.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_inverse_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_inverse_icon.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_logo.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_picker_magnifier.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_picker_magnifier.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_tooltip_black_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_tooltip_black_background.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_tooltip_black_bottomnub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_tooltip_black_bottomnub.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_tooltip_black_topnub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_tooltip_black_topnub.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_tooltip_black_xout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_tooltip_black_xout.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_tooltip_blue_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_tooltip_blue_background.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_tooltip_blue_bottomnub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_tooltip_blue_bottomnub.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_tooltip_blue_topnub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_tooltip_blue_topnub.png
--------------------------------------------------------------------------------
/facebook/res/drawable-xhdpi/com_facebook_tooltip_blue_xout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable-xhdpi/com_facebook_tooltip_blue_xout.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_button_blue.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
14 |
18 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_button_blue_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_button_blue_focused.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_button_blue_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_button_blue_normal.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_button_blue_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_button_blue_pressed.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_button_check.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_button_check_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_button_check_off.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_button_check_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_button_check_on.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_button_grey_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_button_grey_focused.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_button_grey_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_button_grey_normal.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_button_grey_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_button_grey_pressed.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_close.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_inverse_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_inverse_icon.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_list_divider.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_list_divider.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_list_section_header_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_list_section_header_background.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_loginbutton_silver.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_logo.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_picker_item_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_picker_list_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_picker_list_focused.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_picker_list_longpressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_picker_list_longpressed.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_picker_list_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_picker_list_pressed.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_picker_list_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_picker_list_selector_background_transition.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_picker_list_selector_disabled.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_picker_list_selector_disabled.9.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_picker_top_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
23 |
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_place_default_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_place_default_icon.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_profile_default_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_profile_default_icon.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_profile_picture_blank_portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_profile_picture_blank_portrait.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_profile_picture_blank_square.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/avianey/facebook-api-android-maven/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/res/drawable/com_facebook_profile_picture_blank_square.png
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_top_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
23 |
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_top_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
21 |
23 |
25 |
27 |
28 |
--------------------------------------------------------------------------------
/facebook/res/drawable/com_facebook_usersettingsfragment_background_gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
24 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_friendpickerfragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
23 |
24 |
25 |
35 |
36 |
44 |
45 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_login_activity_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
15 |
16 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_picker_activity_circle_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
32 |
33 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_picker_checkbox.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
26 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_picker_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_picker_list_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
29 |
41 |
48 |
49 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_picker_list_section_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
35 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_picker_search_box.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
24 |
29 |
30 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_picker_title_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
40 |
46 |
63 |
64 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_picker_title_bar_stub.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_placepickerfragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
25 |
26 |
27 |
38 |
39 |
47 |
48 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_placepickerfragment_list_row.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
29 |
33 |
40 |
41 |
49 |
61 |
73 |
74 |
81 |
82 |
90 |
91 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_search_bar_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
15 |
31 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_tooltip_bubble.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
15 |
24 |
34 |
35 |
44 |
54 |
55 |
--------------------------------------------------------------------------------
/facebook/res/layout/com_facebook_usersettingsfragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
28 |
29 |
37 |
38 |
47 |
48 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/facebook/res/values-es/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | Aceptar
20 | Cerrar sesión
21 | Iniciar sesión con Facebook
22 | Sesión iniciada como: %1$s
23 | Sesión iniciada con Facebook
24 | Cerrar sesión
25 | Cancelar
26 | Logo de Facebook
27 | Iniciar sesión…
28 | Sesión iniciada
29 | No has iniciado sesión
30 | %1$s • %2$,d estuvieron aquí
31 | %1$s
32 | es:%1$,d estuvieron aquí
33 | Aceptar
34 | Elige Amigos
35 | Cercano
36 | Cargando
37 | Error de AndroidManifest
38 | WebView inicio de sesión requiere permiso INTERNET
39 | Por favor, iniciar sesión a través https://www.facebook.com o https://m.facebook.com para volver a activar la aplicación para conectar con Facebook.
40 | La aplicación no se conecta con Facebook, inicie sesión y volver a conectar esta aplicación.
41 | Su contraseña de Facebook ha cambiado, por favor vuelva a conectar la aplicación con Facebook.
42 | Se produjo un error al conectar con Facebook, por favor vuelva a conectar la aplicación con Facebook.
43 | Una conexión de aplicación con Facebook falló debido a permisos insuficientes, por favor, conceda los permisos de aplicaciones para realizar la operación.
44 |
45 |
--------------------------------------------------------------------------------
/facebook/res/values-hdpi/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1px
4 |
--------------------------------------------------------------------------------
/facebook/res/values-he/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | התנתק
20 | התחבר לפייסבוק
21 | מחובר בשם: %1$s
22 | מחובר באמצעות פייסבוק
23 | התנתק
24 | בטל
25 | פייסבוק לוגו
26 | התחבר…
27 | מחובר
28 | לא מחובר
29 | %1$s • %2$,d היו פה
30 | %1$s
31 | %1$,d היו פה
32 | בצע
33 | בחר חברים
34 | קרוב אליי
35 | ..מעלה
36 | AndroidManifest שגיאת
37 | ההתחברות לתצוגת אתר דורשת אישור אינטרנט
38 | .כדי לאפשר מחדש לאפליקציה להתחבר עם פייסבוק https://www.facebook.com או https://m.facebook.com אנא היכנס דרך
39 | .האפליקציה אינה מחוברת לפייסבוק, אנא היכנס וחבר מחדש את האפליקציה
40 | .הסיסמה שלך בפייסבוק השתנתה, אנא חבר מחדש את האפליקציה עם פייסבוק
41 | .ארעה שגיאה בעת החיבור עם פייסבוק, חבר בבקשה מחדש את האפליקציה עם פייסבוק
42 | .חיבור האפליקציה עם פייסבוק נכשל בשל הרשאות לא מספקות, אנא הענק הרשאות לאפליקציה בכדי שהפעולה תוכל להתבצע
43 | אישור
44 |
45 |
--------------------------------------------------------------------------------
/facebook/res/values-iw/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | התנתק
20 | התחבר לפייסבוק
21 | מחובר בשם: %1$s
22 | מחובר באמצעות פייסבוק
23 | התנתק
24 | בטל
25 | פייסבוק לוגו
26 | התחבר…
27 | מחובר
28 | לא מחובר
29 | %1$s • %2$,d היו פה
30 | %1$s
31 | %1$,d היו פה
32 | בצע
33 | בחר חברים
34 | קרוב אליי
35 | ..מעלה
36 | AndroidManifest שגיאת
37 | ההתחברות לתצוגת אתר דורשת אישור אינטרנט
38 | .כדי לאפשר מחדש לאפליקציה להתחבר עם פייסבוק https://www.facebook.com או https://m.facebook.com אנא היכנס דרך
39 | .האפליקציה אינה מחוברת לפייסבוק, אנא היכנס וחבר מחדש את האפליקציה
40 | .הסיסמה שלך בפייסבוק השתנתה, אנא חבר מחדש את האפליקציה עם פייסבוק
41 | .ארעה שגיאה בעת החיבור עם פייסבוק, חבר בבקשה מחדש את האפליקציה עם פייסבוק
42 | .חיבור האפליקציה עם פייסבוק נכשל בשל הרשאות לא מספקות, אנא הענק הרשאות לאפליקציה בכדי שהפעולה תוכל להתבצע
43 | אישור
44 |
45 |
--------------------------------------------------------------------------------
/facebook/res/values-ldpi/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1px
4 |
--------------------------------------------------------------------------------
/facebook/res/values-mdpi/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1px
4 |
--------------------------------------------------------------------------------
/facebook/res/values-xhdpi/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 2px
4 |
--------------------------------------------------------------------------------
/facebook/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/facebook/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 64dp
4 | #f5f5f7
5 | #bcbdc2
6 |
--------------------------------------------------------------------------------
/facebook/res/values/drawables.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #33464c59
4 |
--------------------------------------------------------------------------------
/facebook/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | OK
20 | Log out
21 | Log in with Facebook
22 | Logged in as: %1$s
23 | Logged in using Facebook
24 | Log out
25 | Cancel
26 | Facebook Logo
27 | Log in…
28 | Logged in
29 | Not logged in
30 | %1$s • %2$,d were here
31 | %1$s
32 | %1$,d were here
33 | Done
34 | Choose Friends
35 | Nearby
36 | Loading...
37 | AndroidManifest Error
38 | WebView login requires INTERNET permission
39 | Your Facebook account is locked. Please log into www.facebook.com to continue.
40 | Please log into this app again to reconnect your Facebook account.
41 | Your Facebook password has changed. Please log into this app again to reconnect your Facebook account.
42 | Please log into this app again to reconnect your Facebook account.
43 | This app doesn’t have permission to do this. To change permissions, try logging into the app again.
44 | New! You\'re in control - choose what info you want to share with apps.
45 |
46 |
--------------------------------------------------------------------------------
/facebook/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | #3B5998
20 |
21 | #FFFFFF
22 | #000000
23 | #A6AED7
24 | 64dp
25 | 64dp
26 |
27 | 12dip
28 | 16dp
29 | 12dp
30 | 12dp
31 | 12dp
32 | #FFFFFF
33 | 16.0sp
34 |
35 | 50dp
36 | 100dp
37 | 180dp
38 |
39 | 10dp
40 |
41 |
51 |
52 |
61 |
62 |
70 |
71 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/AccessTokenSource.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | /**
20 | * Indicates where a Facebook access token was obtained from.
21 | */
22 | public enum AccessTokenSource {
23 | /**
24 | * Indicates an access token has not been obtained, or is otherwise invalid.
25 | */
26 | NONE(false),
27 | /**
28 | * Indicates an access token was obtained by the user logging in through the
29 | * Facebook app for Android using the web login dialog.
30 | */
31 | FACEBOOK_APPLICATION_WEB(true),
32 | /**
33 | * Indicates an access token was obtained by the user logging in through the
34 | * Facebook app for Android using the native login dialog.
35 | */
36 | FACEBOOK_APPLICATION_NATIVE(true),
37 | /**
38 | * Indicates an access token was obtained by asking the Facebook app for the
39 | * current token based on permissions the user has already granted to the app.
40 | * No dialog was shown to the user in this case.
41 | */
42 | FACEBOOK_APPLICATION_SERVICE(true),
43 | /**
44 | * Indicates an access token was obtained by the user logging in through the
45 | * Web-based dialog.
46 | */
47 | WEB_VIEW(false),
48 | /**
49 | * Indicates an access token is for a test user rather than an actual
50 | * Facebook user.
51 | */
52 | TEST_USER(true),
53 | /**
54 | * Indicates an access token constructed with a Client Token.
55 | */
56 | CLIENT_TOKEN(true);
57 |
58 | private final boolean canExtendToken;
59 |
60 | AccessTokenSource(boolean canExtendToken) {
61 | this.canExtendToken = canExtendToken;
62 | }
63 |
64 | boolean canExtendToken() {
65 | return canExtendToken;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/BoltsMeasurementEventListener.java:
--------------------------------------------------------------------------------
1 | package com.facebook;
2 |
3 | import android.content.BroadcastReceiver;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.IntentFilter;
7 | import android.support.v4.content.LocalBroadcastManager;
8 |
9 | public class BoltsMeasurementEventListener extends BroadcastReceiver {
10 | private static BoltsMeasurementEventListener _instance;
11 |
12 | private final static String MEASUREMENT_EVENT_NOTIFICATION_NAME = "com.parse.bolts.measurement_event";
13 | private final static String MEASUREMENT_EVENT_NAME_KEY = "event_name";
14 | private final static String MEASUREMENT_EVENT_ARGS_KEY = "event_args";
15 | private final static String BOLTS_MEASUREMENT_EVENT_PREFIX = "bf_";
16 |
17 | private Context applicationContext;
18 |
19 | private BoltsMeasurementEventListener(Context context) {
20 | applicationContext = context.getApplicationContext();
21 | }
22 |
23 | private void open() {
24 | LocalBroadcastManager broadcastManager = LocalBroadcastManager.getInstance(applicationContext);
25 | broadcastManager.registerReceiver(this, new IntentFilter(MEASUREMENT_EVENT_NOTIFICATION_NAME));
26 | }
27 |
28 | private void close() {
29 | LocalBroadcastManager broadcastManager = LocalBroadcastManager.getInstance(applicationContext);
30 | broadcastManager.unregisterReceiver(this);
31 | }
32 |
33 | static BoltsMeasurementEventListener getInstance(Context context) {
34 | if (_instance != null) {
35 | return _instance;
36 | }
37 | _instance = new BoltsMeasurementEventListener(context);
38 | _instance.open();
39 | return _instance;
40 | }
41 |
42 | protected void finalize() throws Throwable {
43 | try {
44 | close();
45 | } finally {
46 | super.finalize();
47 | }
48 | }
49 |
50 | @Override
51 | public void onReceive(Context context, Intent intent) {
52 | AppEventsLogger appEventsLogger = AppEventsLogger.newLogger(context);
53 | String eventName = BOLTS_MEASUREMENT_EVENT_PREFIX + intent.getStringExtra(MEASUREMENT_EVENT_NAME_KEY);
54 | appEventsLogger.logEvent(eventName, intent.getBundleExtra(MEASUREMENT_EVENT_ARGS_KEY));
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/FacebookAuthorizationException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | /**
20 | * An Exception indicating that a Session failed to open or obtain new permissions.
21 | */
22 | public class FacebookAuthorizationException extends FacebookException {
23 | static final long serialVersionUID = 1;
24 |
25 | /**
26 | * Constructs a FacebookAuthorizationException with no additional
27 | * information.
28 | */
29 | public FacebookAuthorizationException() {
30 | super();
31 | }
32 |
33 | /**
34 | * Constructs a FacebookAuthorizationException with a message.
35 | *
36 | * @param message
37 | * A String to be returned from getMessage.
38 | */
39 | public FacebookAuthorizationException(String message) {
40 | super(message);
41 | }
42 |
43 | /**
44 | * Constructs a FacebookAuthorizationException with a message and inner
45 | * error.
46 | *
47 | * @param message
48 | * A String to be returned from getMessage.
49 | * @param throwable
50 | * A Throwable to be returned from getCause.
51 | */
52 | public FacebookAuthorizationException(String message, Throwable throwable) {
53 | super(message, throwable);
54 | }
55 |
56 | /**
57 | * Constructs a FacebookAuthorizationException with an inner error.
58 | *
59 | * @param throwable
60 | * A Throwable to be returned from getCause.
61 | */
62 | public FacebookAuthorizationException(Throwable throwable) {
63 | super(throwable);
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/FacebookBroadcastReceiver.java:
--------------------------------------------------------------------------------
1 | package com.facebook;
2 |
3 | import android.content.BroadcastReceiver;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.os.Bundle;
7 | import com.facebook.internal.NativeProtocol;
8 |
9 | /**
10 | * This class implements a simple BroadcastReceiver designed to listen for broadcast notifications from the
11 | * Facebook app. At present, these notifications consistent of success/failure notifications for photo upload
12 | * operations that happen in the background.
13 | *
14 | * Applications may subclass this class and register it in their AndroidManifest.xml, listening on the
15 | * com.facebook.platform.AppCallResultBroadcast action.
16 | */
17 | public class FacebookBroadcastReceiver extends BroadcastReceiver {
18 |
19 | @Override
20 | public void onReceive(Context context, Intent intent) {
21 | String appCallId = intent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_CALL_ID);
22 | String action = intent.getStringExtra(NativeProtocol.EXTRA_PROTOCOL_ACTION);
23 | if (appCallId != null && action != null) {
24 | Bundle extras = intent.getExtras();
25 |
26 | if (NativeProtocol.isErrorResult(intent)) {
27 | onFailedAppCall(appCallId, action, extras);
28 | } else {
29 | onSuccessfulAppCall(appCallId, action, extras);
30 | }
31 | }
32 | }
33 |
34 | protected void onSuccessfulAppCall(String appCallId, String action, Bundle extras) {
35 | // Default does nothing.
36 | }
37 |
38 | protected void onFailedAppCall(String appCallId, String action, Bundle extras) {
39 | // Default does nothing.
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/FacebookDialogException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | /**
20 | * Represents an error condition relating to displaying a Facebook Web dialog.
21 | */
22 | public class FacebookDialogException extends FacebookException {
23 | static final long serialVersionUID = 1;
24 | private int errorCode;
25 | private String failingUrl;
26 |
27 | /**
28 | * Constructs a new FacebookException.
29 | */
30 | public FacebookDialogException(String message, int errorCode, String failingUrl) {
31 | super(message);
32 | this.errorCode = errorCode;
33 | this.failingUrl = failingUrl;
34 | }
35 |
36 | /**
37 | * Gets the error code received by the WebView. See:
38 | * http://developer.android.com/reference/android/webkit/WebViewClient.html
39 | *
40 | * @return the error code
41 | */
42 | public int getErrorCode() {
43 | return errorCode;
44 | }
45 |
46 | /**
47 | * Gets the URL that the dialog was trying to load.
48 | * @return the URL
49 | */
50 | public String getFailingUrl() {
51 | return failingUrl;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/FacebookException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | /**
20 | * Represents an error condition specific to the Facebook SDK for Android.
21 | */
22 | public class FacebookException extends RuntimeException {
23 | static final long serialVersionUID = 1;
24 |
25 | /**
26 | * Constructs a new FacebookException.
27 | */
28 | public FacebookException() {
29 | super();
30 | }
31 |
32 | /**
33 | * Constructs a new FacebookException.
34 | *
35 | * @param message
36 | * the detail message of this exception
37 | */
38 | public FacebookException(String message) {
39 | super(message);
40 | }
41 |
42 | /**
43 | * Constructs a new FacebookException.
44 | *
45 | * @param message
46 | * the detail message of this exception
47 | * @param throwable
48 | * the cause of this exception
49 | */
50 | public FacebookException(String message, Throwable throwable) {
51 | super(message, throwable);
52 | }
53 |
54 | /**
55 | * Constructs a new FacebookException.
56 | *
57 | * @param throwable
58 | * the cause of this exception
59 | */
60 | public FacebookException(Throwable throwable) {
61 | super(throwable);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/FacebookGraphObjectException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | /**
20 | * Represents an error specific to the {@link com.facebook.model.GraphObject GraphObject} class.
21 | */
22 | public class FacebookGraphObjectException extends FacebookException {
23 | static final long serialVersionUID = 1;
24 |
25 | /**
26 | * Constructs a new FacebookGraphObjectException.
27 | */
28 | public FacebookGraphObjectException() {
29 | super();
30 | }
31 |
32 | /**
33 | * Constructs a new FacebookGraphObjectException.
34 | *
35 | * @param message
36 | * the detail message of this exception
37 | */
38 | public FacebookGraphObjectException(String message) {
39 | super(message);
40 | }
41 |
42 | /**
43 | * Constructs a new FacebookGraphObjectException.
44 | *
45 | * @param message
46 | * the detail message of this exception
47 | * @param throwable
48 | * the cause of this exception
49 | */
50 | public FacebookGraphObjectException(String message, Throwable throwable) {
51 | super(message, throwable);
52 | }
53 |
54 | /**
55 | * Constructs a new FacebookGraphObjectException.
56 | *
57 | * @param throwable
58 | * the cause of this exception
59 | */
60 | public FacebookGraphObjectException(Throwable throwable) {
61 | super(throwable);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/FacebookOperationCanceledException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | /**
20 | * An Exception indicating that an operation was canceled before it completed.
21 | */
22 | public class FacebookOperationCanceledException extends FacebookException {
23 | static final long serialVersionUID = 1;
24 |
25 | /**
26 | * Constructs a FacebookOperationCanceledException with no additional information.
27 | */
28 | public FacebookOperationCanceledException() {
29 | super();
30 | }
31 |
32 | /**
33 | * Constructs a FacebookOperationCanceledException with a message.
34 | *
35 | * @param message A String to be returned from getMessage.
36 | */
37 | public FacebookOperationCanceledException(String message) {
38 | super(message);
39 | }
40 |
41 | /**
42 | * Constructs a FacebookOperationCanceledException with a message and inner error.
43 | *
44 | * @param message A String to be returned from getMessage.
45 | * @param throwable A Throwable to be returned from getCause.
46 | */
47 | public FacebookOperationCanceledException(String message, Throwable throwable) {
48 | super(message, throwable);
49 | }
50 |
51 | /**
52 | * Constructs a FacebookOperationCanceledException with an inner error.
53 | *
54 | * @param throwable A Throwable to be returned from getCause.
55 | */
56 | public FacebookOperationCanceledException(Throwable throwable) {
57 | super(throwable);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/FacebookSdkVersion.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | final class FacebookSdkVersion {
20 | public static final String BUILD = "3.18.0";
21 | }
22 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/FacebookServiceException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | /**
20 | * Represents an error returned from the Facebook service in response to a request.
21 | */
22 | public class FacebookServiceException extends FacebookException {
23 |
24 | private final FacebookRequestError error;
25 |
26 | private static final long serialVersionUID = 1;
27 |
28 | /**
29 | * Constructs a new FacebookServiceException.
30 | *
31 | * @param error the error from the request
32 | */
33 | public FacebookServiceException(FacebookRequestError error, String errorMessage) {
34 | super(errorMessage);
35 | this.error = error;
36 | }
37 |
38 | /**
39 | * Returns an object that encapsulates complete information representing the error returned by Facebook.
40 | *
41 | * @return complete information representing the error.
42 | */
43 | public final FacebookRequestError getRequestError() {
44 | return error;
45 | }
46 |
47 | @Override
48 | public final String toString() {
49 | return new StringBuilder()
50 | .append("{FacebookServiceException: ")
51 | .append("httpResponseCode: ")
52 | .append(error.getRequestStatusCode())
53 | .append(", facebookErrorCode: ")
54 | .append(error.getErrorCode())
55 | .append(", facebookErrorType: ")
56 | .append(error.getErrorType())
57 | .append(", message: ")
58 | .append(error.getErrorMessage())
59 | .append("}")
60 | .toString();
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/GetTokenClient.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 |
20 | import android.content.Context;
21 | import android.os.Bundle;
22 | import com.facebook.internal.NativeProtocol;
23 | import com.facebook.internal.PlatformServiceClient;
24 |
25 | final class GetTokenClient extends PlatformServiceClient {
26 |
27 | GetTokenClient(Context context, String applicationId) {
28 | super(context, NativeProtocol.MESSAGE_GET_ACCESS_TOKEN_REQUEST, NativeProtocol.MESSAGE_GET_ACCESS_TOKEN_REPLY,
29 | NativeProtocol.PROTOCOL_VERSION_20121101, applicationId);
30 | }
31 |
32 | @Override
33 | protected void populateRequestBundle(Bundle data) {
34 | }
35 | }
36 |
37 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/HttpMethod.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | /**
20 | * Enumeration of HTTP methods supported by Request
21 | */
22 | public enum HttpMethod {
23 | /**
24 | * Use HTTP method "GET" for the request
25 | */
26 | GET,
27 |
28 | /**
29 | * Use HTTP method "POST" for the request
30 | */
31 | POST,
32 |
33 | /**
34 | * Use HTTP method "DELETE" for the request
35 | */
36 | DELETE,
37 | }
38 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/InsightsLogger.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | import android.content.Context;
20 | import android.os.Bundle;
21 | import com.facebook.internal.Logger;
22 |
23 | import java.math.BigDecimal;
24 | import java.util.Currency;
25 |
26 | /**
27 | * This class is deprecated. Please use {@link AppEventsLogger} instead.
28 | */
29 | @Deprecated
30 | public class InsightsLogger {
31 | private static final String EVENT_PARAMETER_PIXEL_ID = "fb_offsite_pixel_id";
32 | private static final String EVENT_PARAMETER_PIXEL_VALUE = "fb_offsite_pixel_value";
33 |
34 | private static final String EVENT_NAME_LOG_CONVERSION_PIXEL = "fb_log_offsite_pixel";
35 |
36 | private AppEventsLogger appEventsLogger;
37 |
38 | private InsightsLogger(Context context, String applicationId, Session session) {
39 | appEventsLogger = AppEventsLogger.newLogger(context, applicationId, session);
40 | }
41 |
42 | /**
43 | * Deprecated. Please use {@link AppEventsLogger} instead.
44 | */
45 | public static InsightsLogger newLogger(Context context, String clientToken) {
46 | return new InsightsLogger(context, null, null);
47 | }
48 |
49 | /**
50 | * Deprecated. Please use {@link AppEventsLogger} instead.
51 | */
52 | public static InsightsLogger newLogger(Context context, String clientToken, String applicationId) {
53 | return new InsightsLogger(context, applicationId, null);
54 | }
55 |
56 | /**
57 | * Deprecated. Please use {@link AppEventsLogger} instead.
58 | */
59 | public static InsightsLogger newLogger(Context context, String clientToken, String applicationId, Session session) {
60 | return new InsightsLogger(context, applicationId, session);
61 | }
62 |
63 | /**
64 | * Deprecated. Please use {@link AppEventsLogger} instead.
65 | */
66 | public void logPurchase(BigDecimal purchaseAmount, Currency currency) {
67 | logPurchase(purchaseAmount, currency, null);
68 | }
69 |
70 | /**
71 | * Deprecated. Please use {@link AppEventsLogger} instead.
72 | */
73 | public void logPurchase(BigDecimal purchaseAmount, Currency currency, Bundle parameters) {
74 | appEventsLogger.logPurchase(purchaseAmount, currency, parameters);
75 | }
76 |
77 | /**
78 | * Deprecated. Please use {@link AppEventsLogger} instead.
79 | */
80 | public void logConversionPixel(String pixelId, double valueOfPixel) {
81 |
82 | if (pixelId == null) {
83 | Logger.log(LoggingBehavior.DEVELOPER_ERRORS, "Insights", "pixelID cannot be null");
84 | return;
85 | }
86 |
87 | Bundle parameters = new Bundle();
88 | parameters.putString(EVENT_PARAMETER_PIXEL_ID, pixelId);
89 | parameters.putDouble(EVENT_PARAMETER_PIXEL_VALUE, valueOfPixel);
90 |
91 | appEventsLogger.logEvent(EVENT_NAME_LOG_CONVERSION_PIXEL, valueOfPixel, parameters);
92 | AppEventsLogger.eagerFlush();
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/LegacyHelper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | import android.os.Bundle;
20 |
21 | /**
22 | * LegacyHelper is solely for the use of other packages within the Facebook SDK for Android. Use of
23 | * any of the methods in this class is unsupported, and they may be modified or removed without warning at
24 | * any time.
25 | */
26 | public class LegacyHelper {
27 | @Deprecated
28 | public static void extendTokenCompleted(Session session, Bundle bundle) {
29 | session.extendTokenCompleted(bundle);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/LoggingBehavior.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | /**
20 | * Specifies different categories of logging messages that can be generated.
21 | *
22 | * @see Settings#addLoggingBehavior(LoggingBehavior)
23 | */
24 | public enum LoggingBehavior {
25 | /**
26 | * Indicates that HTTP requests and a summary of responses should be logged.
27 | */
28 | REQUESTS,
29 | /**
30 | * Indicates that access tokens should be logged as part of the request logging; normally they are not.
31 | */
32 | INCLUDE_ACCESS_TOKENS,
33 | /**
34 | * Indicates that the entire raw HTTP response for each request should be logged.
35 | */
36 | INCLUDE_RAW_RESPONSES,
37 | /**
38 | * Indicates that cache operations should be logged.
39 | */
40 | CACHE,
41 | /**
42 | * Indicates the App Events-related operations should be logged.
43 | */
44 | APP_EVENTS,
45 | /**
46 | * Indicates that likely developer errors should be logged. (This is set by default in LoggingBehavior.)
47 | */
48 | DEVELOPER_ERRORS
49 | ;
50 |
51 | @Deprecated
52 | public static final LoggingBehavior INSIGHTS = APP_EVENTS;
53 | }
54 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/NativeAppCallContentProvider.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | import android.content.ContentProvider;
20 | import android.content.ContentValues;
21 | import android.database.Cursor;
22 | import android.net.Uri;
23 | import android.os.ParcelFileDescriptor;
24 | import android.util.Log;
25 | import android.util.Pair;
26 |
27 | import java.io.File;
28 | import java.io.FileNotFoundException;
29 | import java.util.UUID;
30 |
31 | /**
32 | *
Implements a
33 | * ContentProvider that can be used to provide binary attachments (e.g., images) to calls made
34 | * via @link FacebookDialog}. The {@link NativeAppCallAttachmentStore} class provides methods to attach
35 | * and clean up the attachments.
36 | *
37 | *
Note that this ContentProvider is only necessary if an application wishes to attach images, etc., that are
38 | * stored in memory and do not have another way to be referenced by a content URI. For images obtained from,
39 | * e.g., the Camera or Gallery, that already have a content URI associated with them, use of this class is not
40 | * necessary.
41 | *
42 | *
If an application wishes to attach images that are stored in-memory within the application, this content
43 | * provider must be listed in the application's AndroidManifest.xml, and it should be named according to the
44 | * pattern "com.facebook.app.NativeAppCallContentProvider{FACEBOOK_APP_ID}". See the
45 | * {@link NativeAppCallContentProvider#getAttachmentUrl(String) getContentProviderName} method.
46 | */
47 | public class NativeAppCallContentProvider extends ContentProvider {
48 | private static final String TAG = NativeAppCallContentProvider.class.getName();
49 | private static final String ATTACHMENT_URL_BASE = "content://com.facebook.app.NativeAppCallContentProvider";
50 |
51 | private final AttachmentDataSource dataSource;
52 |
53 | public NativeAppCallContentProvider() {
54 | this(new NativeAppCallAttachmentStore());
55 | }
56 |
57 | NativeAppCallContentProvider(AttachmentDataSource dataSource) {
58 | this.dataSource = dataSource;
59 | }
60 |
61 | interface AttachmentDataSource {
62 | File openAttachment(UUID callId, String attachmentName) throws FileNotFoundException;
63 | }
64 |
65 | /**
66 | * Returns the name of the content provider formatted correctly for constructing URLs.
67 | * @param applicationId the Facebook application ID of the application
68 | * @return the String to use as the authority portion of a content URI.
69 | */
70 | public static String getAttachmentUrl(String applicationId, UUID callId, String attachmentName) {
71 | return String.format("%s%s/%s/%s", ATTACHMENT_URL_BASE, applicationId, callId.toString(), attachmentName);
72 | }
73 |
74 | @Override
75 | public boolean onCreate() {
76 | return true;
77 | }
78 |
79 | @Override
80 | public Cursor query(Uri uri, String[] strings, String s, String[] strings2, String s2) {
81 | return null;
82 | }
83 |
84 | @Override
85 | public String getType(Uri uri) {
86 | return null;
87 | }
88 |
89 | @Override
90 | public Uri insert(Uri uri, ContentValues contentValues) {
91 | return null;
92 | }
93 |
94 | @Override
95 | public int delete(Uri uri, String s, String[] strings) {
96 | return 0;
97 | }
98 |
99 | @Override
100 | public int update(Uri uri, ContentValues contentValues, String s, String[] strings) {
101 | return 0;
102 | }
103 |
104 | @Override
105 | public android.os.ParcelFileDescriptor openFile(android.net.Uri uri, java.lang.String mode)
106 | throws java.io.FileNotFoundException {
107 |
108 | Pair callIdAndAttachmentName = parseCallIdAndAttachmentName(uri);
109 | if (callIdAndAttachmentName == null) {
110 | throw new FileNotFoundException();
111 | }
112 |
113 | try {
114 | File file = dataSource.openAttachment(callIdAndAttachmentName.first, callIdAndAttachmentName.second);
115 |
116 | return ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
117 | } catch (FileNotFoundException exception) {
118 | Log.e(TAG, "Got unexpected exception:" + exception);
119 | throw exception;
120 | }
121 | }
122 |
123 | Pair parseCallIdAndAttachmentName(Uri uri) {
124 | try {
125 | // We don't do explicit format checking here. Malformed URIs may generate NullPointerExceptions or
126 | // array bounds exceptions, which we'll catch and return null. All of these will result in a
127 | // FileNotFoundException being thrown in openFile.
128 | String callIdAndAttachmentName = uri.getPath().substring(1);
129 | String [] parts = callIdAndAttachmentName.split("/");
130 |
131 | String callIdString = parts[0];
132 | String attachmentName = parts[1];
133 | UUID callId = UUID.fromString(callIdString);
134 |
135 | return new Pair(callId, attachmentName);
136 | } catch (Exception exception) {
137 | return null;
138 | }
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/NonCachingTokenCachingStrategy.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | import android.os.Bundle;
20 |
21 | /**
22 | * Implements a trivial {@link TokenCachingStrategy} that does not actually cache any tokens.
23 | * It is intended for use when an access token may be used on a temporary basis but should not be
24 | * cached for future use (for instance, when handling a deep link).
25 | */
26 | public class NonCachingTokenCachingStrategy extends TokenCachingStrategy {
27 | @Override
28 | public Bundle load() {
29 | return null;
30 | }
31 |
32 | @Override
33 | public void save(Bundle bundle) {
34 | }
35 |
36 | @Override
37 | public void clear() {
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/ProgressNoopOutputStream.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | import android.os.Handler;
20 |
21 | import java.io.OutputStream;
22 | import java.util.HashMap;
23 | import java.util.Map;
24 |
25 | class ProgressNoopOutputStream extends OutputStream implements RequestOutputStream {
26 | private final Map progressMap = new HashMap();
27 | private final Handler callbackHandler;
28 |
29 | private Request currentRequest;
30 | private RequestProgress currentRequestProgress;
31 | private int batchMax;
32 |
33 | ProgressNoopOutputStream(Handler callbackHandler) {
34 | this.callbackHandler = callbackHandler;
35 | }
36 |
37 | public void setCurrentRequest(Request currentRequest) {
38 | this.currentRequest = currentRequest;
39 | this.currentRequestProgress = currentRequest != null? progressMap.get(currentRequest) : null;
40 | }
41 |
42 | int getMaxProgress() {
43 | return batchMax;
44 | }
45 |
46 | Map getProgressMap() {
47 | return progressMap;
48 | }
49 |
50 | void addProgress(long size) {
51 | if (currentRequestProgress == null) {
52 | currentRequestProgress = new RequestProgress(callbackHandler, currentRequest);
53 | progressMap.put(currentRequest, currentRequestProgress);
54 | }
55 |
56 | currentRequestProgress.addToMax(size);
57 | batchMax += size;
58 | }
59 |
60 | @Override
61 | public void write(byte[] buffer) {
62 | addProgress(buffer.length);
63 | }
64 |
65 | @Override
66 | public void write(byte[] buffer, int offset, int length) {
67 | addProgress(length);
68 | }
69 |
70 | @Override
71 | public void write(int oneByte) {
72 | addProgress(1);
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/ProgressOutputStream.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | import android.os.Handler;
20 |
21 | import java.io.FilterOutputStream;
22 | import java.io.IOException;
23 | import java.io.OutputStream;
24 | import java.util.Map;
25 |
26 | class ProgressOutputStream extends FilterOutputStream implements RequestOutputStream {
27 | private final Map progressMap;
28 | private final RequestBatch requests;
29 | private final long threshold;
30 |
31 | private long batchProgress, lastReportedProgress, maxProgress;
32 | private RequestProgress currentRequestProgress;
33 |
34 | ProgressOutputStream(OutputStream out, RequestBatch requests, Map progressMap, long maxProgress) {
35 | super(out);
36 | this.requests = requests;
37 | this.progressMap = progressMap;
38 | this.maxProgress = maxProgress;
39 |
40 | this.threshold = Settings.getOnProgressThreshold();
41 | }
42 |
43 | private void addProgress(long size) {
44 | if (currentRequestProgress != null) {
45 | currentRequestProgress.addProgress(size);
46 | }
47 |
48 | batchProgress += size;
49 |
50 | if (batchProgress >= lastReportedProgress + threshold || batchProgress >= maxProgress) {
51 | reportBatchProgress();
52 | }
53 | }
54 |
55 | private void reportBatchProgress() {
56 | if (batchProgress > lastReportedProgress) {
57 | for (RequestBatch.Callback callback : requests.getCallbacks()) {
58 | if (callback instanceof RequestBatch.OnProgressCallback) {
59 | final Handler callbackHandler = requests.getCallbackHandler();
60 |
61 | // Keep copies to avoid threading issues
62 | final RequestBatch.OnProgressCallback progressCallback = (RequestBatch.OnProgressCallback) callback;
63 | if (callbackHandler == null) {
64 | progressCallback.onBatchProgress(requests, batchProgress, maxProgress);
65 | }
66 | else {
67 | callbackHandler.post(new Runnable() {
68 | @Override
69 | public void run() {
70 | progressCallback.onBatchProgress(requests, batchProgress, maxProgress);
71 | }
72 | });
73 | }
74 | }
75 | }
76 |
77 | lastReportedProgress = batchProgress;
78 | }
79 | }
80 |
81 | public void setCurrentRequest(Request request) {
82 | currentRequestProgress = request != null? progressMap.get(request) : null;
83 | }
84 |
85 | long getBatchProgress() {
86 | return batchProgress;
87 | }
88 |
89 | long getMaxProgress() {
90 | return maxProgress;
91 | }
92 |
93 | @Override
94 | public void write(byte[] buffer) throws IOException {
95 | out.write(buffer);
96 | addProgress(buffer.length);
97 | }
98 |
99 | @Override
100 | public void write(byte[] buffer, int offset, int length) throws IOException {
101 | out.write(buffer, offset, length);
102 | addProgress(length);
103 | }
104 |
105 | @Override
106 | public void write(int oneByte) throws IOException {
107 | out.write(oneByte);
108 | addProgress(1);
109 | }
110 |
111 | @Override
112 | public void close() throws IOException {
113 | super.close();
114 |
115 | for (RequestProgress p : progressMap.values()) {
116 | p.reportProgress();
117 | }
118 |
119 | reportBatchProgress();
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/RequestOutputStream.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | interface RequestOutputStream {
20 | void setCurrentRequest(Request r);
21 | }
22 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/RequestProgress.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | import android.os.Handler;
20 |
21 | class RequestProgress {
22 | private final Request request;
23 | private final Handler callbackHandler;
24 | private final long threshold;
25 |
26 | private long progress, lastReportedProgress, maxProgress;
27 |
28 | RequestProgress(Handler callbackHandler, Request request) {
29 | this.request = request;
30 | this.callbackHandler = callbackHandler;
31 |
32 | this.threshold = Settings.getOnProgressThreshold();
33 | }
34 |
35 | long getProgress() {
36 | return progress;
37 | }
38 |
39 | long getMaxProgress() {
40 | return maxProgress;
41 | }
42 |
43 | void addProgress(long size) {
44 | progress += size;
45 |
46 | if (progress >= lastReportedProgress + threshold || progress >= maxProgress) {
47 | reportProgress();
48 | }
49 | }
50 |
51 | void addToMax(long size) {
52 | maxProgress += size;
53 | }
54 |
55 | void reportProgress() {
56 | if (progress > lastReportedProgress) {
57 | Request.Callback callback = request.getCallback();
58 | if (maxProgress > 0 && callback instanceof Request.OnProgressCallback) {
59 | // Keep copies to avoid threading issues
60 | final long currentCopy = progress;
61 | final long maxProgressCopy = maxProgress;
62 | final Request.OnProgressCallback callbackCopy = (Request.OnProgressCallback) callback;
63 | if (callbackHandler == null) {
64 | callbackCopy.onProgress(currentCopy, maxProgressCopy);
65 | }
66 | else {
67 | callbackHandler.post(new Runnable() {
68 | @Override
69 | public void run() {
70 | callbackCopy.onProgress(currentCopy, maxProgressCopy);
71 | }
72 | });
73 | }
74 | lastReportedProgress = progress;
75 | }
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/SessionDefaultAudience.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | import com.facebook.internal.NativeProtocol;
20 |
21 | /**
22 | * Certain operations such as publishing a status or publishing a photo require an audience. When the user
23 | * grants an application permission to perform a publish operation, a default audience is selected as the
24 | * publication ceiling for the application. This enumerated value allows the application to select which
25 | * audience to ask the user to grant publish permission for.
26 | */
27 | public enum SessionDefaultAudience {
28 | /**
29 | * Represents an invalid default audience value, can be used when only reading.
30 | */
31 | NONE(null),
32 |
33 | /**
34 | * Indicates only the user is able to see posts made by the application.
35 | */
36 | ONLY_ME(NativeProtocol.AUDIENCE_ME),
37 |
38 | /**
39 | * Indicates that the user's friends are able to see posts made by the application.
40 | */
41 | FRIENDS(NativeProtocol.AUDIENCE_FRIENDS),
42 |
43 | /**
44 | * Indicates that all Facebook users are able to see posts made by the application.
45 | */
46 | EVERYONE(NativeProtocol.AUDIENCE_EVERYONE);
47 |
48 | private final String nativeProtocolAudience;
49 |
50 | private SessionDefaultAudience(String protocol) {
51 | nativeProtocolAudience = protocol;
52 | }
53 |
54 | public String getNativeProtocolAudience() {
55 | return nativeProtocolAudience;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/SessionLoginBehavior.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | /**
20 | * Specifies the behaviors to try during
21 | * {@link Session#openForRead(com.facebook.Session.OpenRequest) openForRead},
22 | * {@link Session#openForPublish(com.facebook.Session.OpenRequest) openForPublish},
23 | * {@link Session#requestNewReadPermissions(com.facebook.Session.NewPermissionsRequest) requestNewReadPermissions}, or
24 | * {@link Session#requestNewPublishPermissions(com.facebook.Session.NewPermissionsRequest) requestNewPublishPermissions}.
25 | */
26 | public enum SessionLoginBehavior {
27 | /**
28 | * Specifies that Session should attempt Single Sign On (SSO), and if that
29 | * does not work fall back to dialog auth. This is the default behavior.
30 | */
31 | SSO_WITH_FALLBACK(true, true),
32 |
33 | /**
34 | * Specifies that Session should only attempt SSO. If SSO fails, then the
35 | * open or new permissions call fails.
36 | */
37 | SSO_ONLY(true, false),
38 |
39 | /**
40 | * Specifies that SSO should not be attempted, and to only use dialog auth.
41 | */
42 | SUPPRESS_SSO(false, true);
43 |
44 | private final boolean allowsKatanaAuth;
45 | private final boolean allowsWebViewAuth;
46 |
47 | private SessionLoginBehavior(boolean allowsKatanaAuth, boolean allowsWebViewAuth) {
48 | this.allowsKatanaAuth = allowsKatanaAuth;
49 | this.allowsWebViewAuth = allowsWebViewAuth;
50 | }
51 |
52 | boolean allowsKatanaAuth() {
53 | return allowsKatanaAuth;
54 | }
55 |
56 | boolean allowsWebViewAuth() {
57 | return allowsWebViewAuth;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/SessionState.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook;
18 |
19 | /**
20 | *
21 | * Identifies the state of a Session.
22 | *
23 | *
24 | * Session objects implement a state machine that controls their lifecycle. This
25 | * enum represents the states of the state machine.
26 | *
27 | */
28 | public enum SessionState {
29 | /**
30 | * Indicates that the Session has not yet been opened and has no cached
31 | * token. Opening a Session in this state will involve user interaction.
32 | */
33 | CREATED(Category.CREATED_CATEGORY),
34 |
35 | /**
36 | *
37 | * Indicates that the Session has not yet been opened and has a cached
38 | * token. Opening a Session in this state will not involve user interaction.
39 | *
40 | *
41 | * If you are using Session from an Android Service, you must provide a
42 | * TokenCachingStrategy implementation that contains a valid token to the Session
43 | * constructor. The resulting Session will be created in this state, and you
44 | * can then safely call open, passing null for the Activity.
45 | *
46 | */
47 | CREATED_TOKEN_LOADED(Category.CREATED_CATEGORY),
48 |
49 | /**
50 | * Indicates that the Session is in the process of opening.
51 | */
52 | OPENING(Category.CREATED_CATEGORY),
53 |
54 | /**
55 | * Indicates that the Session is opened. In this state, the Session may be
56 | * used with a {@link Request}.
57 | */
58 | OPENED(Category.OPENED_CATEGORY),
59 |
60 | /**
61 | *
62 | * Indicates that the Session is opened and that the token has changed. In
63 | * this state, the Session may be used with {@link Request}.
64 | *
65 | *
66 | * Every time the token is updated, {@link Session.StatusCallback
67 | * StatusCallback} is called with this value.
68 | *
69 | */
70 | OPENED_TOKEN_UPDATED(Category.OPENED_CATEGORY),
71 |
72 | /**
73 | * Indicates that the Session is closed, and that it was not closed
74 | * normally. Typically this means that the open call failed, and the
75 | * Exception parameter to {@link Session.StatusCallback StatusCallback} will
76 | * be non-null.
77 | */
78 | CLOSED_LOGIN_FAILED(Category.CLOSED_CATEGORY),
79 |
80 | /**
81 | * Indicates that the Session was closed normally.
82 | */
83 | CLOSED(Category.CLOSED_CATEGORY);
84 |
85 | private final Category category;
86 |
87 | SessionState(Category category) {
88 | this.category = category;
89 | }
90 |
91 | /**
92 | * Returns a boolean indicating whether the state represents a successfully
93 | * opened state in which the Session can be used with a {@link Request}.
94 | *
95 | * @return a boolean indicating whether the state represents a successfully
96 | * opened state in which the Session can be used with a
97 | * {@link Request}.
98 | */
99 | public boolean isOpened() {
100 | return this.category == Category.OPENED_CATEGORY;
101 | }
102 |
103 | /**
104 | * Returns a boolean indicating whether the state represents a closed
105 | * Session that can no longer be used with a {@link Request}.
106 | *
107 | * @return a boolean indicating whether the state represents a closed
108 | * Session that can no longer be used with a {@link Request}.
109 | */
110 | public boolean isClosed() {
111 | return this.category == Category.CLOSED_CATEGORY;
112 | }
113 |
114 | private enum Category {
115 | CREATED_CATEGORY, OPENED_CATEGORY, CLOSED_CATEGORY
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/android/DialogError.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.android;
18 |
19 | /**
20 | * Encapsulation of Dialog Error.
21 | *
22 | * THIS CLASS SHOULD BE CONSIDERED DEPRECATED.
23 | *
24 | * All public members of this class are intentionally deprecated.
25 | * New code should instead use
26 | * {@link com.facebook.FacebookException}
27 | *
28 | * Adding @Deprecated to this class causes warnings in other deprecated classes
29 | * that reference this one. That is the only reason this entire class is not
30 | * deprecated.
31 | *
32 | * @devDocDeprecated
33 | */
34 | public class DialogError extends Throwable {
35 |
36 | private static final long serialVersionUID = 1L;
37 |
38 | /**
39 | * The ErrorCode received by the WebView: see
40 | * http://developer.android.com/reference/android/webkit/WebViewClient.html
41 | */
42 | private int mErrorCode;
43 |
44 | /** The URL that the dialog was trying to load */
45 | private String mFailingUrl;
46 |
47 | @Deprecated
48 | public DialogError(String message, int errorCode, String failingUrl) {
49 | super(message);
50 | mErrorCode = errorCode;
51 | mFailingUrl = failingUrl;
52 | }
53 |
54 | @Deprecated
55 | public int getErrorCode() {
56 | return mErrorCode;
57 | }
58 |
59 | @Deprecated
60 | public String getFailingUrl() {
61 | return mFailingUrl;
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/android/FacebookError.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.android;
18 |
19 | /**
20 | * Encapsulation of a Facebook Error: a Facebook request that could not be
21 | * fulfilled.
22 | *
23 | * THIS CLASS SHOULD BE CONSIDERED DEPRECATED.
24 | *
25 | * All public members of this class are intentionally deprecated.
26 | * New code should instead use
27 | * {@link com.facebook.FacebookException}
28 | *
29 | * Adding @Deprecated to this class causes warnings in other deprecated classes
30 | * that reference this one. That is the only reason this entire class is not
31 | * deprecated.
32 | *
33 | * @devDocDeprecated
34 | */
35 | public class FacebookError extends RuntimeException {
36 |
37 | private static final long serialVersionUID = 1L;
38 |
39 | private int mErrorCode = 0;
40 | private String mErrorType;
41 |
42 | @Deprecated
43 | public FacebookError(String message) {
44 | super(message);
45 | }
46 |
47 | @Deprecated
48 | public FacebookError(String message, String type, int code) {
49 | super(message);
50 | mErrorType = type;
51 | mErrorCode = code;
52 | }
53 |
54 | @Deprecated
55 | public int getErrorCode() {
56 | return mErrorCode;
57 | }
58 |
59 | @Deprecated
60 | public String getErrorType() {
61 | return mErrorType;
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/android/FbDialog.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.android;
18 |
19 | import android.content.Context;
20 | import android.os.Bundle;
21 | import com.facebook.FacebookDialogException;
22 | import com.facebook.FacebookException;
23 | import com.facebook.FacebookOperationCanceledException;
24 | import com.facebook.android.Facebook.DialogListener;
25 | import com.facebook.widget.WebDialog;
26 |
27 | /**
28 | * This class is deprecated. See {@link com.facebook.widget.WebDialog}.
29 | */
30 | @Deprecated
31 | public class FbDialog extends WebDialog {
32 | private DialogListener mListener;
33 |
34 | public FbDialog(Context context, String url, DialogListener listener) {
35 | this(context, url, listener, DEFAULT_THEME);
36 | }
37 |
38 | public FbDialog(Context context, String url, DialogListener listener, int theme) {
39 | super(context, url, theme);
40 | setDialogListener(listener);
41 | }
42 |
43 | public FbDialog(Context context, String action, Bundle parameters, DialogListener listener) {
44 | super(context, action, parameters, DEFAULT_THEME, null);
45 | setDialogListener(listener);
46 | }
47 |
48 | public FbDialog(Context context, String action, Bundle parameters, DialogListener listener,
49 | int theme) {
50 | super(context, action, parameters, theme, null);
51 | setDialogListener(listener);
52 | }
53 |
54 | private void setDialogListener(DialogListener listener) {
55 | this.mListener = listener;
56 | setOnCompleteListener(new OnCompleteListener() {
57 | @Override
58 | public void onComplete(Bundle values, FacebookException error) {
59 | callDialogListener(values, error);
60 | }
61 | });
62 | }
63 |
64 | private void callDialogListener(Bundle values, FacebookException error) {
65 | if (mListener == null) {
66 | return;
67 | }
68 |
69 | if (values != null) {
70 | mListener.onComplete(values);
71 | } else {
72 | if (error instanceof FacebookDialogException) {
73 | FacebookDialogException facebookDialogException = (FacebookDialogException) error;
74 | DialogError dialogError = new DialogError(facebookDialogException.getMessage(),
75 | facebookDialogException.getErrorCode(), facebookDialogException.getFailingUrl());
76 | mListener.onError(dialogError);
77 | } else if (error instanceof FacebookOperationCanceledException) {
78 | mListener.onCancel();
79 | } else {
80 | FacebookError facebookError = new FacebookError(error.getMessage());
81 | mListener.onFacebookError(facebookError);
82 | }
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/internal/AnalyticsEvents.java:
--------------------------------------------------------------------------------
1 | package com.facebook.internal;
2 |
3 | /**
4 | * com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android. Use of
5 | * any of the classes in this package is unsupported, and they may be modified or removed without warning at
6 | * any time.
7 | */
8 | public class AnalyticsEvents {
9 | public static final String EVENT_NATIVE_LOGIN_DIALOG_COMPLETE = "fb_dialogs_native_login_dialog_complete";
10 | public static final String EVENT_NATIVE_LOGIN_DIALOG_START = "fb_dialogs_native_login_dialog_start";
11 | public static final String EVENT_WEB_LOGIN_COMPLETE = "fb_dialogs_web_login_dialog_complete";
12 | public static final String EVENT_FRIEND_PICKER_USAGE = "fb_friend_picker_usage";
13 | public static final String EVENT_PLACE_PICKER_USAGE = "fb_place_picker_usage";
14 | public static final String EVENT_LOGIN_VIEW_USAGE = "fb_login_view_usage";
15 | public static final String EVENT_USER_SETTINGS_USAGE = "fb_user_settings_vc_usage";
16 | public static final String EVENT_NATIVE_DIALOG_START = "fb_native_dialog_start";
17 | public static final String EVENT_NATIVE_DIALOG_COMPLETE = "fb_native_dialog_complete";
18 |
19 | public static final String PARAMETER_WEB_LOGIN_E2E = "fb_web_login_e2e";
20 | public static final String PARAMETER_WEB_LOGIN_SWITCHBACK_TIME = "fb_web_login_switchback_time";
21 | public static final String PARAMETER_APP_ID = "app_id";
22 | public static final String PARAMETER_ACTION_ID = "action_id";
23 | public static final String PARAMETER_NATIVE_LOGIN_DIALOG_START_TIME = "fb_native_login_dialog_start_time";
24 | public static final String PARAMETER_NATIVE_LOGIN_DIALOG_COMPLETE_TIME =
25 | "fb_native_login_dialog_complete_time";
26 |
27 | public static final String PARAMETER_DIALOG_OUTCOME = "fb_dialog_outcome";
28 | public static final String PARAMETER_DIALOG_OUTCOME_VALUE_COMPLETED = "Completed";
29 | public static final String PARAMETER_DIALOG_OUTCOME_VALUE_UNKNOWN = "Unknown";
30 | public static final String PARAMETER_DIALOG_OUTCOME_VALUE_CANCELLED = "Cancelled";
31 | public static final String PARAMETER_DIALOG_OUTCOME_VALUE_FAILED = "Failed";
32 |
33 | public static final String EVENT_NATIVE_DIALOG_TYPE_SHARE = "fb_dialogs_present_share";
34 | public static final String EVENT_NATIVE_DIALOG_TYPE_MESSAGE = "fb_dialogs_present_message";
35 | public static final String EVENT_NATIVE_DIALOG_TYPE_OG_SHARE = "fb_dialogs_present_share_og";
36 | public static final String EVENT_NATIVE_DIALOG_TYPE_OG_MESSAGE = "fb_dialogs_present_message_og";
37 | public static final String EVENT_NATIVE_DIALOG_TYPE_PHOTO_SHARE = "fb_dialogs_present_share_photo";
38 | public static final String EVENT_NATIVE_DIALOG_TYPE_PHOTO_MESSAGE = "fb_dialogs_present_message_photo";
39 | }
40 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/internal/CacheableRequestBatch.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.internal;
18 |
19 | import com.facebook.Request;
20 | import com.facebook.RequestBatch;
21 |
22 | /**
23 | * com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android. Use of
24 | * any of the classes in this package is unsupported, and they may be modified or removed without warning at
25 | * any time.
26 | */
27 | public class CacheableRequestBatch extends RequestBatch {
28 | private String cacheKey;
29 | private boolean forceRoundTrip;
30 |
31 | public CacheableRequestBatch() {
32 | }
33 |
34 | public CacheableRequestBatch(Request... requests) {
35 | super(requests);
36 | }
37 |
38 | public final String getCacheKeyOverride() {
39 | return cacheKey;
40 | }
41 |
42 | // If this is set, the provided string will override the default key (the URL) for single requests.
43 | // There is no default for multi-request batches, so no caching will be done unless the override is
44 | // specified.
45 | public final void setCacheKeyOverride(String cacheKey) {
46 | this.cacheKey = cacheKey;
47 | }
48 |
49 | public final boolean getForceRoundTrip() {
50 | return forceRoundTrip;
51 | }
52 |
53 | public final void setForceRoundTrip(boolean forceRoundTrip) {
54 | this.forceRoundTrip = forceRoundTrip;
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/internal/ImageRequest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.internal;
18 |
19 | import android.content.Context;
20 | import android.net.Uri;
21 |
22 | import java.net.URI;
23 | import java.net.URISyntaxException;
24 |
25 | public class ImageRequest {
26 |
27 | public interface Callback {
28 | /**
29 | * This method should always be called on the UI thread. ImageDownloader makes
30 | * sure to do this when it is responsible for issuing the ImageResponse
31 | * @param response
32 | */
33 | void onCompleted(ImageResponse response);
34 | }
35 |
36 | public static final int UNSPECIFIED_DIMENSION = 0;
37 |
38 | private static final String PROFILEPIC_URL_FORMAT =
39 | "https://graph.facebook.com/%s/picture";
40 | private static final String HEIGHT_PARAM = "height";
41 | private static final String WIDTH_PARAM = "width";
42 | private static final String MIGRATION_PARAM = "migration_overrides";
43 | private static final String MIGRATION_VALUE = "{october_2012:true}";
44 |
45 | private Context context;
46 | private URI imageUri;
47 | private Callback callback;
48 | private boolean allowCachedRedirects;
49 | private Object callerTag;
50 |
51 | public static URI getProfilePictureUrl(
52 | String userId,
53 | int width,
54 | int height)
55 | throws URISyntaxException {
56 |
57 | Validate.notNullOrEmpty(userId, "userId");
58 |
59 | width = Math.max(width, UNSPECIFIED_DIMENSION);
60 | height = Math.max(height, UNSPECIFIED_DIMENSION);
61 |
62 | if (width == UNSPECIFIED_DIMENSION && height == UNSPECIFIED_DIMENSION) {
63 | throw new IllegalArgumentException("Either width or height must be greater than 0");
64 | }
65 |
66 | Uri.Builder builder = new Uri.Builder().encodedPath(String.format(PROFILEPIC_URL_FORMAT, userId));
67 |
68 | if (height != UNSPECIFIED_DIMENSION) {
69 | builder.appendQueryParameter(HEIGHT_PARAM, String.valueOf(height));
70 | }
71 |
72 | if (width != UNSPECIFIED_DIMENSION) {
73 | builder.appendQueryParameter(WIDTH_PARAM, String.valueOf(width));
74 | }
75 |
76 | builder.appendQueryParameter(MIGRATION_PARAM, MIGRATION_VALUE);
77 |
78 | return new URI(builder.toString());
79 | }
80 |
81 | private ImageRequest(Builder builder) {
82 | this.context = builder.context;
83 | this.imageUri = builder.imageUrl;
84 | this.callback = builder.callback;
85 | this.allowCachedRedirects = builder.allowCachedRedirects;
86 | this.callerTag = builder.callerTag == null ? new Object() : builder.callerTag;
87 | }
88 |
89 | public Context getContext() {
90 | return context;
91 | }
92 |
93 | public URI getImageUri() {
94 | return imageUri;
95 | }
96 |
97 | public Callback getCallback() {
98 | return callback;
99 | }
100 |
101 | public boolean isCachedRedirectAllowed() {
102 | return allowCachedRedirects;
103 | }
104 |
105 | public Object getCallerTag() {
106 | return callerTag;
107 | }
108 |
109 | public static class Builder {
110 | // Required
111 | private Context context;
112 | private URI imageUrl;
113 |
114 | // Optional
115 | private Callback callback;
116 | private boolean allowCachedRedirects;
117 | private Object callerTag;
118 |
119 | public Builder(Context context, URI imageUrl) {
120 | Validate.notNull(imageUrl, "imageUrl");
121 | this.context = context;
122 | this.imageUrl = imageUrl;
123 | }
124 |
125 | public Builder setCallback(Callback callback) {
126 | this.callback = callback;
127 | return this;
128 | }
129 |
130 | public Builder setCallerTag(Object callerTag) {
131 | this.callerTag = callerTag;
132 | return this;
133 | }
134 |
135 | public Builder setAllowCachedRedirects(boolean allowCachedRedirects) {
136 | this.allowCachedRedirects = allowCachedRedirects;
137 | return this;
138 | }
139 |
140 | public ImageRequest build() {
141 | return new ImageRequest(this);
142 | }
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/internal/ImageResponse.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.internal;
18 |
19 | import android.graphics.Bitmap;
20 |
21 | public class ImageResponse {
22 |
23 | private ImageRequest request;
24 | private Exception error;
25 | private boolean isCachedRedirect;
26 | private Bitmap bitmap;
27 |
28 | ImageResponse(ImageRequest request, Exception error, boolean isCachedRedirect, Bitmap bitmap) {
29 | this.request = request;
30 | this.error = error;
31 | this.bitmap = bitmap;
32 | this.isCachedRedirect = isCachedRedirect;
33 | }
34 |
35 | public ImageRequest getRequest() {
36 | return request;
37 | }
38 |
39 | public Exception getError() {
40 | return error;
41 | }
42 |
43 | public Bitmap getBitmap() {
44 | return bitmap;
45 | }
46 |
47 | public boolean isCachedRedirect() {
48 | return isCachedRedirect;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/internal/ImageResponseCache.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.internal;
18 |
19 | import android.content.Context;
20 | import android.util.Log;
21 | import com.facebook.LoggingBehavior;
22 |
23 | import java.io.BufferedInputStream;
24 | import java.io.IOException;
25 | import java.io.InputStream;
26 | import java.net.HttpURLConnection;
27 | import java.net.URI;
28 | import java.net.URISyntaxException;
29 | import java.net.URL;
30 |
31 | class ImageResponseCache {
32 | static final String TAG = ImageResponseCache.class.getSimpleName();
33 |
34 | private volatile static FileLruCache imageCache;
35 |
36 | synchronized static FileLruCache getCache(Context context) throws IOException{
37 | if (imageCache == null) {
38 | imageCache = new FileLruCache(context.getApplicationContext(), TAG, new FileLruCache.Limits());
39 | }
40 | return imageCache;
41 | }
42 |
43 | // Get stream from cache, or return null if the image is not cached.
44 | // Does not throw if there was an error.
45 | static InputStream getCachedImageStream(URI url, Context context) {
46 | InputStream imageStream = null;
47 | if (url != null) {
48 | if (isCDNURL(url)) {
49 | try {
50 | FileLruCache cache = getCache(context);
51 | imageStream = cache.get(url.toString());
52 | } catch (IOException e) {
53 | Logger.log(LoggingBehavior.CACHE, Log.WARN, TAG, e.toString());
54 | }
55 | }
56 | }
57 |
58 | return imageStream;
59 | }
60 |
61 | static InputStream interceptAndCacheImageStream(Context context, HttpURLConnection connection) throws IOException {
62 | InputStream stream = null;
63 | if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
64 | URL url = connection.getURL();
65 | stream = connection.getInputStream(); // Default stream in case caching fails
66 | try {
67 | if (isCDNURL(url.toURI())) {
68 | FileLruCache cache = getCache(context);
69 |
70 | // Wrap stream with a caching stream
71 | stream = cache.interceptAndPut(
72 | url.toString(),
73 | new BufferedHttpInputStream(stream, connection));
74 | }
75 | } catch (IOException e) {
76 | // Caching is best effort
77 | } catch (URISyntaxException e) {
78 | // Caching is best effort
79 | }
80 | }
81 | return stream;
82 | }
83 |
84 | private static boolean isCDNURL(URI url) {
85 | if (url != null) {
86 | String uriHost = url.getHost();
87 |
88 | if (uriHost.endsWith("fbcdn.net")) {
89 | return true;
90 | }
91 |
92 | if (uriHost.startsWith("fbcdn") && uriHost.endsWith("akamaihd.net")) {
93 | return true;
94 | }
95 | }
96 |
97 | return false;
98 | }
99 |
100 | static void clearCache(Context context) {
101 | try {
102 | getCache(context).clearCache();
103 | } catch (IOException e) {
104 | Logger.log(LoggingBehavior.CACHE, Log.WARN, TAG, "clearCache failed " + e.getMessage());
105 | }
106 | }
107 |
108 | private static class BufferedHttpInputStream extends BufferedInputStream {
109 | HttpURLConnection connection;
110 | BufferedHttpInputStream(InputStream stream, HttpURLConnection connection) {
111 | super(stream, Utility.DEFAULT_STREAM_BUFFER_SIZE);
112 | this.connection = connection;
113 | }
114 |
115 | @Override
116 | public void close() throws IOException {
117 | super.close();
118 | Utility.disconnectQuietly(connection);
119 | }
120 | }
121 | }
122 |
123 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/internal/Logger.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.internal;
18 |
19 | import android.util.Log;
20 | import com.facebook.LoggingBehavior;
21 | import com.facebook.Settings;
22 |
23 | import java.util.HashMap;
24 | import java.util.Map;
25 |
26 | /**
27 | * com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android. Use of
28 | * any of the classes in this package is unsupported, and they may be modified or removed without warning at
29 | * any time.
30 | */
31 | public class Logger {
32 | public static final String LOG_TAG_BASE = "FacebookSDK.";
33 | private static final HashMap stringsToReplace = new HashMap();
34 |
35 | private final LoggingBehavior behavior;
36 | private final String tag;
37 | private StringBuilder contents;
38 | private int priority = Log.DEBUG;
39 |
40 | // Note that the mapping of replaced strings is never emptied, so it should be used only for things that
41 | // are not expected to be too numerous, such as access tokens.
42 | public synchronized static void registerStringToReplace(String original, String replace) {
43 | stringsToReplace.put(original, replace);
44 | }
45 |
46 | public synchronized static void registerAccessToken(String accessToken) {
47 | if (Settings.isLoggingBehaviorEnabled(LoggingBehavior.INCLUDE_ACCESS_TOKENS) == false) {
48 | registerStringToReplace(accessToken, "ACCESS_TOKEN_REMOVED");
49 | }
50 | }
51 |
52 | public static void log(LoggingBehavior behavior, String tag, String string) {
53 | log(behavior, Log.DEBUG, tag, string);
54 | }
55 |
56 | public static void log(LoggingBehavior behavior, String tag, String format, Object... args) {
57 | if (Settings.isLoggingBehaviorEnabled(behavior)) {
58 | String string = String.format(format, args);
59 | log(behavior, Log.DEBUG, tag, string);
60 | }
61 | }
62 |
63 | public static void log(LoggingBehavior behavior, int priority, String tag, String string) {
64 | if (Settings.isLoggingBehaviorEnabled(behavior)) {
65 | string = replaceStrings(string);
66 | if (tag.startsWith(LOG_TAG_BASE) == false) {
67 | tag = LOG_TAG_BASE + tag;
68 | }
69 | Log.println(priority, tag, string);
70 |
71 | // Developer errors warrant special treatment by printing out a stack trace, to make both more noticeable,
72 | // and let the source of the problem be more easily pinpointed.
73 | if (behavior == LoggingBehavior.DEVELOPER_ERRORS) {
74 | (new Exception()).printStackTrace();
75 | }
76 | }
77 | }
78 |
79 | private synchronized static String replaceStrings(String string) {
80 | for (Map.Entry entry : stringsToReplace.entrySet()) {
81 | string = string.replace(entry.getKey(), entry.getValue());
82 | }
83 | return string;
84 | }
85 |
86 | public Logger(LoggingBehavior behavior, String tag) {
87 | Validate.notNullOrEmpty(tag, "tag");
88 |
89 | this.behavior = behavior;
90 | this.tag = LOG_TAG_BASE + tag;
91 | this.contents = new StringBuilder();
92 | }
93 |
94 | public int getPriority() {
95 | return priority;
96 | }
97 |
98 | public void setPriority(int value) {
99 | Validate.oneOf(value, "value", Log.ASSERT, Log.DEBUG, Log.ERROR, Log.INFO, Log.VERBOSE, Log.WARN);
100 |
101 | priority = value;
102 | }
103 |
104 | public String getContents() {
105 | return replaceStrings(contents.toString());
106 | }
107 |
108 | // Writes the accumulated contents, then clears contents to start again.
109 | public void log() {
110 | logString(contents.toString());
111 | contents = new StringBuilder();
112 | }
113 |
114 | // Immediately logs a string, ignoring any accumulated contents, which are left unchanged.
115 | public void logString(String string) {
116 | log(behavior, priority, tag, string);
117 | }
118 |
119 | public void append(StringBuilder stringBuilder) {
120 | if (shouldLog()) {
121 | contents.append(stringBuilder);
122 | }
123 | }
124 |
125 | public void append(String string) {
126 | if (shouldLog()) {
127 | contents.append(string);
128 | }
129 | }
130 |
131 | public void append(String format, Object... args) {
132 | if (shouldLog()) {
133 | contents.append(String.format(format, args));
134 | }
135 | }
136 |
137 | public void appendKeyValue(String key, Object value) {
138 | append(" %s:\t%s\n", key, value);
139 | }
140 |
141 | private boolean shouldLog() {
142 | return Settings.isLoggingBehaviorEnabled(behavior);
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/internal/PlatformServiceClient.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.internal;
18 |
19 | import android.content.ComponentName;
20 | import android.content.Context;
21 | import android.content.Intent;
22 | import android.content.ServiceConnection;
23 | import android.os.*;
24 |
25 | /**
26 | * com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android. Use of
27 | * any of the classes in this package is unsupported, and they may be modified or removed without warning at
28 | * any time.
29 | */
30 | abstract public class PlatformServiceClient implements ServiceConnection {
31 | private final Context context;
32 | private final Handler handler;
33 | private CompletedListener listener;
34 | private boolean running;
35 | private Messenger sender;
36 | private int requestMessage;
37 | private int replyMessage;
38 | private final String applicationId;
39 | private final int protocolVersion;
40 |
41 | public PlatformServiceClient(Context context, int requestMessage, int replyMessage, int protocolVersion,
42 | String applicationId) {
43 | Context applicationContext = context.getApplicationContext();
44 |
45 | this.context = (applicationContext != null) ? applicationContext : context;
46 | this.requestMessage = requestMessage;
47 | this.replyMessage = replyMessage;
48 | this.applicationId = applicationId;
49 | this.protocolVersion = protocolVersion;
50 |
51 | handler = new Handler() {
52 | @Override
53 | public void handleMessage(Message message) {
54 | PlatformServiceClient.this.handleMessage(message);
55 | }
56 | };
57 | }
58 |
59 | public void setCompletedListener(CompletedListener listener) {
60 | this.listener = listener;
61 | }
62 |
63 | protected Context getContext() {
64 | return context;
65 | }
66 |
67 | public boolean start() {
68 | if (running) {
69 | return false;
70 | }
71 |
72 | // Make sure that the service can handle the requested protocol version
73 | int availableVersion = NativeProtocol.getLatestAvailableProtocolVersionForService(context, protocolVersion);
74 | if (availableVersion == NativeProtocol.NO_PROTOCOL_AVAILABLE) {
75 | return false;
76 | }
77 |
78 | Intent intent = NativeProtocol.createPlatformServiceIntent(context);
79 | if (intent == null) {
80 | return false;
81 | } else {
82 | running = true;
83 | context.bindService(intent, this, Context.BIND_AUTO_CREATE);
84 | return true;
85 | }
86 | }
87 |
88 | public void cancel() {
89 | running = false;
90 | }
91 |
92 | public void onServiceConnected(ComponentName name, IBinder service) {
93 | sender = new Messenger(service);
94 | sendMessage();
95 | }
96 |
97 | public void onServiceDisconnected(ComponentName name) {
98 | sender = null;
99 | context.unbindService(this);
100 | callback(null);
101 | }
102 |
103 | private void sendMessage() {
104 | Bundle data = new Bundle();
105 | data.putString(NativeProtocol.EXTRA_APPLICATION_ID, applicationId);
106 |
107 | populateRequestBundle(data);
108 |
109 | Message request = Message.obtain(null, requestMessage);
110 | request.arg1 = protocolVersion;
111 | request.setData(data);
112 | request.replyTo = new Messenger(handler);
113 |
114 | try {
115 | sender.send(request);
116 | } catch (RemoteException e) {
117 | callback(null);
118 | }
119 | }
120 |
121 | protected abstract void populateRequestBundle(Bundle data);
122 |
123 | protected void handleMessage(Message message) {
124 | if (message.what == replyMessage) {
125 | Bundle extras = message.getData();
126 | String errorType = extras.getString(NativeProtocol.STATUS_ERROR_TYPE);
127 | if (errorType != null) {
128 | callback(null);
129 | } else {
130 | callback(extras);
131 | }
132 | context.unbindService(this);
133 | }
134 | }
135 |
136 | private void callback(Bundle result) {
137 | if (!running) {
138 | return;
139 | }
140 | running = false;
141 |
142 | CompletedListener callback = listener;
143 | if (callback != null) {
144 | callback.completed(result);
145 | }
146 | }
147 |
148 | public interface CompletedListener {
149 | void completed(Bundle result);
150 | }
151 | }
152 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/internal/ServerProtocol.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.internal;
18 |
19 | import com.facebook.Settings;
20 |
21 | import java.util.Collection;
22 |
23 | /**
24 | * com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android. Use of
25 | * any of the classes in this package is unsupported, and they may be modified or removed without warning at
26 | * any time.
27 | */
28 | public final class ServerProtocol {
29 | private static final String DIALOG_AUTHORITY_FORMAT = "m.%s";
30 | public static final String DIALOG_PATH = "dialog/";
31 | public static final String DIALOG_PARAM_ACCESS_TOKEN = "access_token";
32 | public static final String DIALOG_PARAM_APP_ID = "app_id";
33 | public static final String DIALOG_PARAM_AUTH_TYPE = "auth_type";
34 | public static final String DIALOG_PARAM_CLIENT_ID = "client_id";
35 | public static final String DIALOG_PARAM_DISPLAY = "display";
36 | public static final String DIALOG_PARAM_E2E = "e2e";
37 | public static final String DIALOG_PARAM_LEGACY_OVERRIDE = "legacy_override";
38 | public static final String DIALOG_PARAM_REDIRECT_URI = "redirect_uri";
39 | public static final String DIALOG_PARAM_RESPONSE_TYPE = "response_type";
40 | public static final String DIALOG_PARAM_RETURN_SCOPES = "return_scopes";
41 | public static final String DIALOG_PARAM_SCOPE = "scope";
42 | public static final String DIALOG_PARAM_DEFAULT_AUDIENCE = "default_audience";
43 | public static final String DIALOG_REREQUEST_AUTH_TYPE = "rerequest";
44 | public static final String DIALOG_RESPONSE_TYPE_TOKEN = "token";
45 | public static final String DIALOG_RETURN_SCOPES_TRUE = "true";
46 |
47 | // URL components
48 | private static final String GRAPH_VIDEO_URL_FORMAT = "https://graph-video.%s";
49 | private static final String GRAPH_URL_FORMAT = "https://graph.%s";
50 | public static final String GRAPH_API_VERSION = "v2.1";
51 |
52 | private static final String LEGACY_API_VERSION = "v1.0";
53 |
54 | public static final Collection errorsProxyAuthDisabled =
55 | Utility.unmodifiableCollection("service_disabled", "AndroidAuthKillSwitchException");
56 | public static final Collection errorsUserCanceled =
57 | Utility.unmodifiableCollection("access_denied", "OAuthAccessDeniedException");
58 |
59 | public static final String getDialogAuthority() {
60 | return String.format(DIALOG_AUTHORITY_FORMAT, Settings.getFacebookDomain());
61 | }
62 |
63 | public static final String getGraphUrlBase() {
64 | return String.format(GRAPH_URL_FORMAT, Settings.getFacebookDomain());
65 | }
66 |
67 | public static final String getGraphVideoUrlBase() {
68 | return String.format(GRAPH_VIDEO_URL_FORMAT, Settings.getFacebookDomain());
69 | }
70 |
71 | public static final String getAPIVersion() {
72 | if (Settings.getPlatformCompatibilityEnabled()) {
73 | return LEGACY_API_VERSION;
74 | }
75 | return GRAPH_API_VERSION;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/internal/SessionAuthorizationType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.internal;
18 |
19 | /**
20 | * com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android. Use of
21 | * any of the classes in this package is unsupported, and they may be modified or removed without warning at
22 | * any time.
23 | */
24 | public enum SessionAuthorizationType {
25 | READ,
26 | PUBLISH
27 | }
28 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/internal/UrlRedirectCache.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.internal;
18 |
19 | import android.content.Context;
20 | import android.util.Log;
21 | import com.facebook.LoggingBehavior;
22 |
23 | import java.io.IOException;
24 | import java.io.InputStream;
25 | import java.io.InputStreamReader;
26 | import java.io.OutputStream;
27 | import java.net.URI;
28 | import java.net.URISyntaxException;
29 |
30 | class UrlRedirectCache {
31 | static final String TAG = UrlRedirectCache.class.getSimpleName();
32 | private static final String REDIRECT_CONTENT_TAG = TAG + "_Redirect";
33 |
34 | private volatile static FileLruCache urlRedirectCache;
35 |
36 | synchronized static FileLruCache getCache(Context context) throws IOException{
37 | if (urlRedirectCache == null) {
38 | urlRedirectCache = new FileLruCache(context.getApplicationContext(), TAG, new FileLruCache.Limits());
39 | }
40 | return urlRedirectCache;
41 | }
42 |
43 | static URI getRedirectedUri(Context context, URI uri) {
44 | if (uri == null) {
45 | return null;
46 | }
47 |
48 | String uriString = uri.toString();
49 | InputStreamReader reader = null;
50 | try {
51 | InputStream stream;
52 | FileLruCache cache = getCache(context);
53 | boolean redirectExists = false;
54 | while ((stream = cache.get(uriString, REDIRECT_CONTENT_TAG)) != null) {
55 | redirectExists = true;
56 |
57 | // Get the redirected url
58 | reader = new InputStreamReader(stream);
59 | char[] buffer = new char[128];
60 | int bufferLength;
61 | StringBuilder urlBuilder = new StringBuilder();
62 | while ((bufferLength = reader.read(buffer, 0, buffer.length)) > 0) {
63 | urlBuilder.append(buffer, 0, bufferLength);
64 | }
65 | Utility.closeQuietly(reader);
66 |
67 | // Iterate to the next url in the redirection
68 | uriString = urlBuilder.toString();
69 | }
70 |
71 | if (redirectExists) {
72 | return new URI(uriString);
73 | }
74 | } catch (URISyntaxException e) {
75 | // caching is best effort, so ignore the exception
76 | } catch (IOException ioe) {
77 | } finally {
78 | Utility.closeQuietly(reader);
79 | }
80 |
81 | return null;
82 | }
83 |
84 | static void cacheUriRedirect(Context context, URI fromUri, URI toUri) {
85 | if (fromUri == null || toUri == null) {
86 | return;
87 | }
88 |
89 | OutputStream redirectStream = null;
90 | try {
91 | FileLruCache cache = getCache(context);
92 | redirectStream = cache.openPutStream(fromUri.toString(), REDIRECT_CONTENT_TAG);
93 | redirectStream.write(toUri.toString().getBytes());
94 | } catch (IOException e) {
95 | // Caching is best effort
96 | } finally {
97 | Utility.closeQuietly(redirectStream);
98 | }
99 | }
100 |
101 | static void clearCache(Context context) {
102 | try {
103 | getCache(context).clearCache();
104 | } catch (IOException e) {
105 | Logger.log(LoggingBehavior.CACHE, Log.WARN, TAG, "clearCache failed " + e.getMessage());
106 | }
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/internal/Validate.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.internal;
18 |
19 | import java.util.Collection;
20 |
21 | /**
22 | * com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android. Use of
23 | * any of the classes in this package is unsupported, and they may be modified or removed without warning at
24 | * any time.
25 | */
26 | public final class Validate {
27 | public static void notNull(Object arg, String name) {
28 | if (arg == null) {
29 | throw new NullPointerException("Argument '" + name + "' cannot be null");
30 | }
31 | }
32 |
33 | public static void notEmpty(Collection container, String name) {
34 | if (container.isEmpty()) {
35 | throw new IllegalArgumentException("Container '" + name + "' cannot be empty");
36 | }
37 | }
38 |
39 | public static void containsNoNulls(Collection container, String name) {
40 | Validate.notNull(container, name);
41 | for (T item : container) {
42 | if (item == null) {
43 | throw new NullPointerException("Container '" + name + "' cannot contain null values");
44 | }
45 | }
46 | }
47 |
48 | public static void containsNoNullOrEmpty(Collection container, String name) {
49 | Validate.notNull(container, name);
50 | for (String item : container) {
51 | if (item == null) {
52 | throw new NullPointerException("Container '" + name + "' cannot contain null values");
53 | }
54 | if (item.length() == 0) {
55 | throw new IllegalArgumentException("Container '" + name + "' cannot contain empty values");
56 | }
57 | }
58 | }
59 |
60 | public static void notEmptyAndContainsNoNulls(Collection container, String name) {
61 | Validate.containsNoNulls(container, name);
62 | Validate.notEmpty(container, name);
63 | }
64 |
65 | public static void notNullOrEmpty(String arg, String name) {
66 | if (Utility.isNullOrEmpty(arg)) {
67 | throw new IllegalArgumentException("Argument '" + name + "' cannot be null or empty");
68 | }
69 | }
70 |
71 | public static void oneOf(Object arg, String name, Object... values) {
72 | for (Object value : values) {
73 | if (value != null) {
74 | if (value.equals(arg)) {
75 | return;
76 | }
77 | } else {
78 | if (arg == null) {
79 | return;
80 | }
81 | }
82 | }
83 | throw new IllegalArgumentException("Argument '" + name + "' was not one of the allowed values");
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/internal/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * com.facebook.internal is solely for the use of other packages within the Facebook SDK for Android. Use of
3 | * any of the classes in this package is unsupported, and they may be modified or removed without warning at
4 | * any time.
5 | */
6 | package com.facebook.internal;
7 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/model/CreateGraphObject.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.model;
18 |
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 |
22 | /**
23 | * Use this annotation setters in an interface that derives from
24 | * GraphObject, if you wish to provide a setter that takes a primitive data type (e.g., String)
25 | * or a List of primitive data types, but actually populates its underlying property with a
26 | * new GraphObject with a property equal to the specified value (or a List of such GraphObjects).
27 | * This is useful for providing "helper" setters to avoid requiring callers to instantiate a GraphObject
28 | * just to set a single property on it (e.g., 'url' or 'id').
29 | *
30 | * The String value provided to this annotation should be the name of the property that will be
31 | * populated on the newly-created GraphObject using the value that was passed to the setter.
32 | *
33 | * This annotation has no effect if applied to a getter.
34 | */
35 | @Retention(RetentionPolicy.RUNTIME)
36 | public @interface CreateGraphObject {
37 | String value();
38 | }
39 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/model/GraphLocation.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.model;
18 |
19 | /**
20 | * Provides a strongly-typed representation of a Location as defined by the Graph API.
21 | *
22 | * Note that this interface is intended to be used with GraphObject.Factory
23 | * and not implemented directly.
24 | */
25 | public interface GraphLocation extends GraphObject {
26 | /**
27 | * Returns the street component of the location.
28 | *
29 | * @return the street component of the location, or null
30 | */
31 | public String getStreet();
32 |
33 | /**
34 | * Sets the street component of the location.
35 | *
36 | * @param street
37 | * the street component of the location, or null
38 | */
39 | public void setStreet(String street);
40 |
41 | /**
42 | * Gets the city component of the location.
43 | *
44 | * @return the city component of the location
45 | */
46 | public String getCity();
47 |
48 | /**
49 | * Sets the city component of the location.
50 | *
51 | * @param city
52 | * the city component of the location
53 | */
54 | public void setCity(String city);
55 |
56 | /**
57 | * Returns the state component of the location.
58 | *
59 | * @return the state component of the location
60 | */
61 | public String getState();
62 |
63 | /**
64 | * Sets the state component of the location.
65 | *
66 | * @param state
67 | * the state component of the location
68 | */
69 | public void setState(String state);
70 |
71 | /**
72 | * Returns the country component of the location.
73 | *
74 | * @return the country component of the location
75 | */
76 | public String getCountry();
77 |
78 | /**
79 | * Sets the country component of the location
80 | *
81 | * @param country
82 | * the country component of the location
83 | */
84 | public void setCountry(String country);
85 |
86 | /**
87 | * Returns the postal code component of the location.
88 | *
89 | * @return the postal code component of the location
90 | */
91 | public String getZip();
92 |
93 | /**
94 | * Sets the postal code component of the location.
95 | *
96 | * @param zip
97 | * the postal code component of the location
98 | */
99 | public void setZip(String zip);
100 |
101 | /**
102 | * Returns the latitude component of the location.
103 | *
104 | * @return the latitude component of the location
105 | */
106 | public double getLatitude();
107 |
108 | /**
109 | * Sets the latitude component of the location.
110 | *
111 | * @param latitude
112 | * the latitude component of the location
113 | */
114 | public void setLatitude(double latitude);
115 |
116 | /**
117 | * Returns the longitude component of the location.
118 | *
119 | * @return the longitude component of the location
120 | */
121 | public double getLongitude();
122 |
123 | /**
124 | * Sets the longitude component of the location.
125 | *
126 | * @param longitude
127 | * the longitude component of the location
128 | */
129 | public void setLongitude(double longitude);
130 | }
131 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/model/GraphMultiResult.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.model;
18 |
19 | /**
20 | * Defines a GraphObject that represents the result of a query that returns multiple GraphObjects
21 | * nested under a "data" property.
22 | *
23 | * Note that this interface is intended to be used with GraphObject.Factory
24 | * and not implemented directly.
25 | */
26 | public interface GraphMultiResult extends GraphObject {
27 | /**
28 | * Provides access to the GraphObjects that make up the result set.
29 | * @return a list of GraphObjects
30 | */
31 | public GraphObjectList getData();
32 | }
33 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/model/GraphObjectList.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.model;
18 |
19 | import org.json.JSONArray;
20 |
21 | import java.util.List;
22 |
23 | /**
24 | * GraphObjectList is the primary representation of a collection of graph objects in the Facebook SDK for Android.
25 | * It is not implemented by any concrete classes, but rather by a proxy (see the {@link com.facebook.model.GraphObject.Factory Factory}
26 | * class). A GraphObjectList can actually contain elements of any type, not just graph objects, but its principal
27 | * use in the SDK is to contain types derived from GraphObject.
28 | *
29 | *
30 | * @param the type of elements in the list
31 | */
32 | public interface GraphObjectList extends List {
33 | // cast method is only supported if T extends GraphObject
34 | /**
35 | * If T is derived from GraphObject, returns a new GraphObjectList exposing the same underlying data as a new
36 | * GraphObject-derived type.
37 | * @param graphObjectClass the GraphObject-derived type to return a list of
38 | * @return a list representing the same underlying data, exposed as the new GraphObject-derived type
39 | * @throws com.facebook.FacebookGraphObjectException if T does not derive from GraphObject
40 | */
41 | public GraphObjectList castToListOf(Class graphObjectClass);
42 | /**
43 | * Gets the underlying JSONArray representation of the data.
44 | * @return the underlying JSONArray representation of the data
45 | */
46 | public JSONArray getInnerJSONArray();
47 | }
48 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/model/GraphPlace.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.model;
18 |
19 | /**
20 | * Provides a strongly-typed representation of a Place as defined by the Graph API.
21 | *
22 | * Note that this interface is intended to be used with GraphObject.Factory
23 | * and not implemented directly.
24 | */
25 | public interface GraphPlace extends GraphObject {
26 | /**
27 | * Returns the ID of the place.
28 | * @return the ID of the place
29 | */
30 | public String getId();
31 | /**
32 | * Sets the ID of the place.
33 | * @param id the ID of the place
34 | */
35 | public void setId(String id);
36 |
37 | /**
38 | * Returns the name of the place.
39 | * @return the name of the place
40 | */
41 | public String getName();
42 | /**
43 | * Sets the name of the place.
44 | * @param name the name of the place
45 | */
46 | public void setName(String name);
47 |
48 | /**
49 | * Returns the category of the place.
50 | * @return the category of the place
51 | */
52 | public String getCategory();
53 | /**
54 | * Sets the category of the place.
55 | * @param category the category of the place
56 | */
57 | public void setCategory(String category);
58 |
59 | /**
60 | * Returns the location of the place.
61 | * @return the location of the place
62 | */
63 | public GraphLocation getLocation();
64 | /**
65 | * Sets the location of the place.
66 | * @param location the location of the place
67 | */
68 | public void setLocation(GraphLocation location);
69 | }
70 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/model/GraphUser.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.model;
18 |
19 | /**
20 | * Provides a strongly-typed representation of a User as defined by the Graph API.
21 | *
22 | * Note that this interface is intended to be used with GraphObject.Factory
23 | * and not implemented directly.
24 | */
25 | public interface GraphUser extends GraphObject {
26 | /**
27 | * Returns the ID of the user.
28 | * @return the ID of the user
29 | */
30 | public String getId();
31 | /**
32 | * Sets the ID of the user.
33 | * @param id the ID of the user
34 | */
35 | public void setId(String id);
36 |
37 | /**
38 | * Returns the name of the user.
39 | * @return the name of the user
40 | */
41 | public String getName();
42 | /**
43 | * Sets the name of the user.
44 | * @param name the name of the user
45 | */
46 | public void setName(String name);
47 |
48 | /**
49 | * Returns the first name of the user.
50 | * @return the first name of the user
51 | */
52 | public String getFirstName();
53 | /**
54 | * Sets the first name of the user.
55 | * @param firstName the first name of the user
56 | */
57 | public void setFirstName(String firstName);
58 |
59 | /**
60 | * Returns the middle name of the user.
61 | * @return the middle name of the user
62 | */
63 | public String getMiddleName();
64 | /**
65 | * Sets the middle name of the user.
66 | * @param middleName the middle name of the user
67 | */
68 | public void setMiddleName(String middleName);
69 |
70 | /**
71 | * Returns the last name of the user.
72 | * @return the last name of the user
73 | */
74 | public String getLastName();
75 | /**
76 | * Sets the last name of the user.
77 | * @param lastName the last name of the user
78 | */
79 | public void setLastName(String lastName);
80 |
81 | /**
82 | * Returns the Facebook URL of the user.
83 | * @return the Facebook URL of the user
84 | */
85 | public String getLink();
86 | /**
87 | * Sets the Facebook URL of the user.
88 | * @param link the Facebook URL of the user
89 | */
90 | public void setLink(String link);
91 |
92 | /**
93 | * Returns the Facebook username of the user.
94 | * @return the Facebook username of the user
95 | */
96 | public String getUsername();
97 | /**
98 | * Sets the Facebook username of the user.
99 | * @param username the Facebook username of the user
100 | */
101 | public void setUsername(String username);
102 |
103 | /**
104 | * Returns the birthday of the user.
105 | * @return the birthday of the user
106 | */
107 | public String getBirthday();
108 | /**
109 | * Sets the birthday of the user.
110 | * @param birthday the birthday of the user
111 | */
112 | public void setBirthday(String birthday);
113 |
114 | /**
115 | * Returns the current place of the user.
116 | * @return the current place of the user
117 | */
118 | public GraphPlace getLocation();
119 |
120 | /**
121 | * Sets the current place of the user.
122 | * @param location the current place of the user
123 | */
124 | public void setLocation(GraphPlace location);
125 | }
126 |
--------------------------------------------------------------------------------
/facebook/src/main/java/com/facebook/model/JsonUtil.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2010-present Facebook.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.facebook.model;
18 |
19 | import android.annotation.SuppressLint;
20 | import org.json.JSONException;
21 | import org.json.JSONObject;
22 |
23 | import java.util.*;
24 |
25 | class JsonUtil {
26 | static void jsonObjectClear(JSONObject jsonObject) {
27 | @SuppressWarnings("unchecked")
28 | Iterator keys = (Iterator) jsonObject.keys();
29 | while (keys.hasNext()) {
30 | keys.next();
31 | keys.remove();
32 | }
33 | }
34 |
35 | static boolean jsonObjectContainsValue(JSONObject jsonObject, Object value) {
36 | @SuppressWarnings("unchecked")
37 | Iterator keys = (Iterator) jsonObject.keys();
38 | while (keys.hasNext()) {
39 | Object thisValue = jsonObject.opt(keys.next());
40 | if (thisValue != null && thisValue.equals(value)) {
41 | return true;
42 | }
43 | }
44 | return false;
45 | }
46 |
47 | private final static class JSONObjectEntry implements Map.Entry {
48 | private final String key;
49 | private final Object value;
50 |
51 | JSONObjectEntry(String key, Object value) {
52 | this.key = key;
53 | this.value = value;
54 | }
55 |
56 | @SuppressLint("FieldGetter")
57 | @Override
58 | public String getKey() {
59 | return this.key;
60 | }
61 |
62 | @Override
63 | public Object getValue() {
64 | return this.value;
65 | }
66 |
67 | @Override
68 | public Object setValue(Object object) {
69 | throw new UnsupportedOperationException("JSONObjectEntry is immutable");
70 | }
71 |
72 | }
73 |
74 | static Set> jsonObjectEntrySet(JSONObject jsonObject) {
75 | HashSet> result = new HashSet>();
76 |
77 | @SuppressWarnings("unchecked")
78 | Iterator keys = (Iterator) jsonObject.keys();
79 | while (keys.hasNext()) {
80 | String key = keys.next();
81 | Object value = jsonObject.opt(key);
82 | result.add(new JSONObjectEntry(key, value));
83 | }
84 |
85 | return result;
86 | }
87 |
88 | static Set jsonObjectKeySet(JSONObject jsonObject) {
89 | HashSet result = new HashSet();
90 |
91 | @SuppressWarnings("unchecked")
92 | Iterator keys = (Iterator) jsonObject.keys();
93 | while (keys.hasNext()) {
94 | result.add(keys.next());
95 | }
96 |
97 | return result;
98 | }
99 |
100 | static void jsonObjectPutAll(JSONObject jsonObject, Map map) {
101 | Set> entrySet = map.entrySet();
102 | for (Map.Entry entry : entrySet) {
103 | try {
104 | jsonObject.putOpt(entry.getKey(), entry.getValue());
105 | } catch (JSONException e) {
106 | throw new IllegalArgumentException(e);
107 | }
108 | }
109 | }
110 |
111 | static Collection