File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
src/main/java/com/dji/wsbridge/lib Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -25,12 +25,16 @@ android {
2525 versionCode 1
2626 versionName " 1.2.4"
2727 testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
28+ buildConfigField " String" , " REMOTE_LOGGER_URL" , getRemoteLoggerURL()
2829 }
2930 buildTypes {
3031 release {
3132 minifyEnabled false
3233 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
3334 }
35+ all {
36+ buildConfigField " String" , " REMOTE_LOGGER_URL" , " \" your_url_goes_here.com\" "
37+ }
3438 }
3539}
3640
@@ -51,6 +55,13 @@ dependencies {
5155 releaseCompile ' com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
5256 debugCompile ' com.github.markzhai:blockcanary-android:1.5.0'
5357 releaseCompile ' com.github.markzhai:blockcanary-no-op:1.5.0'
58+ }
5459
55-
60+ /**
61+ *
62+ * @return return the entered value if there is any, if not empty string
63+ */
64+ def getRemoteLoggerURL () {
65+ def value = project. getProperties(). get(" remoteLoggerURL" )
66+ return value != null ? " \" " + value + " \" " : " \"\" "
5667}
Original file line number Diff line number Diff line change 99import com .androidnetworking .error .ANError ;
1010import com .androidnetworking .interfaces .OkHttpResponseListener ;
1111import com .crashlytics .android .Crashlytics ;
12+ import com .dji .wsbridge .BuildConfig ;
1213
1314import org .json .JSONException ;
1415import org .json .JSONObject ;
@@ -32,7 +33,7 @@ public class DJILogger extends Thread {
3233 public static final int CONNECTION_BRIDGE = 2 ;
3334 private static final String TAG = "RemoteLogger" ;
3435 // Add your remote server IP
35- private static final String REMOTE_LOGGER_URL = "your_url_goes_here.com" ;
36+ private static final String REMOTE_LOGGER_URL = BuildConfig . REMOTE_LOGGER_URL ;
3637 private final static char [] hexArray = "0123456789ABCDEF" .toCharArray ();
3738 private static DJILogger instance = new DJILogger ();
3839 private String serverURL ;
You can’t perform that action at this time.
0 commit comments