Skip to content

Commit 9f912d9

Browse files
committed
add noop
1 parent 6d1b9f5 commit 9f912d9

File tree

12 files changed

+332
-3
lines changed

12 files changed

+332
-3
lines changed

debugger/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
apply plugin: 'com.android.library'
1+
plugins {
2+
id 'com.android.library'
3+
}
24

35
android {
46
compileSdkVersion 29
@@ -14,7 +16,7 @@ android {
1416
buildTypes {
1517
release {
1618
minifyEnabled false
17-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
1820
}
1921
}
2022
}

debugger/src/main/java/zerobranch/androidremotedebugger/logging/RemoteLog.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public void log(LogLevel logLevel, String tag, String msg, Throwable th) {
7171
}
7272
}
7373

74-
@SuppressWarnings("ConstantConditions")
7574
private void partialLogs(int priority, String tag, @NotNull String msg, Throwable th) {
7675
if (msg.length() < MAX_LOG_LENGTH) {
7776
logger.log(priority, tag, msg, th);

noop/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

noop/build.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
plugins {
2+
id 'com.android.library'
3+
}
4+
5+
android {
6+
compileSdkVersion 29
7+
8+
defaultConfig {
9+
minSdkVersion 19
10+
targetSdkVersion 29
11+
versionCode 1
12+
versionName '1.0'
13+
consumerProguardFiles 'proguard-rules.pro'
14+
}
15+
16+
buildTypes {
17+
release {
18+
minifyEnabled false
19+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
20+
}
21+
}
22+
}
23+
24+
dependencies {
25+
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
26+
}

noop/proguard-rules.pro

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
##--------------- Begin: Okhttp3 ----------
2+
# JSR 305 annotations are for embedding nullability information.
3+
-dontwarn javax.annotation.**
4+
5+
# A resource is loaded with a relative path so the package of this class must be preserved.
6+
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
7+
8+
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
9+
-dontwarn org.codehaus.mojo.animal_sniffer.*
10+
11+
# OkHttp platform used only on JVM and when Conscrypt dependency is available.
12+
-dontwarn okhttp3.internal.platform.ConscryptPlatform
13+
##--------------- End: Okhttp3 ----------

noop/src/main/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest package="zerobranch.androidremotedebugger" />
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
/*
2+
* Copyright 2020 Arman Sargsyan
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package zerobranch.androidremotedebugger;
17+
18+
import android.content.Context;
19+
20+
import zerobranch.androidremotedebugger.logging.Logger;
21+
22+
public final class AndroidRemoteDebugger {
23+
24+
private AndroidRemoteDebugger(Builder builder) {
25+
}
26+
27+
public synchronized static void init(Context context) {
28+
}
29+
30+
public synchronized static void init(final AndroidRemoteDebugger androidRemoteDebugger) {
31+
}
32+
33+
public synchronized static void stop() {
34+
}
35+
36+
public static boolean isEnable() {
37+
return false;
38+
}
39+
40+
public static boolean isAliveWebServer() {
41+
return false;
42+
}
43+
44+
public static class Builder {
45+
46+
public Builder(Context context) {
47+
}
48+
49+
public Builder enabled(boolean enabled) {
50+
return this;
51+
}
52+
53+
public Builder disableInternalLogging() {
54+
return this;
55+
}
56+
57+
public Builder enableDuplicateLogging() {
58+
return this;
59+
}
60+
61+
public Builder enableDuplicateLogging(Logger logger) {
62+
return this;
63+
}
64+
65+
public Builder disableJsonPrettyPrint() {
66+
return this;
67+
}
68+
69+
public Builder disableNotifications() {
70+
return this;
71+
}
72+
73+
public Builder excludeUncaughtException() {
74+
return this;
75+
}
76+
77+
public Builder port(int port) {
78+
return this;
79+
}
80+
81+
public AndroidRemoteDebugger build() {
82+
return new AndroidRemoteDebugger(this);
83+
}
84+
}
85+
86+
public static class Log {
87+
public static void v(Throwable th) {
88+
}
89+
90+
public static void v(String msg) {
91+
}
92+
93+
public static void v(String tag, String msg) {
94+
}
95+
96+
public static void v(String tag, String msg, Throwable th) {
97+
}
98+
99+
public static void d(Throwable th) {
100+
}
101+
102+
public static void d(String msg) {
103+
}
104+
105+
public static void d(String tag, String msg) {
106+
}
107+
108+
public static void d(String tag, String msg, Throwable th) {
109+
}
110+
111+
public static void i(Throwable th) {
112+
}
113+
114+
public static void i(String msg) {
115+
}
116+
117+
public static void i(String tag, String msg) {
118+
}
119+
120+
public static void i(String tag, String msg, Throwable th) {
121+
}
122+
123+
public static void w(Throwable th) {
124+
}
125+
126+
public static void w(String msg) {
127+
}
128+
129+
public static void w(String tag, String msg) {
130+
}
131+
132+
public static void w(String tag, String msg, Throwable th) {
133+
}
134+
135+
public static void e(Throwable th) {
136+
}
137+
138+
public static void e(String msg) {
139+
}
140+
141+
public static void e(String tag, String msg) {
142+
}
143+
144+
public static void e(String tag, String msg, Throwable th) {
145+
}
146+
147+
public static void wtf(Throwable th) {
148+
}
149+
150+
public static void wtf(String msg) {
151+
}
152+
153+
public static void wtf(String tag, String msg) {
154+
}
155+
156+
public static void wtf(String tag, String msg, Throwable th) {
157+
}
158+
159+
public static void log(int priority, String tag, String msg, Throwable th) {
160+
}
161+
}
162+
}
163+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright 2020 Arman Sargsyan
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package zerobranch.androidremotedebugger.logging;
17+
18+
public interface Logger {
19+
void log(int priority, String tag, String msg, Throwable th);
20+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright 2020 Arman Sargsyan
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package zerobranch.androidremotedebugger.logging;
17+
18+
import org.jetbrains.annotations.NotNull;
19+
20+
import java.io.IOException;
21+
22+
import okhttp3.Interceptor;
23+
import okhttp3.Response;
24+
import zerobranch.androidremotedebugger.source.models.httplog.HttpLogModel;
25+
26+
public class NetLoggingInterceptor implements Interceptor {
27+
28+
public NetLoggingInterceptor() {
29+
}
30+
31+
public NetLoggingInterceptor(HttpLogger httpLogger) {
32+
}
33+
34+
@NotNull
35+
@Override
36+
public Response intercept(@NotNull Chain chain) throws IOException {
37+
return chain.proceed(chain.request());
38+
}
39+
40+
public interface HttpLogger {
41+
void log(HttpLogModel httpLogModel);
42+
}
43+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright 2020 Arman Sargsyan
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package zerobranch.androidremotedebugger.source.models.httplog;
17+
18+
import java.util.List;
19+
20+
public class HttpLogModel {
21+
public long id;
22+
public String time;
23+
public String queryId;
24+
public String url;
25+
public String method;
26+
public Integer code;
27+
public String fullStatus;
28+
public String message;
29+
public String port;
30+
public String ip;
31+
public String fullIpAddress;
32+
public String requestContentType;
33+
public String duration;
34+
public String bodySize;
35+
public String body;
36+
public String errorMessage;
37+
public QueryType queryType;
38+
public List<String> headers;
39+
}

0 commit comments

Comments
 (0)