Skip to content

Commit d8b75af

Browse files
authored
Merge pull request #8 from jwdeveloper/develop-1_0_0
1.0.0 Release
2 parents 4690a75 + e0f581e commit d8b75af

File tree

331 files changed

+113766
-5530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

331 files changed

+113766
-5530
lines changed

.idea/protoeditor.xml

Lines changed: 71 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

API/pom.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
<version>3.24.1</version>
1818
<scope>provided</scope>
1919
</dependency>
20+
<dependency>
21+
<groupId>com.google.code.gson</groupId>
22+
<artifactId>gson</artifactId>
23+
<version>2.10.1</version>
24+
</dependency>
2025
</dependencies>
2126

2227
<build>
@@ -53,6 +58,25 @@
5358
</execution>
5459
</executions>
5560
</plugin>
61+
<plugin>
62+
<groupId>org.apache.maven.plugins</groupId>
63+
<artifactId>maven-javadoc-plugin</artifactId>
64+
<version>3.3.0</version>
65+
<executions>
66+
<execution>
67+
<id>attach-javadocs</id>
68+
<phase>package</phase>
69+
<goals>
70+
<goal>jar</goal>
71+
</goals>
72+
<configuration>
73+
<doclint>-html,-syntax,-accessibility,-missing</doclint>
74+
<failOnError>false</failOnError>
75+
<quiet>true</quiet>
76+
</configuration>
77+
</execution>
78+
</executions>
79+
</plugin>
5680
</plugins>
5781
</build>
5882
</project>

API/src/main/java/io/github/jwdeveloper/tiktok/ClientSettings.java

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/*
2+
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining
5+
* a copy of this software and associated documentation files (the
6+
* "Software"), to deal in the Software without restriction, including
7+
* without limitation the rights to use, copy, modify, merge, publish,
8+
* distribute, sublicense, and/or sell copies of the Software, and to
9+
* permit persons to whom the Software is furnished to do so, subject to
10+
* the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be
13+
* included in all copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
*/
123
package io.github.jwdeveloper.tiktok;
224

