Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
a718f9bb
Commit
a718f9bb
authored
Jan 12, 2017
by
tonymanou
Committed by
topjohnwu
Jan 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unbind Butterknife-injected views in fragment's onDestroyView()
parent
e81bc4f0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
7 deletions
+54
-7
InstallFragment.java
app/src/main/java/com/topjohnwu/magisk/InstallFragment.java
+9
-1
LogFragment.java
app/src/main/java/com/topjohnwu/magisk/LogFragment.java
+9
-1
MagiskHideFragment.java
...rc/main/java/com/topjohnwu/magisk/MagiskHideFragment.java
+9
-1
ModulesFragment.java
app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java
+9
-1
ReposFragment.java
app/src/main/java/com/topjohnwu/magisk/ReposFragment.java
+9
-2
StatusFragment.java
app/src/main/java/com/topjohnwu/magisk/StatusFragment.java
+9
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/InstallFragment.java
View file @
a718f9bb
...
@@ -24,6 +24,7 @@ import java.util.List;
...
@@ -24,6 +24,7 @@ import java.util.List;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.ButterKnife
;
import
butterknife.Unbinder
;
public
class
InstallFragment
extends
Fragment
implements
CallbackHandler
.
EventListener
{
public
class
InstallFragment
extends
Fragment
implements
CallbackHandler
.
EventListener
{
...
@@ -32,6 +33,7 @@ public class InstallFragment extends Fragment implements CallbackHandler.EventLi
...
@@ -32,6 +33,7 @@ public class InstallFragment extends Fragment implements CallbackHandler.EventLi
public
static
List
<
String
>
blockList
;
public
static
List
<
String
>
blockList
;
public
static
String
bootBlock
=
null
;
public
static
String
bootBlock
=
null
;
private
Unbinder
unbinder
;
@BindView
(
R
.
id
.
current_version_title
)
TextView
currentVersionTitle
;
@BindView
(
R
.
id
.
current_version_title
)
TextView
currentVersionTitle
;
@BindView
(
R
.
id
.
install_title
)
TextView
installTitle
;
@BindView
(
R
.
id
.
install_title
)
TextView
installTitle
;
@BindView
(
R
.
id
.
block_spinner
)
Spinner
spinner
;
@BindView
(
R
.
id
.
block_spinner
)
Spinner
spinner
;
...
@@ -44,7 +46,7 @@ public class InstallFragment extends Fragment implements CallbackHandler.EventLi
...
@@ -44,7 +46,7 @@ public class InstallFragment extends Fragment implements CallbackHandler.EventLi
@Override
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
View
v
=
inflater
.
inflate
(
R
.
layout
.
install_fragment
,
container
,
false
);
View
v
=
inflater
.
inflate
(
R
.
layout
.
install_fragment
,
container
,
false
);
ButterKnife
.
bind
(
this
,
v
);
unbinder
=
ButterKnife
.
bind
(
this
,
v
);
detectButton
.
setOnClickListener
(
v1
->
toAutoDetect
());
detectButton
.
setOnClickListener
(
v1
->
toAutoDetect
());
currentVersionTitle
.
setText
(
getString
(
R
.
string
.
current_magisk_title
,
StatusFragment
.
magiskVersionString
));
currentVersionTitle
.
setText
(
getString
(
R
.
string
.
current_magisk_title
,
StatusFragment
.
magiskVersionString
));
installTitle
.
setText
(
getString
(
R
.
string
.
install_magisk_title
,
StatusFragment
.
remoteMagiskVersion
));
installTitle
.
setText
(
getString
(
R
.
string
.
install_magisk_title
,
StatusFragment
.
remoteMagiskVersion
));
...
@@ -109,4 +111,10 @@ public class InstallFragment extends Fragment implements CallbackHandler.EventLi
...
@@ -109,4 +111,10 @@ public class InstallFragment extends Fragment implements CallbackHandler.EventLi
CallbackHandler
.
unRegister
(
blockDetectionDone
,
this
);
CallbackHandler
.
unRegister
(
blockDetectionDone
,
this
);
super
.
onStop
();
super
.
onStop
();
}
}
@Override
public
void
onDestroyView
()
{
super
.
onDestroyView
();
unbinder
.
unbind
();
}
}
}
app/src/main/java/com/topjohnwu/magisk/LogFragment.java
View file @
a718f9bb
...
@@ -38,11 +38,13 @@ import java.util.List;
...
@@ -38,11 +38,13 @@ import java.util.List;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.ButterKnife
;
import
butterknife.Unbinder
;
public
class
LogFragment
extends
Fragment
{
public
class
LogFragment
extends
Fragment
{
private
static
final
String
MAGISK_LOG
=
"/cache/magisk.log"
;
private
static
final
String
MAGISK_LOG
=
"/cache/magisk.log"
;
private
Unbinder
unbinder
;
@BindView
(
R
.
id
.
txtLog
)
TextView
txtLog
;
@BindView
(
R
.
id
.
txtLog
)
TextView
txtLog
;
@BindView
(
R
.
id
.
svLog
)
ScrollView
svLog
;
@BindView
(
R
.
id
.
svLog
)
ScrollView
svLog
;
@BindView
(
R
.
id
.
hsvLog
)
HorizontalScrollView
hsvLog
;
@BindView
(
R
.
id
.
hsvLog
)
HorizontalScrollView
hsvLog
;
...
@@ -61,7 +63,7 @@ public class LogFragment extends Fragment {
...
@@ -61,7 +63,7 @@ public class LogFragment extends Fragment {
@Override
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
View
view
=
inflater
.
inflate
(
R
.
layout
.
log_fragment
,
container
,
false
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
log_fragment
,
container
,
false
);
ButterKnife
.
bind
(
this
,
view
);
unbinder
=
ButterKnife
.
bind
(
this
,
view
);
txtLog
.
setTextIsSelectable
(
true
);
txtLog
.
setTextIsSelectable
(
true
);
...
@@ -82,6 +84,12 @@ public class LogFragment extends Fragment {
...
@@ -82,6 +84,12 @@ public class LogFragment extends Fragment {
new
LogManager
().
read
();
new
LogManager
().
read
();
}
}
@Override
public
void
onDestroyView
()
{
super
.
onDestroyView
();
unbinder
.
unbind
();
}
@Override
@Override
public
void
onCreateOptionsMenu
(
Menu
menu
,
MenuInflater
inflater
)
{
public
void
onCreateOptionsMenu
(
Menu
menu
,
MenuInflater
inflater
)
{
inflater
.
inflate
(
R
.
menu
.
menu_log
,
menu
);
inflater
.
inflate
(
R
.
menu
.
menu_log
,
menu
);
...
...
app/src/main/java/com/topjohnwu/magisk/MagiskHideFragment.java
View file @
a718f9bb
...
@@ -25,9 +25,11 @@ import java.util.List;
...
@@ -25,9 +25,11 @@ import java.util.List;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.ButterKnife
;
import
butterknife.Unbinder
;
public
class
MagiskHideFragment
extends
Fragment
implements
CallbackHandler
.
EventListener
{
public
class
MagiskHideFragment
extends
Fragment
implements
CallbackHandler
.
EventListener
{
private
Unbinder
unbinder
;
@BindView
(
R
.
id
.
swipeRefreshLayout
)
SwipeRefreshLayout
mSwipeRefreshLayout
;
@BindView
(
R
.
id
.
swipeRefreshLayout
)
SwipeRefreshLayout
mSwipeRefreshLayout
;
@BindView
(
R
.
id
.
recyclerView
)
RecyclerView
recyclerView
;
@BindView
(
R
.
id
.
recyclerView
)
RecyclerView
recyclerView
;
...
@@ -56,7 +58,7 @@ public class MagiskHideFragment extends Fragment implements CallbackHandler.Even
...
@@ -56,7 +58,7 @@ public class MagiskHideFragment extends Fragment implements CallbackHandler.Even
@Override
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
View
view
=
inflater
.
inflate
(
R
.
layout
.
magisk_hide_fragment
,
container
,
false
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
magisk_hide_fragment
,
container
,
false
);
ButterKnife
.
bind
(
this
,
view
);
unbinder
=
ButterKnife
.
bind
(
this
,
view
);
PackageManager
packageManager
=
getActivity
().
getPackageManager
();
PackageManager
packageManager
=
getActivity
().
getPackageManager
();
...
@@ -108,6 +110,12 @@ public class MagiskHideFragment extends Fragment implements CallbackHandler.Even
...
@@ -108,6 +110,12 @@ public class MagiskHideFragment extends Fragment implements CallbackHandler.Even
super
.
onStop
();
super
.
onStop
();
}
}
@Override
public
void
onDestroyView
()
{
super
.
onDestroyView
();
unbinder
.
unbind
();
}
@Override
@Override
public
void
onTrigger
(
CallbackHandler
.
Event
event
)
{
public
void
onTrigger
(
CallbackHandler
.
Event
event
)
{
Logger
.
dev
(
"MagiskHideFragment: UI refresh"
);
Logger
.
dev
(
"MagiskHideFragment: UI refresh"
);
...
...
app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java
View file @
a718f9bb
...
@@ -26,6 +26,7 @@ import java.util.List;
...
@@ -26,6 +26,7 @@ import java.util.List;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.ButterKnife
;
import
butterknife.Unbinder
;
public
class
ModulesFragment
extends
Fragment
implements
CallbackHandler
.
EventListener
{
public
class
ModulesFragment
extends
Fragment
implements
CallbackHandler
.
EventListener
{
...
@@ -33,6 +34,7 @@ public class ModulesFragment extends Fragment implements CallbackHandler.EventLi
...
@@ -33,6 +34,7 @@ public class ModulesFragment extends Fragment implements CallbackHandler.EventLi
private
static
final
int
FETCH_ZIP_CODE
=
2
;
private
static
final
int
FETCH_ZIP_CODE
=
2
;
private
Unbinder
unbinder
;
@BindView
(
R
.
id
.
swipeRefreshLayout
)
SwipeRefreshLayout
mSwipeRefreshLayout
;
@BindView
(
R
.
id
.
swipeRefreshLayout
)
SwipeRefreshLayout
mSwipeRefreshLayout
;
@BindView
(
R
.
id
.
recyclerView
)
RecyclerView
recyclerView
;
@BindView
(
R
.
id
.
recyclerView
)
RecyclerView
recyclerView
;
@BindView
(
R
.
id
.
empty_rv
)
TextView
emptyTv
;
@BindView
(
R
.
id
.
empty_rv
)
TextView
emptyTv
;
...
@@ -44,7 +46,7 @@ public class ModulesFragment extends Fragment implements CallbackHandler.EventLi
...
@@ -44,7 +46,7 @@ public class ModulesFragment extends Fragment implements CallbackHandler.EventLi
@Override
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
View
view
=
inflater
.
inflate
(
R
.
layout
.
modules_fragment
,
container
,
false
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
modules_fragment
,
container
,
false
);
ButterKnife
.
bind
(
this
,
view
);
unbinder
=
ButterKnife
.
bind
(
this
,
view
);
fabio
.
setOnClickListener
(
v
->
{
fabio
.
setOnClickListener
(
v
->
{
Intent
intent
=
new
Intent
(
Intent
.
ACTION_GET_CONTENT
);
Intent
intent
=
new
Intent
(
Intent
.
ACTION_GET_CONTENT
);
...
@@ -105,6 +107,12 @@ public class ModulesFragment extends Fragment implements CallbackHandler.EventLi
...
@@ -105,6 +107,12 @@ public class ModulesFragment extends Fragment implements CallbackHandler.EventLi
super
.
onStop
();
super
.
onStop
();
}
}
@Override
public
void
onDestroyView
()
{
super
.
onDestroyView
();
unbinder
.
unbind
();
}
private
void
updateUI
()
{
private
void
updateUI
()
{
ModuleHelper
.
getModuleList
(
listModules
);
ModuleHelper
.
getModuleList
(
listModules
);
if
(
listModules
.
size
()
==
0
)
{
if
(
listModules
.
size
()
==
0
)
{
...
...
app/src/main/java/com/topjohnwu/magisk/ReposFragment.java
View file @
a718f9bb
...
@@ -27,11 +27,13 @@ import java.util.List;
...
@@ -27,11 +27,13 @@ import java.util.List;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.ButterKnife
;
import
butterknife.Unbinder
;
public
class
ReposFragment
extends
Fragment
implements
CallbackHandler
.
EventListener
{
public
class
ReposFragment
extends
Fragment
implements
CallbackHandler
.
EventListener
{
public
static
final
CallbackHandler
.
Event
repoLoadDone
=
new
CallbackHandler
.
Event
();
public
static
final
CallbackHandler
.
Event
repoLoadDone
=
new
CallbackHandler
.
Event
();
private
Unbinder
unbinder
;
@BindView
(
R
.
id
.
recyclerView
)
RecyclerView
recyclerView
;
@BindView
(
R
.
id
.
recyclerView
)
RecyclerView
recyclerView
;
@BindView
(
R
.
id
.
empty_rv
)
TextView
emptyTv
;
@BindView
(
R
.
id
.
empty_rv
)
TextView
emptyTv
;
@BindView
(
R
.
id
.
swipeRefreshLayout
)
SwipeRefreshLayout
mSwipeRefreshLayout
;
@BindView
(
R
.
id
.
swipeRefreshLayout
)
SwipeRefreshLayout
mSwipeRefreshLayout
;
...
@@ -57,8 +59,7 @@ public class ReposFragment extends Fragment implements CallbackHandler.EventList
...
@@ -57,8 +59,7 @@ public class ReposFragment extends Fragment implements CallbackHandler.EventList
@Override
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
View
view
=
inflater
.
inflate
(
R
.
layout
.
repos_fragment
,
container
,
false
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
repos_fragment
,
container
,
false
);
unbinder
=
ButterKnife
.
bind
(
this
,
view
);
ButterKnife
.
bind
(
this
,
view
);
mSectionedAdapter
=
new
mSectionedAdapter
=
new
SimpleSectionedRecyclerViewAdapter
(
getActivity
(),
R
.
layout
.
section
,
SimpleSectionedRecyclerViewAdapter
(
getActivity
(),
R
.
layout
.
section
,
...
@@ -121,6 +122,12 @@ public class ReposFragment extends Fragment implements CallbackHandler.EventList
...
@@ -121,6 +122,12 @@ public class ReposFragment extends Fragment implements CallbackHandler.EventList
super
.
onStop
();
super
.
onStop
();
}
}
@Override
public
void
onDestroyView
()
{
super
.
onDestroyView
();
unbinder
.
unbind
();
}
private
void
reloadRepos
()
{
private
void
reloadRepos
()
{
ModuleHelper
.
getRepoLists
(
mUpdateRepos
,
mInstalledRepos
,
mOthersRepos
);
ModuleHelper
.
getRepoLists
(
mUpdateRepos
,
mInstalledRepos
,
mOthersRepos
);
fUpdateRepos
.
clear
();
fUpdateRepos
.
clear
();
...
...
app/src/main/java/com/topjohnwu/magisk/StatusFragment.java
View file @
a718f9bb
...
@@ -26,6 +26,7 @@ import java.util.List;
...
@@ -26,6 +26,7 @@ import java.util.List;
import
butterknife.BindColor
;
import
butterknife.BindColor
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.ButterKnife
;
import
butterknife.Unbinder
;
public
class
StatusFragment
extends
Fragment
implements
CallbackHandler
.
EventListener
{
public
class
StatusFragment
extends
Fragment
implements
CallbackHandler
.
EventListener
{
...
@@ -38,6 +39,7 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
...
@@ -38,6 +39,7 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
public
static
final
CallbackHandler
.
Event
updateCheckDone
=
new
CallbackHandler
.
Event
();
public
static
final
CallbackHandler
.
Event
updateCheckDone
=
new
CallbackHandler
.
Event
();
public
static
final
CallbackHandler
.
Event
safetyNetDone
=
new
CallbackHandler
.
Event
();
public
static
final
CallbackHandler
.
Event
safetyNetDone
=
new
CallbackHandler
.
Event
();
private
Unbinder
unbinder
;
@BindView
(
R
.
id
.
swipeRefreshLayout
)
SwipeRefreshLayout
mSwipeRefreshLayout
;
@BindView
(
R
.
id
.
swipeRefreshLayout
)
SwipeRefreshLayout
mSwipeRefreshLayout
;
@BindView
(
R
.
id
.
magisk_status_container
)
View
magiskStatusContainer
;
@BindView
(
R
.
id
.
magisk_status_container
)
View
magiskStatusContainer
;
...
@@ -74,7 +76,7 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
...
@@ -74,7 +76,7 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
@Override
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
View
v
=
inflater
.
inflate
(
R
.
layout
.
status_fragment
,
container
,
false
);
View
v
=
inflater
.
inflate
(
R
.
layout
.
status_fragment
,
container
,
false
);
ButterKnife
.
bind
(
this
,
v
);
unbinder
=
ButterKnife
.
bind
(
this
,
v
);
defaultColor
=
magiskUpdateText
.
getCurrentTextColor
();
defaultColor
=
magiskUpdateText
.
getCurrentTextColor
();
...
@@ -161,6 +163,12 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
...
@@ -161,6 +163,12 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
super
.
onStop
();
super
.
onStop
();
}
}
@Override
public
void
onDestroyView
()
{
super
.
onDestroyView
();
unbinder
.
unbind
();
}
private
static
void
checkMagiskInfo
()
{
private
static
void
checkMagiskInfo
()
{
List
<
String
>
ret
=
Shell
.
sh
(
"getprop magisk.version"
);
List
<
String
>
ret
=
Shell
.
sh
(
"getprop magisk.version"
);
if
(
ret
.
get
(
0
).
length
()
==
0
)
{
if
(
ret
.
get
(
0
).
length
()
==
0
)
{
...
...
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