This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
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
1 parent
7a38b15
commit 6cbb044
Showing
9 changed files
with
142 additions
and
124 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
9 changes: 4 additions & 5 deletions
9
app/src/main/java/de/markhaehnel/rbtv/rocketbeanstv/events/ChannelInfoUpdateEvent.java
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 |
---|---|---|
@@ -1,21 +1,20 @@ | ||
package de.markhaehnel.rbtv.rocketbeanstv.events; | ||
|
||
import de.markhaehnel.rbtv.rocketbeanstv.objects.schedule.ScheduleItem; | ||
import de.markhaehnel.rbtv.rocketbeanstv.utils.Enums.EventStatus; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class ChannelInfoUpdateEvent { | ||
private String currentShow; | ||
private String viewerCount; | ||
private ScheduleItem scheduleItem; | ||
private EventStatus status; | ||
|
||
public ChannelInfoUpdateEvent(EventStatus status) { | ||
this.status = status; | ||
} | ||
|
||
public ChannelInfoUpdateEvent(String currentShow, String viewerCount, EventStatus status) { | ||
this.currentShow = currentShow; | ||
this.viewerCount = viewerCount; | ||
public ChannelInfoUpdateEvent(ScheduleItem scheduleItem, EventStatus status) { | ||
this.scheduleItem = scheduleItem; | ||
this.status = status; | ||
} | ||
} |
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
40 changes: 0 additions & 40 deletions
40
app/src/main/java/de/markhaehnel/rbtv/rocketbeanstv/utils/AuthHelper.java
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
app/src/main/java/de/markhaehnel/rbtv/rocketbeanstv/utils/Authentication.java
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,30 @@ | ||
package de.markhaehnel.rbtv.rocketbeanstv.utils; | ||
|
||
import android.util.Base64; | ||
|
||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import static de.markhaehnel.rbtv.rocketbeanstv.utils.AuthHelper.SHA1; | ||
|
||
public class Authentication { | ||
public static Map<String, String> getAuthenticationHeaders(String key, String secret) { | ||
final String id = "00000000-0000-0000-0000-000000000000"; | ||
String created = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZZ").format(new Date()); | ||
created = created.substring(0, created.length()-2) + ":" + created.substring(created.length()-2, created.length()); | ||
|
||
String nonce = id + created + RandomString.generate(10); | ||
String sha1 = SHA1(nonce + created + secret); | ||
String b64sha1 = Base64.encodeToString(sha1.getBytes(), Base64.NO_WRAP); | ||
String b64nonce = Base64.encodeToString(nonce.getBytes(), Base64.NO_WRAP); | ||
|
||
Map<String, String> headers = new HashMap<>(); | ||
headers.put("Accept", "application/json"); | ||
headers.put("Authorization", "WSSE profile=\"UsernameToken\""); | ||
headers.put("X-WSSE", "UsernameToken Username=\"" + key + "\", PasswordDigest=\"" + b64sha1 + "\", Nonce=\"" + b64nonce + "\", Created=\"" + created + "\""); | ||
|
||
return headers; | ||
} | ||
} |
Oops, something went wrong.