325
import lombok.Data;
@@ -13,7 +35,6 @@ public class ClientSettings {
1335
*/
1436
private Duration timeout;
1537

16-
// public RotatingProxy Proxy;
1738
/**
1839
* ISO-Language for Client
1940
*/
@@ -27,18 +48,14 @@ public class ClientSettings {
2748

2849

2950
/**
30-
* Wait to connect again for selected amount of time
51+
* Before retrying connect, wait for select amount of time
3152
*/
3253
private Duration retryConnectionTimeout;
3354

3455
/**
35-
* Whether to handle Messages received from Room when Connecting
56+
* Whether to handle Events received from Room when Connecting
3657
*/
37-
private boolean handleExistingMessagesOnConnect;
38-
/**
39-
* Whether to download List of Gifts for Room when Connecting
40-
*/
41-
private boolean downloadGiftInfo;
58+
private boolean handleExistingEvents;
4259

4360
/**
4461
* Whether to print Logs to Console
@@ -50,19 +67,15 @@ public class ClientSettings {
5067
*/
5168
private Level logLevel;
5269

53-
/**
54-
* Whether to print Base64-Data for Messages to Console
55-
*/
56-
private boolean printMessageData;
5770

5871
/**
59-
* Optional: Use it if you need to change tiktok live hostname in builder
72+
* Optional: Use it if you need to change TikTok live hostname in builder
6073
*/
6174
private String hostName;
6275

6376

6477
/**
65-
* Parameters used in requests to Tiktok api
78+
* Parameters used in requests to TikTok api
6679
*/
6780
private Map<String, Object> clientParameters;
6881

API/src/main/java/io/github/jwdeveloper/tiktok/Constants.java

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/*
2+
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining
5+
* a copy of this software and associated documentation files (the
6+
* "Software"), to deal in the Software without restriction, including
7+
* without limitation the rights to use, copy, modify, merge, publish,
8+
* distribute, sublicense, and/or sell copies of the Software, and to
9+
* permit persons to whom the Software is furnished to do so, subject to
10+
* the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be
13+
* included in all copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
*/
123
package io.github.jwdeveloper.tiktok;
224

325
import java.time.Duration;
@@ -26,27 +48,20 @@ public class Constants {
2648
* Default TimeOut for Connections
2749
*/
2850
public static final int DEFAULT_TIMEOUT = 20;
29-
/**
30-
* Default Polling-Time for Socket-Connection
31-
*/
32-
public static final int DEFAULT_POLLTIME = 1;
51+
3352

3453
/**
3554
* Default Settings for Client
3655
*/
37-
38-
3956
public static ClientSettings DefaultClientSettings() {
4057
var clientSettings = new ClientSettings();
4158
clientSettings.setTimeout(Duration.ofSeconds(DEFAULT_TIMEOUT));
4259
clientSettings.setClientLanguage("en-US");
43-
clientSettings.setHandleExistingMessagesOnConnect(true);
44-
clientSettings.setDownloadGiftInfo(true);
60+
clientSettings.setHandleExistingEvents(true);
4561
clientSettings.setRetryOnConnectionFailure(false);
4662
clientSettings.setRetryConnectionTimeout(Duration.ofSeconds(1));
4763
clientSettings.setPrintToConsole(false);
4864
clientSettings.setLogLevel(Level.ALL);
49-
clientSettings.setPrintMessageData(false);
5065
clientSettings.setClientParameters(Constants.DefaultClientParams());
5166
return clientSettings;
5267
}
@@ -55,8 +70,6 @@ public static ClientSettings DefaultClientSettings() {
5570
/**
5671
* Default Parameters for HTTP-Request
5772
*/
58-
59-
6073
public static Map<String, Object> DefaultClientParams() {
6174
var clientParams = new TreeMap<String, Object>();
6275
clientParams.put("aid", 1988);
@@ -103,6 +116,7 @@ public static Map<String, Object> DefaultClientParams() {
103116
public static Map<String, String> DefaultRequestHeaders() {
104117
var headers = new HashMap<String, String>();
105118

119+
headers.put("authority","www.tiktok.com");
106120
headers.put("Connection", "keep-alive");
107121
headers.put("Cache-Control", "max-age=0");
108122
headers.put("Accept", "text/html,application/json,application/protobuf");

API/src/main/java/io/github/jwdeveloper/tiktok/annotations/EventMeta.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/*
2+
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining
5+
* a copy of this software and associated documentation files (the
6+
* "Software"), to deal in the Software without restriction, including
7+
* without limitation the rights to use, copy, modify, merge, publish,
8+
* distribute, sublicense, and/or sell copies of the Software, and to
9+
* permit persons to whom the Software is furnished to do so, subject to
10+
* the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be
13+
* included in all copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
*/
123
package io.github.jwdeveloper.tiktok.annotations;
224

325
import java.lang.annotation.Retention;
Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
1+
/*
2+
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining
5+
* a copy of this software and associated documentation files (the
6+
* "Software"), to deal in the Software without restriction, including
7+
* without limitation the rights to use, copy, modify, merge, publish,
8+
* distribute, sublicense, and/or sell copies of the Software, and to
9+
* permit persons to whom the Software is furnished to do so, subject to
10+
* the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be
13+
* included in all copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
*/
123
package io.github.jwdeveloper.tiktok.annotations;
224

3-
import java.lang.annotation.Retention;
4-
import java.lang.annotation.RetentionPolicy;
5-
625

726
public enum EventType
827
{
9-
Control, Message, Custom
28+
Control, Message, Debug
1029
}

API/src/main/java/io/github/jwdeveloper/tiktok/annotations/TikTokEventHandler.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
/*
2+
* Copyright (c) 2023-2023 jwdeveloper jacekwoln@gmail.com
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining
5+
* a copy of this software and associated documentation files (the
6+
* "Software"), to deal in the Software without restriction, including
7+
* without limitation the rights to use, copy, modify, merge, publish,
8+
* distribute, sublicense, and/or sell copies of the Software, and to
9+
* permit persons to whom the Software is furnished to do so, subject to
10+
* the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be
13+
* included in all copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
*/
123
package io.github.jwdeveloper.tiktok.annotations;
224

325
import java.lang.annotation.Retention;

0 commit comments

Comments
 (0)