Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

페이스북 로그인 정책 변경을 수용합니다 #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
apply plugin: 'com.android.application'
check.dependsOn 'assembleDebugAndroidTest'
apply plugin: 'io.fabric'

android {
compileSdkVersion 29
compileSdkVersion 33
defaultConfig {
applicationId "xyz.parti.catan"
minSdkVersion 16
targetSdkVersion 29
versionCode 28
versionName "1.0.15"
targetSdkVersion 33
minSdkVersion 28
versionCode 29
versionName "1.0.16"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down Expand Up @@ -44,6 +43,10 @@ android {
def debug_auth_facebook_app_id = properties.getProperty('debug.auth.facebook.app.id')
def release_auth_facebook_app_id = properties.getProperty('release.auth.facebook.app.id')

def var_auth_facebook_client_token = "auth_facebook_client_token"
def debug_auth_facebook_client_token = properties.getProperty('debug.auth.facebook.client.token')
def release_auth_facebook_client_token = properties.getProperty('release.auth.facebook.client.token')

def var_auth_fb_login_protocol_scheme = "auth_fb_login_protocol_scheme"
def debug_auth_fb_login_protocol_scheme = properties.getProperty('debug.auth.fb.login.protocol.scheme')
def release_auth_fb_login_protocol_scheme = properties.getProperty('release.auth.fb.login.protocol.scheme')
Expand All @@ -54,17 +57,19 @@ android {
buildConfigField "String", var_api_base_url_regx, ( '"' + debug_api_base_url_regx + '"' ?: "\"^https:\\\\/\\\\/(.*\\\\.)?parti\\\\.test(\$|\\\\/)\"" )
buildConfigField "String", var_auth_google_webclient_id, '"' + debug_auth_google_webclient_id + '"'
resValue "string", var_auth_facebook_app_id, '"' + debug_auth_facebook_app_id + '"'
resValue "string", var_auth_facebook_client_token, '"' + debug_auth_facebook_client_token + '"'
resValue "string", var_auth_fb_login_protocol_scheme, '"' + debug_auth_fb_login_protocol_scheme + '"'
manifestPlaceholders = [ crashlyticsApiKey: '767a814309d5e5b2803f20b7e992ad890513b53d' ]
// manifestPlaceholders = [ crashlyticsApiKey: '767a814309d5e5b2803f20b7e992ad890513b53d' ]
}
release {
buildConfigField "boolean", var_is_debug, "false"
buildConfigField "String", var_api_base_url, "\"https://parti.xyz/\""
buildConfigField "String", var_api_base_url_regx, "\"^https:\\\\/\\\\/(.*\\\\.)?parti\\\\.xyz(\$|\\\\/)\""
buildConfigField "String", var_auth_google_webclient_id, '"' + release_auth_google_webclient_id + '"'
resValue "string", var_auth_facebook_app_id, '"' + release_auth_facebook_app_id + '"'
resValue "string", var_auth_facebook_client_token, '"' + release_auth_facebook_client_token + '"'
resValue "string", var_auth_fb_login_protocol_scheme, '"' + release_auth_fb_login_protocol_scheme + '"'
manifestPlaceholders = [ crashlyticsApiKey: '61fec037830f072a57601a3e9f538a4a0f0d1ac3' ]
// manifestPlaceholders = [ crashlyticsApiKey: '61fec037830f072a57601a3e9f538a4a0f0d1ac3' ]
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
Expand All @@ -82,6 +87,11 @@ android {
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '30.0.3'
}

configurations.all {
Expand All @@ -90,11 +100,11 @@ configurations.all {

repositories {
maven { url 'https://maven.google.com' }
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
Expand All @@ -105,18 +115,18 @@ dependencies {

implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.facebook.android:facebook-android-sdk:5.+'
implementation 'com.google.firebase:firebase-crashlytics:18.2.7'
implementation 'com.google.android.gms:play-services-auth:20.7.0'
implementation 'com.firebase:firebase-jobdispatcher:0.6.0'
implementation 'com.facebook.android:facebook-android-sdk:16.2.0'

implementation 'com.wang.avi:library:2.1.3'

implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
transitive = true;
}

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
32 changes: 11 additions & 21 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
android:screenOrientation="sensorPortrait"
android:configChanges="orientation|keyboardHidden"
android:windowSoftInputMode="adjustResize|stateHidden"
android:launchMode="singleInstance">
android:launchMode="singleInstance"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand All @@ -46,14 +47,16 @@
android:exported="false"
android:icon="@mipmap/ic_copy_link"
android:label="@string/copy_link_to_clipboard"
android:theme="@android:style/Theme.NoDisplay"></activity>
android:theme="@android:style/Theme.NoDisplay" />

<service android:name=".MyFirebaseMessagingService">
<service android:name=".MyFirebaseMessagingService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name=".MyFirebaseInstanceIDService">
<service android:name=".MyFirebaseInstanceIDService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
Expand All @@ -66,10 +69,6 @@
</intent-filter>
</service>

<meta-data
android:name="io.fabric.ApiKey"
android:value="${crashlyticsApiKey}" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="xyz.parti.catan.fileprovider"
Expand All @@ -84,23 +83,14 @@
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id" />
<meta-data
android:name="com.facebook.sdk.ClientToken"
android:value="@string/facebook_client_token" />

<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>

</application>

Expand All @@ -113,4 +103,4 @@
android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />

</manifest>
</manifest>
53 changes: 16 additions & 37 deletions app/src/main/java/xyz/parti/catan/CatanApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@
import android.content.IntentFilter;
import android.os.Bundle;

import com.crashlytics.android.Crashlytics;

import io.fabric.sdk.android.Fabric;

public class CatanApp extends Application
{
public class CatanApp extends Application {
private static CatanApp s_this;

private HttpMan m_httpMan;
Expand All @@ -22,17 +17,13 @@ public class CatanApp extends Application
private boolean m_isBackground = true;

@Override
public void onCreate()
{
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
s_this = this;
}

public boolean onStartup()
{
if (m_httpMan != null)
{
public boolean onStartup() {
if (m_httpMan != null) {
// already initialized
return false;
}
Expand Down Expand Up @@ -82,70 +73,58 @@ public void onReceive(Context context, Intent intent) {
Application.ActivityLifecycleCallbacks m_alc = new Application.ActivityLifecycleCallbacks() {

@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState)
{
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
}

@Override
public void onActivityStarted(Activity activity)
{
public void onActivityStarted(Activity activity) {
m_curActivity = activity;
}

@Override
public void onActivityResumed(Activity activity)
{
public void onActivityResumed(Activity activity) {
if (m_isBackground) {
m_isBackground = false;
notifyForeground();
}
}

@Override
public void onActivityPaused(Activity activity)
{
public void onActivityPaused(Activity activity) {
}

@Override
public void onActivityStopped(Activity activity)
{
public void onActivityStopped(Activity activity) {
if (m_curActivity == activity)
m_curActivity = null;
}

@Override
public void onActivitySaveInstanceState(Activity activity, Bundle outState)
{
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
}

@Override
public void onActivityDestroyed(Activity activity)
{
public void onActivityDestroyed(Activity activity) {
}
};

public static Activity getCurActivity()
{
if (s_this != null)
{
public static Activity getCurActivity() {
if (s_this != null) {
return s_this.m_curActivity;
}

return null;
}

public static CatanApp getApp()
{
public static CatanApp getApp() {
return s_this;
}

public static ApiMan getApiManager()
{
public static ApiMan getApiManager() {
return s_this.m_apiMan;
}

public HttpMan getHttpManager()
{
public HttpMan getHttpManager() {
return m_httpMan;
}
}
Loading