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
cb4874e5
Commit
cb4874e5
authored
Apr 29, 2019
by
feihuaduo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新gradle版本到3.4.0
修复无法关闭决斗助手的问题
parent
1fe2f0ed
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
87 additions
and
81 deletions
+87
-81
build.gradle
build.gradle
+1
-1
gradle/wrapper/gradle-wrapper.properties
gradle/wrapper/gradle-wrapper.properties
+2
-2
mobile/build.gradle
mobile/build.gradle
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+10
-10
mobile/src/main/java/cn/garymb/ygomobile/ui/plus/ServiceDuelAssistant.java
...ava/cn/garymb/ygomobile/ui/plus/ServiceDuelAssistant.java
+68
-63
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
...mb/ygomobile/ui/preference/fragments/SettingFragment.java
+5
-4
No files found.
build.gradle
View file @
cb4874e5
...
...
@@ -7,7 +7,7 @@ buildscript {
google
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:3.
3.2
'
classpath
'com.android.tools.build:gradle:3.
4.0
'
//classpath 'me.tatarka:gradle-retrolambda:3.2.5'
}
}
...
...
gradle/wrapper/gradle-wrapper.properties
View file @
cb4874e5
#
Tue Jan 15 19:19:32
CST 2019
#
Mon Apr 29 12:47:40
CST 2019
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
4.10
.1-all.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-
5.1
.1-all.zip
mobile/build.gradle
View file @
cb4874e5
...
...
@@ -101,7 +101,7 @@ dependencies {
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
//
implementation
(
name:
'paysdk-release-1.2.4'
,
ext:
'aar'
)
implementation
'com.pgyersdk:sdk:3.0.4'
implementation
"com.pgyersdk:sdk:3.0.4"
}
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
cb4874e5
...
...
@@ -220,22 +220,22 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
};
//x5内核初始化接口
QbSdk
.
initX5Environment
(
this
,
cb
);
//trpay
TrPay
.
getInstance
(
HomeActivity
.
this
).
initPaySdk
(
"e1014da420ea4405898c01273d6731b6"
,
"YGOMobile"
);
//autoupadte checking
checkPgyerUpdateSilent
(
getContext
(),
false
,
false
,
false
);
//ServiceDuelAssistant
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
DialogPlus
dialogPlus
=
PermissionUtil
.
isNotificationPermission
(
this
);
if
(
dialogPlus
==
null
)
this
.
startForegroundService
(
new
Intent
(
this
,
ServiceDuelAssistant
.
class
));
else
dialogPlus
.
show
();
}
else
{
startService
(
new
Intent
(
this
,
ServiceDuelAssistant
.
class
));
if
(
AppsSettings
.
get
().
isServiceDuelAssistant
())
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
DialogPlus
dialogPlus
=
PermissionUtil
.
isNotificationPermission
(
this
);
if
(
dialogPlus
==
null
)
this
.
startForegroundService
(
new
Intent
(
this
,
ServiceDuelAssistant
.
class
));
else
dialogPlus
.
show
();
}
else
{
startService
(
new
Intent
(
this
,
ServiceDuelAssistant
.
class
));
}
}
//萌卡
StartMycard
();
checkNotch
();
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/plus/ServiceDuelAssistant.java
View file @
cb4874e5
...
...
@@ -90,6 +90,7 @@ public class ServiceDuelAssistant extends Service {
private
WindowManager
.
LayoutParams
wmParams
;
private
WindowManager
mWindowManager
;
private
ClipboardManager
cm
;
@Override
public
IBinder
onBind
(
Intent
p1
)
{
...
...
@@ -112,85 +113,89 @@ public class ServiceDuelAssistant extends Service {
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
//移除剪贴板监听
cm
.
removePrimaryClipChangedListener
(
onPrimaryClipChangedListener
);
//关闭悬浮窗时的声明
stopForeground
(
true
);
}
private
void
startClipboardListener
()
{
final
ClipboardManager
cm
=
(
ClipboardManager
)
getSystemService
(
Context
.
CLIPBOARD_SERVICE
);
cm
=
(
ClipboardManager
)
getSystemService
(
Context
.
CLIPBOARD_SERVICE
);
if
(
cm
==
null
)
return
;
cm
.
addPrimaryClipChangedListener
(
new
ClipboardManager
.
OnPrimaryClipChangedListener
()
{
cm
.
addPrimaryClipChangedListener
(
onPrimaryClipChangedListener
);
}
@Override
public
void
onPrimaryClipChanged
()
{
ClipData
clipData
=
cm
.
getPrimaryClip
();
if
(
clipData
==
null
)
return
;
CharSequence
cs
=
clipData
.
getItemAt
(
0
).
getText
();
final
String
clipMessage
;
if
(
cs
!=
null
)
{
clipMessage
=
cs
.
toString
();
}
else
{
clipMessage
=
null
;
}
ClipboardManager
.
OnPrimaryClipChangedListener
onPrimaryClipChangedListener
=
new
ClipboardManager
.
OnPrimaryClipChangedListener
()
{
//如果复制的内容为空则不执行下面的代码
if
(
TextUtils
.
isEmpty
(
clipMessage
))
{
return
;
}
//如果复制的内容是多行不执行
if
(
clipMessage
.
contains
(
"\n"
))
return
;
int
start
=
-
1
;
int
end
=
-
1
;
String
passwordPrefixKey
=
null
;
for
(
String
s
:
passwordPrefix
)
{
start
=
clipMessage
.
indexOf
(
s
);
passwordPrefixKey
=
s
;
if
(
start
!=
-
1
)
{
break
;
}
@Override
public
void
onPrimaryClipChanged
()
{
ClipData
clipData
=
cm
.
getPrimaryClip
();
if
(
clipData
==
null
)
return
;
CharSequence
cs
=
clipData
.
getItemAt
(
0
).
getText
();
final
String
clipMessage
;
if
(
cs
!=
null
)
{
clipMessage
=
cs
.
toString
();
}
else
{
clipMessage
=
null
;
}
//如果复制的内容为空则不执行下面的代码
if
(
TextUtils
.
isEmpty
(
clipMessage
))
{
return
;
}
//如果复制的内容是多行不执行
if
(
clipMessage
.
contains
(
"\n"
))
return
;
int
start
=
-
1
;
int
end
=
-
1
;
String
passwordPrefixKey
=
null
;
for
(
String
s
:
passwordPrefix
)
{
start
=
clipMessage
.
indexOf
(
s
);
passwordPrefixKey
=
s
;
if
(
start
!=
-
1
)
{
break
;
}
}
if
(
start
!=
-
1
)
{
//如果密码含有空格,则以空格结尾
end
=
clipMessage
.
indexOf
(
" "
,
start
);
//如果不含有空格则取片尾所有
if
(
end
==
-
1
)
{
end
=
clipMessage
.
length
();
}
else
{
//如果只有密码前缀而没有密码内容则不跳转
if
(
end
-
start
==
passwordPrefixKey
.
length
())
if
(
start
!=
-
1
)
{
//如果密码含有空格,则以空格结尾
end
=
clipMessage
.
indexOf
(
" "
,
start
);
//如果不含有空格则取片尾所有
if
(
end
==
-
1
)
{
end
=
clipMessage
.
length
();
}
else
{
//如果只有密码前缀而没有密码内容则不跳转
if
(
end
-
start
==
passwordPrefixKey
.
length
())
return
;
}
//如果有悬浮窗权限再显示
if
(
PermissionUtil
.
isServicePermission
(
ServiceDuelAssistant
.
this
,
false
))
joinRoom
(
clipMessage
,
start
,
end
);
}
else
{
for
(
String
s
:
cardSearchKey
)
{
int
cardSearchStart
=
clipMessage
.
indexOf
(
s
);
if
(
cardSearchStart
!=
-
1
)
{
//卡查内容
cardSearchMessage
=
clipMessage
.
substring
(
cardSearchStart
+
s
.
length
(),
clipMessage
.
length
());
//如果复制的文本里带?号后面没有内容则不跳转
if
(
TextUtils
.
isEmpty
(
cardSearchMessage
))
{
return
;
}
//如果有悬浮窗权限再显示
if
(
PermissionUtil
.
isServicePermission
(
ServiceDuelAssistant
.
this
,
false
))
joinRoom
(
clipMessage
,
start
,
end
);
}
else
{
for
(
String
s
:
cardSearchKey
)
{
int
cardSearchStart
=
clipMessage
.
indexOf
(
s
);
if
(
cardSearchStart
!=
-
1
)
{
//卡查内容
cardSearchMessage
=
clipMessage
.
substring
(
cardSearchStart
+
s
.
length
(),
clipMessage
.
length
());
//如果复制的文本里带?号后面没有内容则不跳转
if
(
TextUtils
.
isEmpty
(
cardSearchMessage
))
{
return
;
}
//如果卡查内容包含“=”并且复制的内容包含“.”不卡查
if
(
cardSearchMessage
.
contains
(
"="
)&&
clipMessage
.
contains
(
"."
))
{
return
;
}
Intent
intent
=
new
Intent
(
ServiceDuelAssistant
.
this
,
CardSearchAcitivity
.
class
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
putExtra
(
CardSearchAcitivity
.
SEARCH_MESSAGE
,
cardSearchMessage
);
startActivity
(
intent
);
}
//如果卡查内容包含“=”并且复制的内容包含“.”不卡查
if
(
cardSearchMessage
.
contains
(
"="
)&&
clipMessage
.
contains
(
"."
))
{
return
;
}
Intent
intent
=
new
Intent
(
ServiceDuelAssistant
.
this
,
CardSearchAcitivity
.
class
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
putExtra
(
CardSearchAcitivity
.
SEARCH_MESSAGE
,
cardSearchMessage
);
startActivity
(
intent
);
}
}
}
}
);
}
}
}
;
private
void
startForeground
()
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
View file @
cb4874e5
...
...
@@ -181,16 +181,17 @@ public class SettingFragment extends PreferenceFragmentPlus {
if
(
preference
instanceof
CheckBoxPreference
)
{
CheckBoxPreference
checkBoxPreference
=
(
CheckBoxPreference
)
preference
;
mSharedPreferences
.
edit
().
putBoolean
(
preference
.
getKey
(),
checkBoxPreference
.
isChecked
()).
apply
();
//如果
事
设置额外卡库的选项
//如果
是
设置额外卡库的选项
if
(
preference
.
getKey
().
equals
(
PREF_READ_EX
))
{
//设置使用额外卡库后重新加载卡片数据
DataManager
.
get
().
load
(
true
);
}
//开关决斗助手
if
(
preference
.
getKey
().
equals
(
PREF_START_SERVICEDUELASSISTANT
))
{
getActivity
().
startService
(
new
Intent
(
getContext
(),
ServiceDuelAssistant
.
class
));
if
(!
checkBoxPreference
.
isChecked
())
{
getActivity
().
stopService
(
new
Intent
(
getContext
(),
ServiceDuelAssistant
.
class
));
if
(
checkBoxPreference
.
isChecked
())
{
getActivity
().
startService
(
new
Intent
(
getActivity
(),
ServiceDuelAssistant
.
class
));
}
else
{
getActivity
().
stopService
(
new
Intent
(
getActivity
(),
ServiceDuelAssistant
.
class
));
}
}
//如果是音效开关
...
...
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