Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
AloqaIM-Android
Commits
90ca5d6e
Commit
90ca5d6e
authored
Aug 22, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moves all debug stuff to the debug folder.
parent
24478040
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
30 deletions
+53
-30
build.gradle
app/build.gradle
+5
-0
AndroidManifest.xml
app/src/debug/AndroidManifest.xml
+9
-0
RocketChatApplicationDebug.java
.../java/chat/rocket/android/RocketChatApplicationDebug.java
+37
-0
RocketChatApplication.java
.../main/java/chat/rocket/android/RocketChatApplication.java
+2
-30
No files found.
app/build.gradle
View file @
90ca5d6e
...
...
@@ -84,6 +84,11 @@ android {
//avoiding okio error: https://github.com/square/okhttp/issues/896
lintConfig
file
(
"lint.xml"
)
}
sourceSets
{
debug
{
manifest
.
srcFile
'src/debug/AndroidManifest.xml'
}
}
}
play
{
...
...
app/src/debug/AndroidManifest.xml
0 → 100644
View file @
90ca5d6e
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"chat.rocket.android"
xmlns:tools=
"http://schemas.android.com/tools"
>
<application
tools:replace=
"android:name"
android:name=
".RocketChatApplicationDebug"
/>
</manifest>
\ No newline at end of file
app/src/debug/java/chat/rocket/android/RocketChatApplicationDebug.java
0 → 100644
View file @
90ca5d6e
package
chat
.
rocket
.
android
;
import
android.os.StrictMode
;
import
com.facebook.stetho.Stetho
;
import
com.uphyca.stetho_realm.RealmInspectorModulesProvider
;
public
class
RocketChatApplicationDebug
extends
RocketChatApplication
{
@Override
public
void
onCreate
()
{
super
.
onCreate
();
enableStrictMode
();
enableStetho
();
}
private
void
enableStrictMode
()
{
StrictMode
.
setThreadPolicy
(
new
StrictMode
.
ThreadPolicy
.
Builder
()
.
detectDiskReads
()
.
detectDiskWrites
()
.
detectNetwork
()
// or .detectAll() for all detectable problems
.
penaltyLog
()
.
build
());
StrictMode
.
setVmPolicy
(
new
StrictMode
.
VmPolicy
.
Builder
()
.
detectLeakedSqlLiteObjects
()
.
detectLeakedClosableObjects
()
.
penaltyLog
()
.
build
());
}
private
void
enableStetho
()
{
Stetho
.
initialize
(
Stetho
.
newInitializerBuilder
(
this
)
.
enableDumpapp
(
Stetho
.
defaultDumperPluginsProvider
(
this
))
.
enableWebKitInspector
(
RealmInspectorModulesProvider
.
builder
(
this
).
build
())
.
build
());
}
}
app/src/main/java/chat/rocket/android/RocketChatApplication.java
View file @
90ca5d6e
package
chat
.
rocket
.
android
;
import
android.os.StrictMode
;
import
android.support.multidex.MultiDexApplication
;
import
com.crashlytics.android.Crashlytics
;
import
com.facebook.stetho.Stetho
;
import
com.uphyca.stetho_realm.RealmInspectorModulesProvider
;
import
io.fabric.sdk.android.Fabric
;
import
java.util.List
;
...
...
@@ -19,13 +16,9 @@ import chat.rocket.persistence.realm.RocketChatPersistenceRealm;
* Customized Application-class for Rocket.Chat
*/
public
class
RocketChatApplication
extends
MultiDexApplication
{
@Override
public
void
onCreate
()
{
if
(
BuildConfig
.
DEBUG
)
{
enableStrictMode
();
enableStetho
();
}
super
.
onCreate
();
Fabric
.
with
(
this
,
new
Crashlytics
());
...
...
@@ -38,25 +31,4 @@ public class RocketChatApplication extends MultiDexApplication {
RocketChatWidgets
.
initialize
(
this
,
OkHttpHelper
.
getClientForDownloadFile
(
this
));
}
private
void
enableStrictMode
()
{
StrictMode
.
setThreadPolicy
(
new
StrictMode
.
ThreadPolicy
.
Builder
()
.
detectDiskReads
()
.
detectDiskWrites
()
.
detectNetwork
()
// or .detectAll() for all detectable problems
.
penaltyLog
()
.
build
());
StrictMode
.
setVmPolicy
(
new
StrictMode
.
VmPolicy
.
Builder
()
.
detectLeakedSqlLiteObjects
()
.
detectLeakedClosableObjects
()
.
penaltyLog
()
.
build
());
}
private
void
enableStetho
()
{
Stetho
.
initialize
(
Stetho
.
newInitializerBuilder
(
this
)
.
enableDumpapp
(
Stetho
.
defaultDumperPluginsProvider
(
this
))
.
enableWebKitInspector
(
RealmInspectorModulesProvider
.
builder
(
this
).
build
())
.
build
());
}
}
}
\ No newline at end of file
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