-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kiryl Rozau
committed
Mar 9, 2019
1 parent
7783d1d
commit 66ed0f0
Showing
3 changed files
with
51 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import android.annotation.SuppressLint | ||
import android.app.Application | ||
import android.os.StrictMode | ||
import android.util.Log | ||
|
||
import com.kirillr.application.BuildConfig | ||
import com.kirillr.strictmodehelper.StrictModeCompat | ||
import com.kirillr.strictmodehelper.kotlin.dsl.initStrictMode | ||
|
||
import java.util.concurrent.Executors | ||
|
||
@SuppressLint("Registered") | ||
class SampleApplicationKt : Application() { | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
initStrictMode(enable = BuildConfig.DEVELOPER_MODE, enableDefaults = false) { | ||
threadPolicy { | ||
resourceMismatches = true | ||
customSlowCalls = true | ||
unbufferedIo = true | ||
|
||
penalty { | ||
log = true | ||
} | ||
} | ||
|
||
vmPolicy { | ||
fileUriExposure = true | ||
leakedRegistrationObjects = true | ||
cleartextNetwork = true | ||
cleartextNetwork = true | ||
untaggedSockets = true | ||
contentUriWithoutPermission = true | ||
|
||
penalty { | ||
log = true | ||
} | ||
} | ||
} | ||
} | ||
} |