Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
349e1746
Commit
349e1746
authored
Jun 15, 2022
by
onuma
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'features/1.4.300' into features/1.4.300_47940
parents
efcda418
13462e3f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
26 deletions
+40
-26
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/ABVEnvironment.java
+0
-2
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookKeys.java
+1
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
+39
-24
No files found.
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/ABVEnvironment.java
View file @
349e1746
...
...
@@ -157,8 +157,6 @@ public class ABVEnvironment {
public
static
final
String
ContinuousTaskReportJsonDirFormat
=
ContentCacheDirectoryFormat
+
"/processList/phaseList/phase_%d"
;
// アルコールチェッカー(userDataKey)を保存する場所
public
static
final
String
userDataDir
=
"/userData/"
;
// 保存するファイル名
public
static
final
String
userDataKeyFile
=
"userDataKey"
;
/**
* コンテンツのファイルを暗号化するときに、暗号化するサイズをバイト単位で指定します。
...
...
ABVJE_BL/src/jp/agentec/abook/abv/bl/common/constant/ABookKeys.java
View file @
349e1746
...
...
@@ -88,6 +88,7 @@ public class ABookKeys {
public
static
final
String
ATTACHED_CHANGE_FLAG
=
"attachedChangeFlag"
;
public
static
final
String
ROUTINE_TASK_FLAG
=
"routineTaskFlag"
;
public
static
final
String
UPDATE_HOTSPOT_ONLY_FLAG
=
"updateHotSpotOnlyFlag"
;
public
static
final
String
USER_DATA
=
"userData"
;
//Webviewから呼び出すApiキー
public
static
final
class
CMD_KEY
{
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/activity/ABVContentViewActivity.java
View file @
349e1746
...
...
@@ -1525,10 +1525,13 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_LOAD_USER_DATA
))
{
// 前回の入力内容を読み込む
Logger
.
i
(
TAG
,
"load taskKey = "
+
abookCheckParam
.
get
(
ABookKeys
.
TASK_KEY
));
loadUserDataKey
(
abookCheckParam
.
get
(
ABookKeys
.
TASK_KEY
));
}
else
if
(
mCmd
.
equals
(
ABookKeys
.
CMD_SAVE_USER_DATA
))
{
// 入力内容を保存する
saveUserDataKey
(
abookCheckParam
.
get
(
ABookKeys
.
TASK_KEY
));
Logger
.
i
(
TAG
,
"save taskKey = "
+
abookCheckParam
.
get
(
ABookKeys
.
TASK_KEY
));
Logger
.
i
(
TAG
,
"save userData = "
+
abookCheckParam
.
get
(
ABookKeys
.
USER_DATA
));
saveUserDataKey
(
abookCheckParam
.
get
(
ABookKeys
.
TASK_KEY
),
abookCheckParam
.
get
(
ABookKeys
.
USER_DATA
));
}
}
...
...
@@ -1545,12 +1548,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
/**
* JSから送られてきたキーデータを保存する
* @param userDataKey 保存するユーザーキー
* @param userKeyFileName 保存するユーザーキーファイル名
* @param userData 保存するデータ
*/
private
void
saveUserDataKey
(
String
userDataKey
)
{
if
(
StringUtil
.
isNullOrEmpty
(
userDataKey
))
{
private
void
saveUserDataKey
(
String
userKeyFileName
,
String
userData
)
{
if
(
StringUtil
.
isNullOrEmpty
(
userKeyFileName
))
{
Logger
.
d
(
TAG
,
"userKeyFileName is null or empty."
);
// 読み込むためのキーがない
afterABookCheckApi
(
ABookKeys
.
CMD_SAVE_USER_DATA
,
user
DataKey
,
1
,
""
,
""
);
afterABookCheckApi
(
ABookKeys
.
CMD_SAVE_USER_DATA
,
user
KeyFileName
,
1
,
""
,
""
);
return
;
}
...
...
@@ -1565,50 +1570,56 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// 一番下のフォルダ名 = ユーザーID
String
userId
=
FileUtil
.
getLastChildDirectoryName
(
dir
);
//
Logger.d(TAG,"userId = %s", userId);
Logger
.
d
(
TAG
,
"userId = %s"
,
userId
);
if
(!
ABVDataCache
.
getInstance
().
getMemberInfo
().
loginId
.
equals
(
userId
))
{
// ログインしているユーザー以外のものは削除
FileUtil
.
delete
(
dir
);
continue
;
}
BufferedWriter
bw
=
null
;
if
(
userData
Key
!=
null
)
{
if
(
userData
!=
null
)
{
try
{
FileOutputStream
fo
=
new
FileOutputStream
(
userDataFolderRoot
+
"/"
+
userId
+
"/"
+
ABVEnvironment
.
getInstance
().
userDataKeyFil
e
);
FileOutputStream
fo
=
new
FileOutputStream
(
userDataFolderRoot
+
"/"
+
userId
+
"/"
+
userKeyFileNam
e
);
OutputStreamWriter
osw
=
new
OutputStreamWriter
(
fo
,
StandardCharsets
.
UTF_8
);
bw
=
new
BufferedWriter
(
osw
);
bw
.
write
(
userData
Key
);
bw
.
write
(
userData
);
bw
.
close
();
}
catch
(
IOException
e
)
{
System
.
out
.
println
(
"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
);
Logger
.
e
(
TAG
,
""
+
e
);
}
finally
{
try
{
bw
.
close
();
if
(
bw
!=
null
)
{
bw
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
);
Logger
.
e
(
TAG
,
""
+
e
);
}
}
afterABookCheckApi
(
ABookKeys
.
CMD_SAVE_USER_DATA
,
userDataKey
,
0
,
""
,
""
);
break
;
afterABookCheckApi
(
ABookKeys
.
CMD_SAVE_USER_DATA
,
userKeyFileName
,
0
,
""
,
""
);
}
}
catch
(
IndexOutOfBoundsException
iobex
)
{
System
.
out
.
println
(
"aaaaaaaaaaaaaaaaa"
);
Logger
.
e
(
TAG
,
""
+
iobex
);
}
}
}
/**
* キーデータファイルを読み込んで、JSにわたす
* @param userKeyFileName ファイル名
*/
private
void
loadUserDataKey
(
String
user
DataKey
)
{
private
void
loadUserDataKey
(
String
user
KeyFileName
)
{
if
(
StringUtil
.
isNullOrEmpty
(
userDataKey
))
{
// 読み込むためのキーがない
afterABookCheckApi
(
ABookKeys
.
CMD_LOAD_USER_DATA
,
userDataKey
,
1
,
""
,
""
);
if
(
StringUtil
.
isNullOrEmpty
(
userKeyFileName
))
{
Logger
.
d
(
TAG
,
"userKeyFileName is null or Empty"
);
// ファイル名が指定されていない
afterABookCheckApi
(
ABookKeys
.
CMD_LOAD_USER_DATA
,
userKeyFileName
,
1
,
""
,
""
);
return
;
}
String
keyFilePath
=
getUserDataDirRoot
()
+
"/"
+
ABVDataCache
.
getInstance
().
getMemberInfo
().
loginId
+
"/"
+
ABVEnvironment
.
getInstance
().
userDataKeyFile
;
String
keyFilePath
=
getUserDataDirRoot
()
+
"/"
+
ABVDataCache
.
getInstance
().
getMemberInfo
().
loginId
+
"/"
+
userKeyFileName
;
Logger
.
d
(
TAG
,
"keyFilePath = "
+
keyFilePath
);
FileInputStream
fi
=
null
;
InputStreamReader
isr
=
null
;
...
...
@@ -1624,11 +1635,13 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
sb
.
append
((
char
)
data
);
}
isr
.
close
();
afterABookCheckApi
(
ABookKeys
.
CMD_LOAD_USER_DATA
,
userDataKey
,
0
,
""
,
sb
.
toString
());
}
catch
(
FileNotFoundException
fnfex
)
{
Logger
.
d
(
TAG
,
"result = "
+
sb
.
toString
());
afterABookCheckApi
(
ABookKeys
.
CMD_LOAD_USER_DATA
,
userKeyFileName
,
0
,
""
,
sb
.
toString
());
return
;
}
catch
(
FileNotFoundException
fex
)
{
Logger
.
e
(
TAG
,
""
+
fex
);
}
catch
(
IOException
e
)
{
Logger
.
e
(
TAG
,
""
+
e
);
}
finally
{
try
{
if
(
isr
!=
null
)
{
...
...
@@ -1638,6 +1651,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
e
.
printStackTrace
();
}
}
// 何かしらのExceptionが発生した
afterABookCheckApi
(
ABookKeys
.
CMD_LOAD_USER_DATA
,
userKeyFileName
,
1
,
""
,
""
);
}
public
void
commonAttachedDataUrl
(
String
taskKey
,
String
data
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment