1

I recently find my Android Release version can be attached through Android Studio and all logs are available to be seen as well, even though I'm sure that AndroidManifest.xml file doesn't contain "android:debuggable=true" and app's build.gradle file specified that

buildTypes {
...

release {
    ...
    debuggable false
    ...
}

...
}

Do you guys have any good idea to avoid this?

PEHLAJ
  • 9,980
  • 9
  • 41
  • 53
Dylan
  • 11
  • 2

2 Answers2

0

You can only keep like this code below:

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

hopefully works it.

0

Logs are nothing to do with debuggable true.

The option debuggale is to making your application debuggable in release mode, so you can attach debugger even on your release build by default it is false.

If you are using Log class and printing any log it will always display until and unless you put the check before logging them.

What you can do is put a check before every log is Build.Debug == true then print the log.

Or you can use open source library for this work like this one which provide the control of logging based on your configuration.

Or you can find a more helpful answer here.

Community
  • 1
  • 1
VikasGoyal
  • 3,308
  • 1
  • 22
  • 42