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
f9f80653
Commit
f9f80653
authored
Apr 21, 2021
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
为yrp文件添加ygomobile打开方式
parent
eee58a5f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
22 deletions
+53
-22
mobile/src/main/AndroidManifest.xml
mobile/src/main/AndroidManifest.xml
+9
-17
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
+41
-2
mobile/src/main/res/values-ko/strings.xml
mobile/src/main/res/values-ko/strings.xml
+1
-1
mobile/src/main/res/values-zh/strings.xml
mobile/src/main/res/values-zh/strings.xml
+1
-1
mobile/src/main/res/values/strings.xml
mobile/src/main/res/values/strings.xml
+1
-1
No files found.
mobile/src/main/AndroidManifest.xml
View file @
f9f80653
...
@@ -87,6 +87,15 @@
...
@@ -87,6 +87,15 @@
<data
android:pathPattern=
".*\..*\..*\..*\..*\..*\..*\.ypk"
/>
<data
android:pathPattern=
".*\..*\..*\..*\..*\..*\..*\.ypk"
/>
<data
android:pathPattern=
".*\..*\..*\..*\..*\..*\..*\..*\.ypk"
/>
<data
android:pathPattern=
".*\..*\..*\..*\..*\..*\..*\..*\.ypk"
/>
<data
android:pathPattern=
".*\..*\..*\..*\..*\..*\..*\..*\..*\.ypk"
/>
<data
android:pathPattern=
".*\..*\..*\..*\..*\..*\..*\..*\..*\.ypk"
/>
<data
android:pathPattern=
".*\.yrp"
/>
<data
android:pathPattern=
".*\..*\.yrp"
/>
<data
android:pathPattern=
".*\..*\..*\.yrp"
/>
<data
android:pathPattern=
".*\..*\..*\..*\.yrp"
/>
<data
android:pathPattern=
".*\..*\..*\..*\..*\.yrp"
/>
<data
android:pathPattern=
".*\..*\..*\..*\..*\..*\.yrp"
/>
<data
android:pathPattern=
".*\..*\..*\..*\..*\..*\..*\.yrp"
/>
<data
android:pathPattern=
".*\..*\..*\..*\..*\..*\..*\..*\.yrp"
/>
<data
android:pathPattern=
".*\..*\..*\..*\..*\..*\..*\..*\..*\.yrp"
/>
</intent-filter>
</intent-filter>
<intent-filter>
<intent-filter>
...
@@ -165,23 +174,6 @@
...
@@ -165,23 +174,6 @@
<activity
<activity
android:name=
"cn.garymb.ygomobile.ui.activities.PermissionsActivity"
android:name=
"cn.garymb.ygomobile.ui.activities.PermissionsActivity"
android:theme=
"@style/TranslucentTheme"
/>
android:theme=
"@style/TranslucentTheme"
/>
<activity
android:name=
"com.base.bj.paysdk.TrPayAcitivity"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:exported=
"true"
android:launchMode=
"singleTask"
android:screenOrientation=
"behind"
android:windowSoftInputMode=
"adjustResize|stateHidden"
/>
<activity
android:name=
"com.base.bj.paysdk.TrPayUnionAcitivity"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:exported=
"true"
android:windowSoftInputMode=
"adjustResize|stateHidden"
/>
<activity
android:name=
"com.base.bj.paysdk.TrSelectListActivity"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:exported=
"true"
android:windowSoftInputMode=
"adjustResize|stateHidden"
/>
<activity
<activity
android:name=
"com.tencent.bugly.beta.ui.BetaActivity"
android:name=
"com.tencent.bugly.beta.ui.BetaActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize|locale"
android:configChanges=
"keyboardHidden|orientation|screenSize|locale"
...
...
mobile/src/main/java/cn/garymb/ygomobile/GameUriManager.java
View file @
f9f80653
package
cn.garymb.ygomobile
;
package
cn.garymb.ygomobile
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.ComponentName
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.os.ParcelFileDescriptor
;
import
android.os.ParcelFileDescriptor
;
...
@@ -17,11 +18,13 @@ import cn.garymb.ygomobile.bean.Deck;
...
@@ -17,11 +18,13 @@ import cn.garymb.ygomobile.bean.Deck;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.lite.R
;
import
cn.garymb.ygomobile.ui.cards.DeckManagerActivity
;
import
cn.garymb.ygomobile.ui.cards.DeckManagerActivity
;
import
cn.garymb.ygomobile.ui.preference.SettingsActivity
;
import
cn.garymb.ygomobile.ui.preference.SettingsActivity
;
import
cn.garymb.ygomobile.utils.ComponentUtils
;
import
cn.garymb.ygomobile.utils.FileUtils
;
import
cn.garymb.ygomobile.utils.FileUtils
;
import
ocgcore.DataManager
;
import
ocgcore.DataManager
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ACTION_OPEN_DECK
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ACTION_OPEN_DECK
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ACTION_OPEN_GAME
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
ACTION_OPEN_GAME
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_REPLAY_PATH
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
QUERY_NAME
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
QUERY_NAME
;
...
@@ -134,7 +137,7 @@ public class GameUriManager {
...
@@ -134,7 +137,7 @@ public class GameUriManager {
try
{
try
{
FileUtils
.
copyFile
(
file
,
ypk
);
FileUtils
.
copyFile
(
file
,
ypk
);
}
catch
(
Throwable
e
)
{
}
catch
(
Throwable
e
)
{
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
ypk
_failed_bcos
)
+
e
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
install
_failed_bcos
)
+
e
,
Toast
.
LENGTH_LONG
).
show
();
}
}
if
(!
AppsSettings
.
get
().
isReadExpansions
())
{
if
(!
AppsSettings
.
get
().
isReadExpansions
())
{
activity
.
startActivity
(
startSeting
);
activity
.
startActivity
(
startSeting
);
...
@@ -143,6 +146,20 @@ public class GameUriManager {
...
@@ -143,6 +146,20 @@ public class GameUriManager {
DataManager
.
get
().
load
(
true
);
DataManager
.
get
().
load
(
true
);
Toast
.
makeText
(
activity
,
R
.
string
.
ypk_installed
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
activity
,
R
.
string
.
ypk_installed
,
Toast
.
LENGTH_LONG
).
show
();
}
}
}
else
if
(
file
.
getName
().
toLowerCase
(
Locale
.
US
).
endsWith
(
".yrp"
))
{
File
yrp
=
new
File
(
AppsSettings
.
get
().
getResourcePath
()
+
"/"
+
CORE_REPLAY_PATH
+
"/"
+
file
.
getName
().
toLowerCase
(
Locale
.
US
));
if
(
yrp
.
getAbsolutePath
().
equals
(
file
))
{
YGOStarter
.
startGame
(
getActivity
(),
null
);
}
else
{
try
{
FileUtils
.
copyFile
(
file
,
yrp
);
}
catch
(
Throwable
e
)
{
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
install_failed_bcos
)
+
e
,
Toast
.
LENGTH_LONG
).
show
();
}
if
(!
ComponentUtils
.
isActivityRunning
(
getActivity
(),
new
ComponentName
(
getActivity
(),
YGOMobileActivity
.
class
)))
{
YGOStarter
.
startGame
(
getActivity
(),
null
);
}
}
}
}
}
else
if
(
"content"
.
equals
(
uri
.
getScheme
()))
{
}
else
if
(
"content"
.
equals
(
uri
.
getScheme
()))
{
File
urifile
=
new
File
(
uri
.
getPath
());
File
urifile
=
new
File
(
uri
.
getPath
());
...
@@ -178,7 +195,7 @@ public class GameUriManager {
...
@@ -178,7 +195,7 @@ public class GameUriManager {
try
{
try
{
FileUtils
.
copyFile
(
new
FileInputStream
(
pfd
.
getFileDescriptor
()),
ypk
);
FileUtils
.
copyFile
(
new
FileInputStream
(
pfd
.
getFileDescriptor
()),
ypk
);
}
catch
(
Throwable
e
)
{
}
catch
(
Throwable
e
)
{
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
ypk
_failed_bcos
)
+
e
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
install
_failed_bcos
)
+
e
,
Toast
.
LENGTH_LONG
).
show
();
}
finally
{
}
finally
{
pfd
.
close
();
pfd
.
close
();
}
}
...
@@ -193,6 +210,28 @@ public class GameUriManager {
...
@@ -193,6 +210,28 @@ public class GameUriManager {
DataManager
.
get
().
load
(
true
);
DataManager
.
get
().
load
(
true
);
Toast
.
makeText
(
activity
,
R
.
string
.
ypk_installed
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
activity
,
R
.
string
.
ypk_installed
,
Toast
.
LENGTH_LONG
).
show
();
}
}
}
else
if
(
urifile
.
getName
().
toLowerCase
(
Locale
.
US
).
endsWith
(
".yrp"
))
{
try
{
File
yrp
=
new
File
(
AppsSettings
.
get
().
getResourcePath
()
+
"/"
+
CORE_REPLAY_PATH
+
"/"
+
urifile
.
getName
().
toLowerCase
(
Locale
.
US
));
ParcelFileDescriptor
pfd
=
getActivity
().
getContentResolver
().
openFileDescriptor
(
uri
,
"r"
);
if
(
pfd
==
null
)
{
return
;
}
else
{
try
{
FileUtils
.
copyFile
(
new
FileInputStream
(
pfd
.
getFileDescriptor
()),
yrp
);
}
catch
(
Throwable
e
)
{
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
install_failed_bcos
)
+
e
,
Toast
.
LENGTH_LONG
).
show
();
}
finally
{
pfd
.
close
();
}
}
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
();
}
}
if
(!
ComponentUtils
.
isActivityRunning
(
activity
,
new
ComponentName
(
activity
,
YGOMobileActivity
.
class
)))
{
YGOStarter
.
startGame
(
activity
,
null
);
Toast
.
makeText
(
activity
,
activity
.
getString
(
R
.
string
.
install_failed_bcos
),
Toast
.
LENGTH_SHORT
).
show
();
}
}
}
else
{
}
else
{
String
host
=
uri
.
getHost
();
String
host
=
uri
.
getHost
();
...
...
mobile/src/main/res/values-ko/strings.xml
View file @
f9f80653
...
@@ -279,7 +279,7 @@
...
@@ -279,7 +279,7 @@
<string
name=
"my_favorites"
>
즐겨 찾기★
</string>
<string
name=
"my_favorites"
>
즐겨 찾기★
</string>
<string
name=
"ypk_installed"
>
확장 카드 팩 파일이 설치되었습니다
</string>
<string
name=
"ypk_installed"
>
확장 카드 팩 파일이 설치되었습니다
</string>
<string
name=
"ypk_go_setting"
>
확장 카드 팩을 사용하려면 확장 카드 팩이 활성화되어 있어야합니다.
</string>
<string
name=
"ypk_go_setting"
>
확장 카드 팩을 사용하려면 확장 카드 팩이 활성화되어 있어야합니다.
</string>
<string
name=
"
ypk_failed_bcos"
>
확장 카드 팩
설치에 실패했습니다. 이유:
</string>
<string
name=
"
install_failed_bcos"
>
설치에 실패했습니다. 이유:
</string>
<string
name=
"deck_back_up"
>
백업
</string>
<string
name=
"deck_back_up"
>
백업
</string>
<string
name=
"deck_restore"
>
복원
</string>
<string
name=
"deck_restore"
>
복원
</string>
<string
name=
"deck_backup_n_restore"
>
백업/복원
</string>
<string
name=
"deck_backup_n_restore"
>
백업/복원
</string>
...
...
mobile/src/main/res/values-zh/strings.xml
View file @
f9f80653
...
@@ -279,7 +279,7 @@
...
@@ -279,7 +279,7 @@
<string
name=
"my_favorites"
>
我的收藏★
</string>
<string
name=
"my_favorites"
>
我的收藏★
</string>
<string
name=
"ypk_installed"
>
拓展卡包文件已安装
</string>
<string
name=
"ypk_installed"
>
拓展卡包文件已安装
</string>
<string
name=
"ypk_go_setting"
>
这是拓展卡包文件,要使用须启用扩展卡包
</string>
<string
name=
"ypk_go_setting"
>
这是拓展卡包文件,要使用须启用扩展卡包
</string>
<string
name=
"
ypk_failed_bcos"
>
拓展卡包
安装失败,原因:
</string>
<string
name=
"
install_failed_bcos"
>
安装失败,原因:
</string>
<string
name=
"deck_back_up"
>
备份
</string>
<string
name=
"deck_back_up"
>
备份
</string>
<string
name=
"deck_restore"
>
还原
</string>
<string
name=
"deck_restore"
>
还原
</string>
<string
name=
"deck_backup_n_restore"
>
备份/还原
</string>
<string
name=
"deck_backup_n_restore"
>
备份/还原
</string>
...
...
mobile/src/main/res/values/strings.xml
View file @
f9f80653
...
@@ -282,7 +282,7 @@
...
@@ -282,7 +282,7 @@
<string
name=
"my_favorites"
>
myFav★
</string>
<string
name=
"my_favorites"
>
myFav★
</string>
<string
name=
"ypk_installed"
>
expansion file installed
</string>
<string
name=
"ypk_installed"
>
expansion file installed
</string>
<string
name=
"ypk_go_setting"
>
check \"Use Expansions\" to use it
</string>
<string
name=
"ypk_go_setting"
>
check \"Use Expansions\" to use it
</string>
<string
name=
"
ypk_failed_bcos"
>
expansion
file install failed, because\:
</string>
<string
name=
"
install_failed_bcos"
>
file install failed, because\:
</string>
<string
name=
"deck_back_up"
>
BackUp
</string>
<string
name=
"deck_back_up"
>
BackUp
</string>
<string
name=
"deck_restore"
>
Restore
</string>
<string
name=
"deck_restore"
>
Restore
</string>
<string
name=
"deck_backup_n_restore"
>
BackUp/Restore
</string>
<string
name=
"deck_backup_n_restore"
>
BackUp/Restore
</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