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
428f27b5
Commit
428f27b5
authored
Dec 30, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理导包清除无用活动
parent
f2459b4a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
130 additions
and
182 deletions
+130
-182
mobile/assets/changelog.html
mobile/assets/changelog.html
+2
-12
mobile/src/main/AndroidManifest.xml
mobile/src/main/AndroidManifest.xml
+6
-25
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
...c/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
+97
-107
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
...mb/ygomobile/ui/preference/fragments/SettingFragment.java
+25
-38
No files found.
mobile/assets/changelog.html
View file @
428f27b5
...
@@ -17,22 +17,12 @@
...
@@ -17,22 +17,12 @@
特别感谢: 菜菜,尸体,废话多,大毛,龙道香姐,晓L,幻兽L 的支持与努力.
特别感谢: 菜菜,尸体,废话多,大毛,龙道香姐,晓L,幻兽L 的支持与努力.
</pre>
</pre>
<ul>
<ul>
<li
style=
"color:#ffff00"
>
3.3.1
0
</li>
<li
style=
"color:#ffff00"
>
3.3.1
1
</li>
</ul>
</ul>
<pre>
<pre>
更新:
更新:
1.更新ygo内核;
1.更新ygo内核;
2.新卡SD35+18SP;
2.新卡20TH+19PP+JF19+VJ;
3.额外卡库脚本可开启优先使用;
4.2019.1禁卡表(OCG);
5.2018.12禁卡表(TCG);
优化:
1.完善机型适配;
2.完善权限申请提示;
3.改进屏幕校准;
新增:
1.崩溃产生日志在ygocore/log;
2.长按萌卡平台按钮可看到调试日志;
</pre>
</pre>
</body>
</body>
</html>
</html>
\ No newline at end of file
mobile/src/main/AndroidManifest.xml
View file @
428f27b5
...
@@ -178,44 +178,25 @@
...
@@ -178,44 +178,25 @@
<!-- 为防止Service被系统回收,可以尝试通过提高服务的优先级解决,1000是最高优先级,数字越小,优先级越低 -->
<!-- 为防止Service被系统回收,可以尝试通过提高服务的优先级解决,1000是最高优先级,数字越小,优先级越低 -->
<!--android:priority="1000"-->
<!--android:priority="1000"-->
<activity
<activity
android:name=
"com.base.bj.
trpayjar
.TrPayAcitivity"
android:name=
"com.base.bj.
paysdk
.TrPayAcitivity"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:exported=
"
fals
e"
android:exported=
"
tru
e"
android:launchMode=
"singleTask"
android:launchMode=
"singleTask"
android:screenOrientation=
"behind"
android:screenOrientation=
"behind"
android:windowSoftInputMode=
"adjustResize|stateHidden"
>
android:windowSoftInputMode=
"adjustResize|stateHidden"
>
</activity>
</activity>
<activity
<activity
android:name=
"com.base.bj.trpayjar.TrPayUnionAcitivity"
android:name=
"com.base.bj.paysdk.TrPayUnionAcitivity"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:exported=
"false"
android:windowSoftInputMode=
"adjustResize|stateHidden"
>
</activity>
<activity
android:name=
"com.base.bj.trpayjar.TrSelectListActivity"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:exported=
"
fals
e"
android:exported=
"
tru
e"
android:windowSoftInputMode=
"adjustResize|stateHidden"
>
android:windowSoftInputMode=
"adjustResize|stateHidden"
>
</activity>
</activity>
<!-- alipay sdk begin -->
<activity
<activity
android:name=
"com.
alipay.sdk.app.H5Pay
Activity"
android:name=
"com.
base.bj.paysdk.TrSelectList
Activity"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:exported=
"false"
android:exported=
"true"
android:screenOrientation=
"behind"
android:windowSoftInputMode=
"adjustResize|stateHidden"
>
</activity>
<activity
android:name=
"com.alipay.sdk.app.H5AuthActivity"
android:configChanges=
"orientation|keyboardHidden|navigation"
android:exported=
"false"
android:screenOrientation=
"behind"
android:windowSoftInputMode=
"adjustResize|stateHidden"
>
android:windowSoftInputMode=
"adjustResize|stateHidden"
>
</activity>
</activity>
<provider
android:name=
"com.pgyersdk.PgyerProvider"
android:authorities=
"${applicationId}.com.pgyer.provider"
android:exported=
"false"
/>
<meta-data
<meta-data
android:name=
"PGYER_APPID"
android:name=
"PGYER_APPID"
android:value=
"${PGYER_APPID}"
>
android:value=
"${PGYER_APPID}"
>
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/home/HomeActivity.java
View file @
428f27b5
package
cn.garymb.ygomobile.ui.home
;
package
cn.garymb.ygomobile.ui.home
;
import
android.app.Activity
;
import
android.app.NotificationManager
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.Intent
;
...
@@ -10,15 +7,12 @@ import android.graphics.Color;
...
@@ -10,15 +7,12 @@ import android.graphics.Color;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.provider.Settings
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.support.design.widget.NavigationView
;
import
android.support.design.widget.NavigationView
;
import
android.support.v4.app.NotificationManagerCompat
;
import
android.support.v7.widget.DividerItemDecoration
;
import
android.support.v7.widget.DividerItemDecoration
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.SparseArray
;
import
android.util.SparseArray
;
import
android.view.Gravity
;
import
android.view.Gravity
;
import
android.view.Menu
;
import
android.view.Menu
;
...
@@ -33,7 +27,6 @@ import android.widget.ImageView;
...
@@ -33,7 +27,6 @@ import android.widget.ImageView;
import
android.widget.ListView
;
import
android.widget.ListView
;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
com.base.bj.paysdk.utils.TrPay
;
import
com.base.bj.paysdk.utils.TrPay
;
import
com.nightonke.boommenu.BoomButtons.BoomButton
;
import
com.nightonke.boommenu.BoomButtons.BoomButton
;
import
com.nightonke.boommenu.BoomButtons.TextOutsideCircleButton
;
import
com.nightonke.boommenu.BoomButtons.TextOutsideCircleButton
;
...
@@ -53,11 +46,8 @@ import java.io.IOException;
...
@@ -53,11 +46,8 @@ import java.io.IOException;
import
java.util.List
;
import
java.util.List
;
import
cn.garymb.ygodata.YGOGameOptions
;
import
cn.garymb.ygodata.YGOGameOptions
;
import
cn.garymb.ygomobile.App
;
import
cn.garymb.ygomobile.AppsSettings
;
import
cn.garymb.ygomobile.AppsSettings
;
import
cn.garymb.ygomobile.Constants
;
import
cn.garymb.ygomobile.Constants
;
import
cn.garymb.ygomobile.GameApplication
;
import
cn.garymb.ygomobile.YGOMobileActivity
;
import
cn.garymb.ygomobile.YGOStarter
;
import
cn.garymb.ygomobile.YGOStarter
;
import
cn.garymb.ygomobile.bean.ServerInfo
;
import
cn.garymb.ygomobile.bean.ServerInfo
;
import
cn.garymb.ygomobile.bean.events.ServerInfoEvent
;
import
cn.garymb.ygomobile.bean.events.ServerInfoEvent
;
...
@@ -85,6 +75,103 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
...
@@ -85,6 +75,103 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
private
ServerListAdapter
mServerListAdapter
;
private
ServerListAdapter
mServerListAdapter
;
private
ServerListManager
mServerListManager
;
private
ServerListManager
mServerListManager
;
/*
*isToastCheckUpdateing 是否提示正在检查更新
*isToastNoUpdata 没有更新是否提示
* isErrorIntent 检查更新失败是否跳转下载地址
*/
public
static
void
checkPgyerUpdateSilent
(
Context
context
,
boolean
isToastCheckUpdateing
,
boolean
isToastNoUpdata
,
boolean
isErrorIntent
)
{
final
DialogPlus
builder
=
new
DialogPlus
(
context
);
if
(
isToastCheckUpdateing
)
{
builder
.
showProgressBar
();
builder
.
hideTitleBar
();
builder
.
setMessage
(
R
.
string
.
Checking_Update
);
builder
.
show
();
}
//蒲公英自动检查更新
new
PgyUpdateManager
.
Builder
()
.
setForced
(
true
)
.
setUserCanRetry
(
false
)
.
setDeleteHistroyApk
(
false
)
.
setUpdateManagerListener
(
new
UpdateManagerListener
()
{
@Override
public
void
onNoUpdateAvailable
()
{
if
(
isToastNoUpdata
)
{
builder
.
dismiss
();
Toast
.
makeText
(
context
,
R
.
string
.
Already_Lastest
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
@Override
public
void
onUpdateAvailable
(
AppBean
appBean
)
{
final
String
versionName
,
updateMessage
;
versionName
=
appBean
.
getVersionName
();
updateMessage
=
appBean
.
getReleaseNote
();
builder
.
hideProgressBar
();
builder
.
showTitleBar
();
builder
.
setTitle
(
context
.
getResources
().
getString
(
R
.
string
.
Update_Found
)
+
versionName
);
builder
.
setMessage
(
updateMessage
);
builder
.
setRightButtonText
(
R
.
string
.
Download
);
builder
.
setRightButtonListener
((
dlg
,
i
)
->
{
builder
.
showProgressBar2
();
builder
.
hideButton
();
builder
.
setTitle
(
R
.
string
.
Downloading
);
PgyUpdateManager
.
downLoadApk
(
appBean
.
getDownloadURL
());
});
builder
.
show
();
}
@Override
public
void
checkUpdateFailed
(
Exception
e
)
{
if
(
isErrorIntent
)
{
builder
.
hideProgressBar
();
builder
.
showTitleBar
();
builder
.
setTitle
(
context
.
getResources
().
getString
(
R
.
string
.
Checking_Update_Failed
));
builder
.
setMessage
(
e
.
getMessage
()
+
context
.
getResources
().
getString
(
R
.
string
.
Ask_to_Change_Other_Way
));
builder
.
setLeftButtonText
(
R
.
string
.
Cancel
);
builder
.
setRightButtonText
(
R
.
string
.
OK
);
builder
.
setRightButtonListener
(
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
Intent
intent
=
new
Intent
();
intent
.
setAction
(
Intent
.
ACTION_VIEW
);
intent
.
setData
(
Uri
.
parse
(
"https://www.taptap.com/app/37972"
));
context
.
startActivity
(
intent
);
dialog
.
dismiss
();
}
});
builder
.
setLeftButtonListener
(
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
}
});
builder
.
show
();
}
}
})
.
setDownloadFileListener
(
new
DownloadFileListener
()
{
@Override
public
void
downloadFailed
()
{
builder
.
dismiss
();
}
@Override
public
void
downloadSuccessful
(
Uri
uri
)
{
builder
.
dismiss
();
PgyUpdateManager
.
installApk
(
uri
);
}
@Override
public
void
onProgressUpdate
(
Integer
...
integers
)
{
builder
.
getProgressBar2
().
setProgress
(
integers
[
0
]);
}
})
.
register
();
}
@Override
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
@@ -458,103 +545,6 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
...
@@ -458,103 +545,6 @@ public abstract class HomeActivity extends BaseActivity implements NavigationVie
mMenuIds
.
put
(
mMenuIds
.
size
(),
menuId
);
mMenuIds
.
put
(
mMenuIds
.
size
(),
menuId
);
}
}
/*
*isToastCheckUpdateing 是否提示正在检查更新
*isToastNoUpdata 没有更新是否提示
* isErrorIntent 检查更新失败是否跳转下载地址
*/
public
static
void
checkPgyerUpdateSilent
(
Context
context
,
boolean
isToastCheckUpdateing
,
boolean
isToastNoUpdata
,
boolean
isErrorIntent
)
{
final
DialogPlus
builder
=
new
DialogPlus
(
context
);
if
(
isToastCheckUpdateing
)
{
builder
.
showProgressBar
();
builder
.
hideTitleBar
();
builder
.
setMessage
(
R
.
string
.
Checking_Update
);
builder
.
show
();
}
//蒲公英自动检查更新
new
PgyUpdateManager
.
Builder
()
.
setForced
(
true
)
.
setUserCanRetry
(
false
)
.
setDeleteHistroyApk
(
false
)
.
setUpdateManagerListener
(
new
UpdateManagerListener
()
{
@Override
public
void
onNoUpdateAvailable
()
{
if
(
isToastNoUpdata
)
{
builder
.
dismiss
();
Toast
.
makeText
(
context
,
R
.
string
.
Already_Lastest
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
@Override
public
void
onUpdateAvailable
(
AppBean
appBean
)
{
final
String
versionName
,
updateMessage
;
versionName
=
appBean
.
getVersionName
();
updateMessage
=
appBean
.
getReleaseNote
();
builder
.
hideProgressBar
();
builder
.
showTitleBar
();
builder
.
setTitle
(
context
.
getResources
().
getString
(
R
.
string
.
Update_Found
)
+
versionName
);
builder
.
setMessage
(
updateMessage
);
builder
.
setRightButtonText
(
R
.
string
.
Download
);
builder
.
setRightButtonListener
((
dlg
,
i
)
->
{
builder
.
showProgressBar2
();
builder
.
hideButton
();
builder
.
setTitle
(
R
.
string
.
Downloading
);
PgyUpdateManager
.
downLoadApk
(
appBean
.
getDownloadURL
());
});
builder
.
show
();
}
@Override
public
void
checkUpdateFailed
(
Exception
e
)
{
if
(
isErrorIntent
)
{
builder
.
hideProgressBar
();
builder
.
showTitleBar
();
builder
.
setTitle
(
context
.
getResources
().
getString
(
R
.
string
.
Checking_Update_Failed
));
builder
.
setMessage
(
e
.
getMessage
()
+
context
.
getResources
().
getString
(
R
.
string
.
Ask_to_Change_Other_Way
));
builder
.
setLeftButtonText
(
R
.
string
.
Cancel
);
builder
.
setRightButtonText
(
R
.
string
.
OK
);
builder
.
setRightButtonListener
(
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
Intent
intent
=
new
Intent
();
intent
.
setAction
(
Intent
.
ACTION_VIEW
);
intent
.
setData
(
Uri
.
parse
(
"https://www.taptap.com/app/37972"
));
context
.
startActivity
(
intent
);
dialog
.
dismiss
();
}
});
builder
.
setLeftButtonListener
(
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
}
});
builder
.
show
();
}
}
})
.
setDownloadFileListener
(
new
DownloadFileListener
()
{
@Override
public
void
downloadFailed
()
{
builder
.
dismiss
();
}
@Override
public
void
downloadSuccessful
(
Uri
uri
)
{
builder
.
dismiss
();
PgyUpdateManager
.
installApk
(
uri
);
}
@Override
public
void
onProgressUpdate
(
Integer
...
integers
)
{
builder
.
getProgressBar2
().
setProgress
(
integers
[
0
]);
}
})
.
register
();
}
public
void
AnimationShake
()
{
public
void
AnimationShake
()
{
Animation
shake
=
AnimationUtils
.
loadAnimation
(
this
,
R
.
anim
.
shake
);
//加载动画资源文件
Animation
shake
=
AnimationUtils
.
loadAnimation
(
this
,
R
.
anim
.
shake
);
//加载动画资源文件
findViewById
(
R
.
id
.
cube
).
startAnimation
(
shake
);
//给组件播放动画效果
findViewById
(
R
.
id
.
cube
).
startAnimation
(
shake
);
//给组件播放动画效果
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
View file @
428f27b5
...
@@ -2,12 +2,9 @@ package cn.garymb.ygomobile.ui.preference.fragments;
...
@@ -2,12 +2,9 @@ package cn.garymb.ygomobile.ui.preference.fragments;
import
android.annotation.SuppressLint
;
import
android.annotation.SuppressLint
;
import
android.app.Dialog
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.content.SharedPreferences
;
import
android.content.pm.PackageManager
;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.os.Message
;
...
@@ -19,7 +16,6 @@ import android.util.Log;
...
@@ -19,7 +16,6 @@ import android.util.Log;
import
android.view.Gravity
;
import
android.view.Gravity
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.Button
;
import
android.widget.FrameLayout
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.Toast
;
import
android.widget.Toast
;
...
@@ -27,16 +23,10 @@ import android.widget.Toast;
...
@@ -27,16 +23,10 @@ import android.widget.Toast;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
com.bumptech.glide.signature.StringSignature
;
import
com.bumptech.glide.signature.StringSignature
;
import
com.pgyersdk.update.DownloadFileListener
;
import
com.pgyersdk.update.PgyUpdateManager
;
import
com.pgyersdk.update.UpdateManagerListener
;
import
com.pgyersdk.update.javabean.AppBean
;
import
java.io.DataOutputStream
;
import
java.io.DataOutputStream
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
...
@@ -58,6 +48,7 @@ import static cn.garymb.ygomobile.Constants.ACTION_RELOAD;
...
@@ -58,6 +48,7 @@ import static cn.garymb.ygomobile.Constants.ACTION_RELOAD;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SKIN_AVATAR_SIZE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SKIN_AVATAR_SIZE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SKIN_BG_SIZE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SKIN_BG_SIZE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SKIN_CARD_COVER_SIZE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
CORE_SKIN_CARD_COVER_SIZE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PERF_TEST_REPLACE_KERNEL
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_CHANGE_LOG
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_CHANGE_LOG
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_CHECK_UPDATE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_CHECK_UPDATE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_DECK_DELETE_DILAOG
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_DECK_DELETE_DILAOG
;
...
@@ -79,7 +70,6 @@ import static cn.garymb.ygomobile.Constants.PREF_USE_EXTRA_CARD_CARDS;
...
@@ -79,7 +70,6 @@ import static cn.garymb.ygomobile.Constants.PREF_USE_EXTRA_CARD_CARDS;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
SETTINGS_AVATAR
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
SETTINGS_AVATAR
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
SETTINGS_CARD_BG
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
SETTINGS_CARD_BG
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
SETTINGS_COVER
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
SETTINGS_COVER
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PERF_TEST_REPLACE_KERNEL
;
import
static
cn
.
garymb
.
ygomobile
.
ui
.
home
.
ResCheckTask
.
getDatapath
;
import
static
cn
.
garymb
.
ygomobile
.
ui
.
home
.
ResCheckTask
.
getDatapath
;
public
class
SettingFragment
extends
PreferenceFragmentPlus
{
public
class
SettingFragment
extends
PreferenceFragmentPlus
{
...
@@ -87,7 +77,26 @@ public class SettingFragment extends PreferenceFragmentPlus {
...
@@ -87,7 +77,26 @@ public class SettingFragment extends PreferenceFragmentPlus {
private
static
final
int
COPY_SO_OK
=
0
;
private
static
final
int
COPY_SO_OK
=
0
;
private
static
final
int
COPY_SO_EXCEPTION
=
1
;
private
static
final
int
COPY_SO_EXCEPTION
=
1
;
private
static
final
int
COPY_SO_NO_ROOT
=
2
;
private
static
final
int
COPY_SO_NO_ROOT
=
2
;
@SuppressLint
(
"HandlerLeak"
)
Handler
handler
=
new
Handler
()
{
@Override
public
void
handleMessage
(
Message
msg
)
{
super
.
handleMessage
(
msg
);
switch
(
msg
.
what
)
{
case
COPY_SO_OK:
Toast
.
makeText
(
getActivity
(),
"替换成功"
,
Toast
.
LENGTH_SHORT
).
show
();
break
;
case
COPY_SO_EXCEPTION:
Toast
.
makeText
(
getActivity
(),
"替换失败,原因为"
+
msg
.
obj
,
Toast
.
LENGTH_SHORT
).
show
();
break
;
case
COPY_SO_NO_ROOT:
Toast
.
makeText
(
getActivity
(),
"没有root权限"
,
Toast
.
LENGTH_SHORT
).
show
();
break
;
}
}
};
private
AppsSettings
mSettings
;
private
boolean
isInit
=
true
;
public
SettingFragment
()
{
public
SettingFragment
()
{
}
}
...
@@ -97,9 +106,6 @@ public class SettingFragment extends PreferenceFragmentPlus {
...
@@ -97,9 +106,6 @@ public class SettingFragment extends PreferenceFragmentPlus {
return
AppsSettings
.
get
().
getSharedPreferences
();
return
AppsSettings
.
get
().
getSharedPreferences
();
}
}
private
AppsSettings
mSettings
;
private
boolean
isInit
=
true
;
@Override
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
...
@@ -372,8 +378,8 @@ public class SettingFragment extends PreferenceFragmentPlus {
...
@@ -372,8 +378,8 @@ public class SettingFragment extends PreferenceFragmentPlus {
try
{
try
{
String
cmd
=
"chmod -R 777 "
+
soFile
.
getAbsolutePath
();
String
cmd
=
"chmod -R 777 "
+
soFile
.
getAbsolutePath
();
process
=
Runtime
.
getRuntime
().
exec
(
"su"
);
//切换到root帐号
process
=
Runtime
.
getRuntime
().
exec
(
"su"
);
//切换到root帐号
if
(
process
==
null
)
{
if
(
process
==
null
)
{
me
.
what
=
COPY_SO_NO_ROOT
;
me
.
what
=
COPY_SO_NO_ROOT
;
handler
.
sendMessage
(
me
);
handler
.
sendMessage
(
me
);
return
;
return
;
}
}
...
@@ -399,7 +405,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
...
@@ -399,7 +405,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
if
(
process
!=
null
)
if
(
process
!=
null
)
process
.
destroy
();
process
.
destroy
();
}
}
...
@@ -412,25 +418,6 @@ public class SettingFragment extends PreferenceFragmentPlus {
...
@@ -412,25 +418,6 @@ public class SettingFragment extends PreferenceFragmentPlus {
}
}
}
}
@SuppressLint
(
"HandlerLeak"
)
Handler
handler
=
new
Handler
()
{
@Override
public
void
handleMessage
(
Message
msg
)
{
super
.
handleMessage
(
msg
);
switch
(
msg
.
what
)
{
case
COPY_SO_OK:
Toast
.
makeText
(
getActivity
(),
"替换成功"
,
Toast
.
LENGTH_SHORT
).
show
();
break
;
case
COPY_SO_EXCEPTION:
Toast
.
makeText
(
getActivity
(),
"替换失败,原因为"
+
msg
.
obj
,
Toast
.
LENGTH_SHORT
).
show
();
break
;
case
COPY_SO_NO_ROOT:
Toast
.
makeText
(
getActivity
(),
"没有root权限"
,
Toast
.
LENGTH_SHORT
).
show
();
break
;
}
}
};
private
void
showImageDialog
(
Preference
preference
,
String
title
,
String
outFile
,
boolean
isJpeg
,
int
outWidth
,
int
outHeight
)
{
private
void
showImageDialog
(
Preference
preference
,
String
title
,
String
outFile
,
boolean
isJpeg
,
int
outWidth
,
int
outHeight
)
{
int
width
=
getResources
().
getDisplayMetrics
().
widthPixels
;
int
width
=
getResources
().
getDisplayMetrics
().
widthPixels
;
//DialogPlus builder = new DialogPlus(getActivity());
//DialogPlus builder = new DialogPlus(getActivity());
...
...
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