Commit 5065a010 by Takatoshi Miura

Merge branch 'features/1.4.410' into features/1.4.410_miura

# Conflicts:
#	ABVJE_Launcher_Android/assets/check
#	gradle.properties
parent e0af23f0
...@@ -56,12 +56,6 @@ ...@@ -56,12 +56,6 @@
</intent-filter> </intent-filter>
</service> </service>
<service android:name="jp.agentec.abook.abv.cl.push.ABVInstanceIDListenerService" android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"></action>
</intent-filter>
</service>
<service <service
android:name="jp.agentec.abook.abv.launcher.android.BackgroundDownloadService" android:name="jp.agentec.abook.abv.launcher.android.BackgroundDownloadService"
android:enabled="true" android:enabled="true"
...@@ -97,7 +91,7 @@ ...@@ -97,7 +91,7 @@
</provider> </provider>
<provider <provider
android:name="android.support.v4.content.FileProvider" android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider" android:authorities="${applicationId}.provider"
android:exported="false" android:exported="false"
android:grantUriPermissions="true"> android:grantUriPermissions="true">
......
...@@ -4,7 +4,7 @@ buildscript { ...@@ -4,7 +4,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'org.ajoberstar:gradle-git:0.12+' classpath 'org.ajoberstar:gradle-git:0.12+'
classpath 'com.google.gms:google-services:3.1.0' classpath 'com.google.gms:google-services:4.0.1'
} }
} }
...@@ -13,12 +13,11 @@ apply plugin: 'com.google.gms.google-services' ...@@ -13,12 +13,11 @@ apply plugin: 'com.google.gms.google-services'
dependencies { dependencies {
implementation project(':ABVJE_UI_Android') implementation project(':ABVJE_UI_Android')
implementation 'com.android.support:multidex:1.0.3' implementation 'androidx.multidex:multidex:2.0.0'
} }
android { android {
compileSdkVersion 31 compileSdkVersion 31
buildToolsVersion '31.0.0'
defaultConfig { defaultConfig {
minSdkVersion 23 minSdkVersion 23
...@@ -80,7 +79,8 @@ android { ...@@ -80,7 +79,8 @@ android {
} }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
} }
flavorDimensions "default" // OK flavorDimensions "default" // OK
...@@ -133,25 +133,30 @@ android { ...@@ -133,25 +133,30 @@ android {
} }
import org.ajoberstar.grgit.* import org.ajoberstar.grgit.*
task gitInfo << { task gitInfo {
description 'update githash.txt with current hash' doLast {
def grgit = Grgit.open(project.file('..')) description 'update githash.txt with current hash'
def gitfile=file('assets/githash.txt') def grgit = Grgit.open(project.file('..'))
gitfile.write grgit.head().id def gitfile = file('assets/githash.txt')
gitfile.write grgit.head().id
}
} }
preBuild.dependsOn gitInfo preBuild.dependsOn gitInfo
task convertToPackage << { task convertToPackage {
description 'convert to package for google-services.json' doLast {
def appModuleRootFolder = '.' description 'convert to package for google-services.json'
def googleServicesJson = 'google-services.json' def appModuleRootFolder = '.'
copy { def googleServicesJson = 'google-services.json'
from "fcm" copy {
include "$googleServicesJson" from "fcm"
into "$appModuleRootFolder" include "$googleServicesJson"
expand PACKAGE_NAME : app_custompackagename into "$appModuleRootFolder"
expand PACKAGE_NAME: app_custompackagename
}
} }
} }
preBuild.dependsOn convertToPackage preBuild.dependsOn convertToPackage
gradle.projectsEvaluated { gradle.projectsEvaluated {
......
...@@ -7,7 +7,6 @@ apply plugin: 'com.android.library' ...@@ -7,7 +7,6 @@ apply plugin: 'com.android.library'
android { android {
compileSdkVersion 31 compileSdkVersion 31
buildToolsVersion '31.0.0'
defaultConfig { defaultConfig {
minSdkVersion 23 minSdkVersion 23
......
...@@ -8,13 +8,13 @@ apply plugin: 'com.android.library' ...@@ -8,13 +8,13 @@ apply plugin: 'com.android.library'
dependencies { dependencies {
implementation 'com.android.support:multidex:1.0.3' implementation 'androidx.multidex:multidex:2.0.0'
implementation project(':ABVJE_BL') implementation project(':ABVJE_BL')
implementation project(':ABVJE_Res_Default_Android') implementation project(':ABVJE_Res_Default_Android')
implementation files('libs/ozrv_android.jar') implementation files('libs/ozrv_android.jar')
api 'com.google.firebase:firebase-core:11.4.0' api 'com.google.firebase:firebase-core:21.1.1'
api 'com.google.firebase:firebase-messaging:11.4.0' api 'com.google.firebase:firebase-messaging:23.0.8'
api 'com.android.support:appcompat-v7:25.0.0' api 'androidx.appcompat:appcompat:1.0.0'
implementation 'commons-codec:commons-codec:1.10' implementation 'commons-codec:commons-codec:1.10'
implementation 'net.lingala.zip4j:zip4j:1.3.2' implementation 'net.lingala.zip4j:zip4j:1.3.2'
...@@ -27,7 +27,6 @@ dependencies { ...@@ -27,7 +27,6 @@ dependencies {
android { android {
compileSdkVersion 31 compileSdkVersion 31
buildToolsVersion '31.0.0'
defaultConfig { defaultConfig {
minSdkVersion 23 minSdkVersion 23
......
...@@ -27,9 +27,9 @@ import android.os.Build.VERSION_CODES; ...@@ -27,9 +27,9 @@ import android.os.Build.VERSION_CODES;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.os.StatFs; import android.os.StatFs;
import android.support.v4.app.Fragment; import androidx.fragment.app.Fragment;
import android.support.v4.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import android.support.v4.util.LruCache; import androidx.collection.LruCache;
import android.util.Log; import android.util.Log;
import java.io.File; import java.io.File;
...@@ -49,9 +49,9 @@ import java.util.Set; ...@@ -49,9 +49,9 @@ import java.util.Set;
/** /**
* This class handles disk and memory caching of bitmaps in conjunction with the * This class handles disk and memory caching of bitmaps in conjunction with the
* {@link ImageWorker} class and its subclasses. Use * {@link ImageWorker} class and its subclasses. Use
* {@link ImageCache#getInstance(android.support.v4.app.FragmentManager, ImageCacheParams)} to get an instance of this * {@link ImageCache#getInstance(FragmentManager, ImageCacheParams)} to get an instance of this
* class, although usually a cache should be added directly to an {@link ImageWorker} by calling * class, although usually a cache should be added directly to an {@link ImageWorker} by calling
* {@link ImageWorker#addImageCache(android.support.v4.app.FragmentManager, ImageCacheParams)}. * {@link ImageWorker#addImageCache(FragmentManager, ImageCacheParams)}.
*/ */
public class ImageCache { public class ImageCache {
private static final String TAG = "ImageCache"; private static final String TAG = "ImageCache";
...@@ -83,7 +83,7 @@ public class ImageCache { ...@@ -83,7 +83,7 @@ public class ImageCache {
/** /**
* Create a new ImageCache object using the specified parameters. This should not be * Create a new ImageCache object using the specified parameters. This should not be
* called directly by other classes, instead use * called directly by other classes, instead use
* {@link ImageCache#getInstance(android.support.v4.app.FragmentManager, ImageCacheParams)} to fetch an ImageCache * {@link ImageCache#getInstance(FragmentManager, ImageCacheParams)} to fetch an ImageCache
* instance. * instance.
* *
* @param cacheParams The cache parameters to use to initialize the cache * @param cacheParams The cache parameters to use to initialize the cache
...@@ -453,8 +453,8 @@ public class ImageCache { ...@@ -453,8 +453,8 @@ public class ImageCache {
/** /**
* Create a set of image cache parameters that can be provided to * Create a set of image cache parameters that can be provided to
* {@link ImageCache#getInstance(android.support.v4.app.FragmentManager, ImageCacheParams)} or * {@link ImageCache#getInstance(FragmentManager, ImageCacheParams)} or
* {@link ImageWorker#addImageCache(android.support.v4.app.FragmentManager, ImageCacheParams)}. * {@link ImageWorker#addImageCache(FragmentManager, ImageCacheParams)}.
* @param context A context to use. * @param context A context to use.
* @param diskCacheDirectoryName A unique subdirectory name that will be appended to the * @param diskCacheDirectoryName A unique subdirectory name that will be appended to the
* application cache directory. Usually "cache" or "images" * application cache directory. Usually "cache" or "images"
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
package com.imagepicker; package com.imagepicker;
import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
...@@ -26,15 +25,12 @@ import android.graphics.drawable.BitmapDrawable; ...@@ -26,15 +25,12 @@ import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable; import android.graphics.drawable.TransitionDrawable;
import android.os.Looper;
import android.support.v4.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import android.support.v4.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import android.util.Log;
import android.widget.ImageView; import android.widget.ImageView;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
...@@ -71,7 +67,7 @@ public abstract class ImageWorker { ...@@ -71,7 +67,7 @@ public abstract class ImageWorker {
* Load an image specified by the data parameter into an ImageView (override * Load an image specified by the data parameter into an ImageView (override
* {@link ImageWorker#processBitmap(Object)} to define the processing logic). A memory and * {@link ImageWorker#processBitmap(Object)} to define the processing logic). A memory and
* disk cache will be used if an {@link ImageCache} has been added using * disk cache will be used if an {@link ImageCache} has been added using
* {@link ImageWorker#addImageCache(android.support.v4.app.FragmentManager, ImageCache.ImageCacheParams)}. If the * {@link ImageWorker#addImageCache(FragmentManager, ImageCache.ImageCacheParams)}. If the
* image is found in the memory cache, it is set immediately, otherwise an {@link AsyncTask} * image is found in the memory cache, it is set immediately, otherwise an {@link AsyncTask}
* will be created to asynchronously load the bitmap. * will be created to asynchronously load the bitmap.
* *
......
...@@ -13,7 +13,7 @@ import android.net.wifi.WifiInfo; ...@@ -13,7 +13,7 @@ import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager; import android.net.wifi.WifiManager;
import android.os.Environment; import android.os.Environment;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.support.annotation.NonNull; import androidx.annotation.NonNull;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
......
...@@ -8,6 +8,7 @@ import android.app.PendingIntent; ...@@ -8,6 +8,7 @@ import android.app.PendingIntent;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Build; import android.os.Build;
import androidx.annotation.NonNull;
import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage; import com.google.firebase.messaging.RemoteMessage;
...@@ -18,7 +19,6 @@ import org.json.adf.JSONObject; ...@@ -18,7 +19,6 @@ import org.json.adf.JSONObject;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import jp.agentec.abook.abv.bl.common.constant.ABookCommConstants;
import jp.agentec.abook.abv.bl.common.exception.ABVException; import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.dto.MemberInfoDto; import jp.agentec.abook.abv.bl.dto.MemberInfoDto;
...@@ -26,11 +26,11 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic; ...@@ -26,11 +26,11 @@ import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.CommunicationLogic; import jp.agentec.abook.abv.bl.logic.CommunicationLogic;
import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic; import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.util.AppUtil; import jp.agentec.abook.abv.cl.util.AppUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVAuthenticatedActivity; import jp.agentec.abook.abv.ui.common.activity.ABVAuthenticatedActivity;
import jp.agentec.abook.abv.ui.common.activity.ShowPushMessageDailogActivity; import jp.agentec.abook.abv.ui.common.activity.ShowPushMessageDailogActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.home.activity.ChatWebViewActivity;
import jp.agentec.abook.abv.ui.home.activity.OperationListActivity; import jp.agentec.abook.abv.ui.home.activity.OperationListActivity;
import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity; import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity;
import jp.agentec.abook.abv.ui.home.activity.SplashScreenActivity; import jp.agentec.abook.abv.ui.home.activity.SplashScreenActivity;
...@@ -61,6 +61,11 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -61,6 +61,11 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
} }
} }
} }
@Override
public void onNewToken(@NonNull String token) {
Logger.i(TAG, "onNewToken token = " + token);
PreferenceUtil.putUserPref(this, AppDefType.UserPrefKey.NEED_SEND_TOKEN, true);
}
@Override @Override
public void onMessageReceived(RemoteMessage remoteMessage) { public void onMessageReceived(RemoteMessage remoteMessage) {
...@@ -176,9 +181,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService { ...@@ -176,9 +181,7 @@ public class ABVFcmListenerService extends FirebaseMessagingService {
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
int uniqueId = (int) System.currentTimeMillis(); int uniqueId = (int) System.currentTimeMillis();
PendingIntent pendingIntent = PendingIntent.getActivity(this, uniqueId, intent, PendingIntent.FLAG_UPDATE_CURRENT|PendingIntent.FLAG_IMMUTABLE);
PendingIntent pendingIntent = PendingIntent.getActivity(this, uniqueId, intent, PendingIntent.FLAG_UPDATE_CURRENT);
notification = getNotificationBuilder(pendingIntent, message).setChannelId(getApplicationContext().getPackageName()).build(); notification = getNotificationBuilder(pendingIntent, message).setChannelId(getApplicationContext().getPackageName()).build();
if (mNotificationManager != null) { if (mNotificationManager != null) {
......
package jp.agentec.abook.abv.cl.push;
import com.google.firebase.iid.FirebaseInstanceIdService;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
public class ABVInstanceIDListenerService extends FirebaseInstanceIdService {
private static final String TAG = "ABVInstanceID";
@Override
public void onTokenRefresh() {
Logger.i(TAG, "onTokenRefresh()");
PreferenceUtil.putUserPref(this, AppDefType.UserPrefKey.NEED_SEND_TOKEN, true);
}
}
...@@ -2,44 +2,45 @@ package jp.agentec.abook.abv.cl.push; ...@@ -2,44 +2,45 @@ package jp.agentec.abook.abv.cl.push;
import android.content.Context; import android.content.Context;
import com.google.firebase.iid.FirebaseInstanceId; import androidx.annotation.NonNull;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.messaging.FirebaseMessaging;
import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.cl.util.ThreadUtil; import jp.agentec.abook.abv.cl.util.ThreadUtil;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
public class FcmManager { public class FcmManager {
private static final String TAG = "FcmManager";
/** /**
* FcmTokenを返す。ただし、PushMessageの利用なしの場合は、noneIdを返す。 * FcmTokenを返す。ただし、PushMessageの利用なしの場合は、noneIdを返す。
* @param context Context * @param context Context
* @return String * @return String
*/ */
public static String getFcmToken(Context context) { public static void getFcmToken(Context context, final Callback resultCallback) {
String fcmToken;
if (context.getResources().getInteger(R.integer.push_message) == 1) { if (context.getResources().getInteger(R.integer.push_message) == 1) {
fcmToken = getFcmTokenWithRetryCount(10); FirebaseMessaging.getInstance().getToken()
.addOnCompleteListener(new OnCompleteListener<String>() {
@Override
public void onComplete(@NonNull Task<String> task) {
if (!task.isSuccessful()) {
Logger.w(TAG, "Fetching FCM registration token failed", task.getException());
resultCallback.callback(null);
return;
}
// Get new FCM registration token
String token = task.getResult();
resultCallback.callback(token);
}
});
} else { } else {
fcmToken = "noneId"; resultCallback.callback("noneId");
}
return fcmToken;
}
private static String getFcmTokenWithRetryCount(int retryCount) {
String token = FirebaseInstanceId.getInstance().getToken();
if (token != null) {
return token;
}
// Tokenの取得に失敗したため、{retryCount}回までリトライする
int count = 0;
while (count < retryCount && token == null) {
ThreadUtil.sleep(1000);// 1sec
count++;
Logger.d("FcmManager", "[getFcmTokenWithRetry]:retry_count=" + count);
token = FirebaseInstanceId.getInstance().getToken();
} }
return token;
} }
} }
\ No newline at end of file
...@@ -3,8 +3,8 @@ package jp.agentec.abook.abv.launcher.android; ...@@ -3,8 +3,8 @@ package jp.agentec.abook.abv.launcher.android;
import android.app.Activity; import android.app.Activity;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
import android.support.multidex.MultiDex; import androidx.multidex.MultiDex;
import android.support.multidex.MultiDexApplication; import androidx.multidex.MultiDexApplication;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
......
...@@ -14,7 +14,7 @@ import android.net.Uri; ...@@ -14,7 +14,7 @@ import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Environment; import android.os.Environment;
import android.os.IBinder; import android.os.IBinder;
import android.support.v4.content.FileProvider; import androidx.core.content.FileProvider;
import java.io.File; import java.io.File;
......
...@@ -8,7 +8,7 @@ import android.database.Cursor; ...@@ -8,7 +8,7 @@ import android.database.Cursor;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Environment; import android.os.Environment;
import android.support.v4.content.FileProvider; import androidx.core.content.FileProvider;
import android.util.Log; import android.util.Log;
import android.widget.Toast; import android.widget.Toast;
......
...@@ -27,7 +27,6 @@ import android.widget.RadioGroup; ...@@ -27,7 +27,6 @@ import android.widget.RadioGroup;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.google.firebase.iid.FirebaseInstanceId;
import net.lingala.zip4j.exception.ZipException; import net.lingala.zip4j.exception.ZipException;
...@@ -92,6 +91,7 @@ import jp.agentec.abook.abv.bl.logic.OperationLogic; ...@@ -92,6 +91,7 @@ import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic; import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic; import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler; import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler;
import jp.agentec.abook.abv.cl.push.FcmManager;
import jp.agentec.abook.abv.cl.push.PushMessageJSON; import jp.agentec.abook.abv.cl.push.PushMessageJSON;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.cl.util.StorageUtil; import jp.agentec.abook.abv.cl.util.StorageUtil;
...@@ -215,7 +215,22 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -215,7 +215,22 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// 更新されてない // 更新されてない
return; return;
} }
String fcmToken = FirebaseInstanceId.getInstance().getToken(); final Callback resultCallback = new Callback() {
@Override
public Object callback(Object ret) {
String fcmToken = (String)ret;
needSendDeviceToken(fcmToken);
return null;
}
};
FcmManager.getFcmToken(this, resultCallback);
}
/**
* デバイストークン取得後の処理
* @param fcmToken デバイストークン
*/
private void needSendDeviceToken(String fcmToken) {
boolean isSendSuccess = false; boolean isSendSuccess = false;
// CMSに送信 // CMSに送信
if (getRInteger(R.integer.push_message) == 1 && fcmToken != null) { if (getRInteger(R.integer.push_message) == 1 && fcmToken != null) {
...@@ -239,7 +254,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -239,7 +254,6 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
PreferenceUtil.putUserPref(this, UserPrefKey.NEED_SEND_TOKEN, !isSendSuccess); PreferenceUtil.putUserPref(this, UserPrefKey.NEED_SEND_TOKEN, !isSendSuccess);
} }
@Override @Override
protected void onStart() { protected void onStart() {
super.onStart(); super.onStart();
......
...@@ -3,6 +3,7 @@ package jp.agentec.abook.abv.ui.common.activity; ...@@ -3,6 +3,7 @@ package jp.agentec.abook.abv.ui.common.activity;
import android.widget.Toast; import android.widget.Toast;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.exception.ABVException; import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.log.LogLevel; import jp.agentec.abook.abv.bl.common.log.LogLevel;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
...@@ -24,23 +25,32 @@ public abstract class ABVLoginActivity extends ABVNoAuthenticatedActivity { ...@@ -24,23 +25,32 @@ public abstract class ABVLoginActivity extends ABVNoAuthenticatedActivity {
* 必要なければユーザ情報を保存する。 * 必要なければユーザ情報を保存する。
*/ */
protected void fcmRegister() { protected void fcmRegister() {
String fcmToken = FcmManager.getFcmToken(this); final Callback resultCallback = new Callback() {
try { @Override
if (fcmToken == null) { public Object callback(Object ret) {
Logger.w(TAG, "[fcmRegister]: FCM Token is null."); String fcmToken = (String)ret;
runOnUiThread(new Runnable() { try {
@Override if (fcmToken == null) {
public void run() { Logger.w(TAG, "[fcmRegister]: FCM Token is null.");
ABVToastUtil.showMakeText(ABVLoginActivity.this, R.string.fcm_not_supported, Toast.LENGTH_SHORT); runOnUiThread(new Runnable() {
@Override
public void run() {
ABVToastUtil.showMakeText(ABVLoginActivity.this, R.string.fcm_not_supported, Toast.LENGTH_SHORT);
}
});
// FCMトークンを取得できない場合、noneIdでセットしてログインする
fcmToken = "noneId";
} }
}); serverLoginAndCheckChangeUser(fcmToken);
// FCMトークンを取得できない場合、noneIdでセットしてログインする } finally {
fcmToken = "noneId"; closeProgressPopup();
}
return null;
} }
serverLoginAndCheckChangeUser(fcmToken); };
} finally {
closeProgressPopup(); FcmManager.getFcmToken(this, resultCallback);
}
} }
/** /**
......
...@@ -107,14 +107,21 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity { ...@@ -107,14 +107,21 @@ public abstract class ABVNoAuthenticatedActivity extends ABVActivity {
CommonExecutor.execute(new Runnable() { CommonExecutor.execute(new Runnable() {
@Override @Override
public void run() { public void run() {
String fcmToken = FcmManager.getFcmToken(mContext); final Callback resultCallback = new Callback() {
if (fcmToken == null) { @Override
ABVToastUtil.showMakeText(mContext, R.string.fcm_not_supported, Toast.LENGTH_SHORT); public Object callback(Object ret) {
// FCMトークンを取得できない場合、noneIdでセットしてログインする String fcmToken = (String)ret;
fcmToken = "noneId"; if (fcmToken == null) {
} ABVToastUtil.showMakeText(mContext, R.string.fcm_not_supported, Toast.LENGTH_SHORT);
noAuthenticatedShowMain(isGuestLogin, fcmToken, urlPath); // FCMトークンを取得できない場合、noneIdでセットしてログインする
} fcmToken = "noneId";
}
noAuthenticatedShowMain(isGuestLogin, fcmToken, urlPath);
return null;
}
};
FcmManager.getFcmToken(mContext, resultCallback);
}
}); });
} }
......
...@@ -4,7 +4,7 @@ import android.content.DialogInterface; ...@@ -4,7 +4,7 @@ import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnClickListener;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import android.view.View; import android.view.View;
import java.io.IOException; import java.io.IOException;
...@@ -12,7 +12,6 @@ import java.io.InputStream; ...@@ -12,7 +12,6 @@ import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.ArrayList; import java.util.ArrayList;
import jp.agentec.abook.abv.bl.acms.type.LoginMode;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao; import jp.agentec.abook.abv.bl.data.dao.ContentDao;
......
...@@ -25,7 +25,7 @@ import android.os.AsyncTask; ...@@ -25,7 +25,7 @@ import android.os.AsyncTask;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.support.annotation.RequiresApi; import androidx.annotation.RequiresApi;
import android.util.Log; import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.ViewGroup; import android.view.ViewGroup;
......
package jp.agentec.abook.abv.ui.home.helper; package jp.agentec.abook.abv.ui.home.helper;
import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
...@@ -9,7 +8,7 @@ import android.content.pm.PackageManager; ...@@ -9,7 +8,7 @@ import android.content.pm.PackageManager;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.provider.Settings; import android.provider.Settings;
import android.support.v4.content.ContextCompat; import androidx.core.content.ContextCompat;
import java.util.ArrayList; import java.util.ArrayList;
......
...@@ -10,7 +10,7 @@ import android.content.res.Configuration; ...@@ -10,7 +10,7 @@ import android.content.res.Configuration;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.support.v4.content.FileProvider; import androidx.core.content.FileProvider;
import android.webkit.MimeTypeMap; import android.webkit.MimeTypeMap;
import android.widget.Toast; import android.widget.Toast;
......
...@@ -3,7 +3,7 @@ package jp.agentec.abook.abv.ui.home.view; ...@@ -3,7 +3,7 @@ package jp.agentec.abook.abv.ui.home.view;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.os.Build; import android.os.Build;
import android.support.v4.content.ContextCompat; import androidx.core.content.ContextCompat;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
......
...@@ -4,7 +4,7 @@ import android.content.Intent; ...@@ -4,7 +4,7 @@ import android.content.Intent;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.content.res.ResourcesCompat; import androidx.core.content.res.ResourcesCompat;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
......
...@@ -6,7 +6,7 @@ buildscript { ...@@ -6,7 +6,7 @@ buildscript {
google() google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.1.4' classpath 'com.android.tools.build:gradle:3.6.4'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
} }
......
...@@ -139,3 +139,5 @@ privacy_policy_url=https://www.agentec.jp/privacy/ ...@@ -139,3 +139,5 @@ privacy_policy_url=https://www.agentec.jp/privacy/
#利用規約に同意するのテキストがあるURL #利用規約に同意するのテキストがあるURL
agree_to_terms_of_use_url=https://chatdev2.agentec.jp/acms/common/getAgreement/ agree_to_terms_of_use_url=https://chatdev2.agentec.jp/acms/common/getAgreement/
android.useAndroidX=true
android.enableJetifier=true
#Tue Feb 19 17:59:22 JST 2019 #Mon Oct 17 17:00:19 KST 2022
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
...@@ -2,7 +2,6 @@ apply plugin: 'com.android.library' ...@@ -2,7 +2,6 @@ apply plugin: 'com.android.library'
android { android {
compileSdkVersion 31 compileSdkVersion 31
buildToolsVersion '31.0.0'
defaultConfig { defaultConfig {
minSdkVersion 23 minSdkVersion 23
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment