Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
cdf179da
Commit
cdf179da
authored
Sep 30, 2021
by
feihuaduo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复开启决斗助手后普通卡密重复检测的问题
去除决斗助手悬浮窗、通知 优化决斗助手检测效率
parent
0a71b503
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
80 additions
and
60 deletions
+80
-60
mobile/cn/release/output-metadata.json
mobile/cn/release/output-metadata.json
+18
-0
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
...ava/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
+7
-5
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+10
-11
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
+22
-25
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
...mb/ygomobile/ui/preference/fragments/SettingFragment.java
+5
-5
mobile/src/main/java/cn/garymb/ygomobile/utils/YGOUtil.java
mobile/src/main/java/cn/garymb/ygomobile/utils/YGOUtil.java
+5
-5
mobile/src/main/java/com/ourygo/assistant/util/ClipManagement.java
...c/main/java/com/ourygo/assistant/util/ClipManagement.java
+2
-2
mobile/src/main/java/com/ourygo/assistant/util/DuelAssistantManagement.java
...va/com/ourygo/assistant/util/DuelAssistantManagement.java
+9
-2
mobile/src/main/java/com/ourygo/assistant/util/Record.java
mobile/src/main/java/com/ourygo/assistant/util/Record.java
+1
-1
mobile/src/main/res/layout/dialog_deck_share.xml
mobile/src/main/res/layout/dialog_deck_share.xml
+1
-1
mobile/src/main/res/values-ko/strings.xml
mobile/src/main/res/values-ko/strings.xml
+0
-1
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+0
-1
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+0
-1
No files found.
mobile/cn/release/output-metadata.json
0 → 100644
View file @
cdf179da
{
"version"
:
2
,
"artifactType"
:
{
"type"
:
"APK"
,
"kind"
:
"Directory"
},
"applicationId"
:
"cn.garymb.ygomobile"
,
"variantName"
:
"cnRelease"
,
"elements"
:
[
{
"type"
:
"SINGLE"
,
"filters"
:
[],
"versionCode"
:
380800907
,
"versionName"
:
"3.8.8"
,
"outputFile"
:
"mobile-cn-release.apk"
}
]
}
\ No newline at end of file
mobile/src/main/java/cn/garymb/ygomobile/ui/cards/DeckManagerActivity.java
View file @
cdf179da
...
...
@@ -39,6 +39,7 @@ import com.nightonke.boommenu.BoomButtons.BoomButton;
import
com.nightonke.boommenu.BoomButtons.TextOutsideCircleButton
;
import
com.nightonke.boommenu.BoomMenuButton
;
import
com.ourygo.assistant.service.DuelAssistantService
;
import
com.ourygo.assistant.util.DuelAssistantManagement
;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
...
...
@@ -801,17 +802,18 @@ public class DeckManagerActivity extends BaseCardsActivity implements RecyclerVi
ImageView
iv_image
=
viewDialog
.
findViewById
(
R
.
id
.
iv_image
);
Button
bt_image_share
=
viewDialog
.
findViewById
(
R
.
id
.
bt_image_share
);
Button
bt_code_share
=
viewDialog
.
findViewById
(
R
.
id
.
bt_code_share
);
EditText
et
_code
=
viewDialog
.
findViewById
(
R
.
id
.
et_code
);
et
_code
.
setText
(
mDeckAdapater
.
getDeckInfo
().
toDeck
().
toAppUri
().
toString
());
TextView
tv
_code
=
viewDialog
.
findViewById
(
R
.
id
.
et_code
);
tv
_code
.
setText
(
mDeckAdapater
.
getDeckInfo
().
toDeck
().
toAppUri
().
toString
());
ImageUtil
.
setImage
(
this
,
savePath
,
iv_image
);
bt_code_share
.
setOnClickListener
(
v
->
{
du
.
dis
();
stopService
(
new
Intent
(
this
,
DuelAssistantService
.
class
));
YGOUtil
.
copyMessage
(
this
,
et_code
.
getText
().
toString
().
trim
());
// stopService(new Intent(this, DuelAssistantService.class));
YGOUtil
.
copyMessage
(
this
,
tv_code
.
getText
().
toString
().
trim
());
DuelAssistantManagement
.
getInstance
().
setLastMessage
(
tv_code
.
getText
().
toString
().
trim
());
showToast
(
getString
(
R
.
string
.
deck_text_copyed
));
//复制完毕开启决斗助手
YGOUtil
.
startDuelService
(
this
);
//
YGOUtil.startDuelService(this);
});
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
cdf179da
...
...
@@ -161,6 +161,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
protected
void
onResume
()
{
super
.
onResume
();
BacktoDuel
();
duelAssistantCheck
();
}
@Override
...
...
@@ -172,24 +173,22 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
private
void
duelAssistantCheck
()
{
if
(
AppsSettings
.
get
().
isServiceDuelAssistant
())
{
Handler
handler
=
new
Handler
();
handler
.
postDelayed
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
FileLogUtil
.
writeAndTime
(
"主页决斗助手检查"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
duelAssistantManagement
.
checkClip
(
ID_MAINACTIVITY
);
handler
.
postDelayed
(()
->
{
try
{
FileLogUtil
.
writeAndTime
(
"主页决斗助手检查"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
duelAssistantManagement
.
checkClip
(
ID_MAINACTIVITY
);
},
500
);
}
}
@Override
protected
void
onStart
()
{
super
.
onStart
();
duelAssistantCheck
();
}
@Override
...
...
@@ -225,7 +224,7 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
duelAssistantManagement
=
DuelAssistantManagement
.
getInstance
();
duelAssistantManagement
.
init
(
getApplicationContext
());
duelAssistantManagement
.
addDuelAssistantListener
(
this
);
YGOUtil
.
startDuelService
(
this
);
//
YGOUtil.startDuelService(this);
}
//检查是否有刘海
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/MainActivity.java
View file @
cdf179da
...
...
@@ -135,36 +135,33 @@ public class MainActivity extends HomeActivity {
}
}
});*/
dialog
.
setOnDismissListener
(
new
DialogInterface
.
OnDismissListener
()
{
@Override
public
void
onDismiss
(
DialogInterface
dialogInterface
)
{
if
(
AppsSettings
.
get
().
isServiceDuelAssistant
()
&&
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)
YGOUtil
.
isServicePermission
(
MainActivity
.
this
,
true
);
File
oriDeckFiles
=
new
File
(
ORI_DECK
);
File
deckFiles
=
new
File
(
AppsSettings
.
get
().
getDeckDir
());
if
(
oriDeckFiles
.
exists
()
&&
deckFiles
.
list
().
length
<=
1
)
{
DialogPlus
dlgpls
=
new
DialogPlus
(
MainActivity
.
this
);
dlgpls
.
setTitle
(
R
.
string
.
tip
);
dlgpls
.
setMessage
(
R
.
string
.
restore_deck
);
dlgpls
.
setLeftButtonText
(
R
.
string
.
Cancel
);
dlgpls
.
setLeftButtonListener
((
dlg
,
i
)
->
{
dlgpls
.
dismiss
();
});
dlgpls
.
setRightButtonText
(
R
.
string
.
deck_restore
);
dlgpls
.
setRightButtonListener
((
dlg
,
i
)
->
{
startPermissionsActivity
();
dlgpls
.
dismiss
();
});
dlgpls
.
show
();
}
dialog
.
setOnDismissListener
(
dialogInterface
->
{
// if (AppsSettings.get().isServiceDuelAssistant() && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
// YGOUtil.isServicePermission(MainActivity.this, true);
File
oriDeckFiles
=
new
File
(
ORI_DECK
);
File
deckFiles
=
new
File
(
AppsSettings
.
get
().
getDeckDir
());
if
(
oriDeckFiles
.
exists
()
&&
deckFiles
.
list
().
length
<=
1
)
{
DialogPlus
dlgpls
=
new
DialogPlus
(
MainActivity
.
this
);
dlgpls
.
setTitle
(
R
.
string
.
tip
);
dlgpls
.
setMessage
(
R
.
string
.
restore_deck
);
dlgpls
.
setLeftButtonText
(
R
.
string
.
Cancel
);
dlgpls
.
setLeftButtonListener
((
dlg
,
i
)
->
{
dlgpls
.
dismiss
();
});
dlgpls
.
setRightButtonText
(
R
.
string
.
deck_restore
);
dlgpls
.
setRightButtonListener
((
dlg
,
i
)
->
{
startPermissionsActivity
();
dlgpls
.
dismiss
();
});
dlgpls
.
show
();
}
});
dialog
.
show
();
}
}
else
{
if
(
AppsSettings
.
get
().
isServiceDuelAssistant
()
&&
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
Q
)
YGOUtil
.
isServicePermission
(
MainActivity
.
this
,
true
);
//
if (AppsSettings.get().isServiceDuelAssistant() && Build.VERSION.SDK_INT < Build.VERSION_CODES.Q)
//
YGOUtil.isServicePermission(MainActivity.this, true);
getGameUriManager
().
doIntent
(
getIntent
());
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
View file @
cdf179da
...
...
@@ -192,11 +192,11 @@ public class SettingFragment extends PreferenceFragmentPlus {
}
//开关决斗助手
if
(
preference
.
getKey
().
equals
(
PREF_START_SERVICEDUELASSISTANT
))
{
if
(
checkBoxPreference
.
isChecked
())
{
getActivity
().
startService
(
new
Intent
(
getActivity
(),
DuelAssistantService
.
class
));
}
else
{
getActivity
().
stopService
(
new
Intent
(
getActivity
(),
DuelAssistantService
.
class
));
}
//
if (checkBoxPreference.isChecked()) {
//
getActivity().startService(new Intent(getActivity(), DuelAssistantService.class));
//
} else {
//
getActivity().stopService(new Intent(getActivity(), DuelAssistantService.class));
//
}
}
return
true
;
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/YGOUtil.java
View file @
cdf179da
...
...
@@ -69,11 +69,11 @@ public class YGOUtil {
}
public
static
void
startDuelService
(
Context
context
)
{
if
(
AppsSettings
.
get
().
isServiceDuelAssistant
())
{
if
(!
Util
.
startDuelService
(
context
))
{
getNotificationPermissionDialog
(
context
).
show
();
}
}
//
if (AppsSettings.get().isServiceDuelAssistant()) {
//
if (!Util.startDuelService(context)) {
//
getNotificationPermissionDialog(context).show();
//
}
//
}
}
...
...
mobile/src/main/java/com/ourygo/assistant/util/ClipManagement.java
View file @
cdf179da
...
...
@@ -72,8 +72,8 @@ public class ClipManagement implements ClipboardManager.OnPrimaryClipChangedList
if
(
TextUtils
.
isEmpty
(
clipMessage
))
{
return
;
}
if
(
onClipChangedListener
!=
null
)
onClipChangedListener
.
onClipChanged
(
clipMessage
,
false
,
ID_CLIP_LISTENER
);
//
if (onClipChangedListener != null)
//
onClipChangedListener.onClipChanged(clipMessage, false, ID_CLIP_LISTENER);
}
public
void
onPrimaryClipChanged
(
boolean
isCheck
,
int
id
)
{
...
...
mobile/src/main/java/com/ourygo/assistant/util/DuelAssistantManagement.java
View file @
cdf179da
...
...
@@ -4,6 +4,7 @@ package com.ourygo.assistant.util;
import
android.content.Context
;
import
android.net.Uri
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
com.ourygo.assistant.base.listener.OnClipChangedListener
;
import
com.ourygo.assistant.base.listener.OnDuelAssistantListener
;
...
...
@@ -143,6 +144,7 @@ public class DuelAssistantManagement implements OnClipChangedListener {
return
false
;
}
onJoinRoom
(
null
,
0
,
message
.
substring
(
start
,
end
),
id
);
return
true
;
}
return
false
;
}
...
...
@@ -226,8 +228,13 @@ public class DuelAssistantManagement implements OnClipChangedListener {
lastMessage
=
clipMessage
;
}
else
if
(
roomCheck
(
clipMessage
,
id
))
{
lastMessage
=
clipMessage
;
}
else
if
(
cardSearchCheck
(
clipMessage
,
id
))
lastMessage
=
clipMessage
;
}
// else if (cardSearchCheck(clipMessage, id))
// lastMessage = clipMessage;
}
public
void
setLastMessage
(
String
lastMessage
)
{
this
.
lastMessage
=
lastMessage
;
}
public
void
checkClip
(
int
id
)
{
...
...
mobile/src/main/java/com/ourygo/assistant/util/Record.java
View file @
cdf179da
...
...
@@ -46,7 +46,7 @@ public class Record {
public
static
final
String
ARG_PASSWORD_ALL
=
"password"
;
public
static
final
String
ARG_YGO_TYPE
=
"ygotype"
;
public
static
final
String
ARG_DECK
=
"deck"
;
public
static
final
String
ARG_ROOM
=
"
deck
"
;
public
static
final
String
ARG_ROOM
=
"
room
"
;
}
mobile/src/main/res/layout/dialog_deck_share.xml
View file @
cdf179da
...
...
@@ -52,7 +52,7 @@
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<androidx.appcompat.widget.AppCompat
EditText
<androidx.appcompat.widget.AppCompat
TextView
android:id=
"@+id/et_code"
android:layout_width=
"match_parent"
android:layout_height=
"280dp"
...
...
mobile/src/main/res/values-ko/strings.xml
View file @
cdf179da
...
...
@@ -250,7 +250,6 @@
<string
name=
"return_to_duel"
>
듀얼로 돌아가십시오
</string>
<string
name=
"Start_ServiceDuelAssistant"
>
듀얼 어시스턴트 시작
</string>
<string
name=
"about_DuelAssistant"
>
방 비밀번호를 통한 방 입장
\n“?”을 이용한 카드 검색
\n덱 코드를 이용한 덱 공유
</string>
<string
name=
"find_deck_text"
>
덱 공유 코드가 감지 되었습니다. 덱을 저장하겠습니까?
</string>
<string
name=
"save_failed_bcos"
>
다음 이유로 인해 저장에 실패했습니다:
</string>
...
...
mobile/src/main/res/values-zh/strings.xml
View file @
cdf179da
...
...
@@ -256,7 +256,6 @@
<string
name=
"return_to_duel"
>
点此返回决斗
</string>
<string
name=
"Start_ServiceDuelAssistant"
>
开启决斗助手
</string>
<string
name=
"about_DuelAssistant"
>
复制约战房间号直接加房
\n复制“?”+关键词直接查询卡片
\n复制卡组文本直接保存为卡组并在卡组编辑打开它
</string>
<string
name=
"find_deck_text"
>
检测到卡组文本,是否保存?
</string>
<string
name=
"save_failed_bcos"
>
保存失败,原因为
</string>
...
...
mobile/src/main/res/values/strings.xml
View file @
cdf179da
...
...
@@ -257,7 +257,6 @@
<string
name=
"return_to_duel"
>
Return to Duel☞
</string>
<string
name=
"Start_ServiceDuelAssistant"
>
DuelAssistant
</string>
<string
name=
"about_DuelAssistant"
>
Copy PSW to Quick Join Game.
\nCopy Keywords to Search Cards.
\nCopy Deck Text to Save as YDK and Open in Deck Editor
</string>
<string
name=
"find_deck_text"
>
Find your copyed Deck Text, Save or Not?
</string>
<string
name=
"save_failed_bcos"
>
save failed bcos of
</string>
...
...
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