Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
fix: exclude some data classes from code optimization
Browse files Browse the repository at this point in the history
- Excluded data classes from obfuscation written in API Services classes.
fix: LEARNER-9113
  • Loading branch information
omerhabib26 committed Oct 25, 2022
1 parent 7be9331 commit deef32f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

Expand Down Expand Up @@ -157,6 +158,7 @@ Call<CourseStructureV1Model> getCourseStructure(
@POST("/api/courseware/celebration/{course_id}")
Call<Void> updateCoursewareCelebration(@Path("course_id") final String courseId, @Body HashMap<String, Boolean> courseBody);

@Keep
final class BlocksCompletionBody {

@NonNull
Expand All @@ -179,6 +181,7 @@ public BlocksCompletionBody(@NonNull String username, @NonNull String courseKey,
}
}

@Keep
final class EnrollBody {
@NonNull
@SerializedName("course_details")
Expand All @@ -188,6 +191,7 @@ public EnrollBody(@NonNull final String courseId, final boolean emailOptIn) {
courseDetails = new CourseDetails(courseId, emailOptIn);
}

@Keep
private static class CourseDetails {
@NonNull
@SerializedName("course_id")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static org.edx.mobile.http.constants.ApiConstants.PARAM_PAGE_SIZE;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;

import com.google.gson.annotations.SerializedName;
Expand Down Expand Up @@ -165,6 +166,7 @@ Call<DiscussionThread> setThreadRead(@Path("thread_id") String threadId,
@POST("/api/discussion/v1/comments/")
Call<DiscussionComment> createComment(@Body CommentBody commentBody);

@Keep
final class FlagBody {
@SerializedName("abuse_flagged")
private boolean abuseFlagged;
Expand All @@ -174,6 +176,7 @@ public FlagBody(boolean abuseFlagged) {
}
}

@Keep
final class VoteBody {
@SerializedName("voted")
private boolean voted;
Expand All @@ -183,6 +186,7 @@ public VoteBody(boolean voted) {
}
}

@Keep
final class FollowBody {
@SerializedName("following")
private boolean following;
Expand All @@ -192,6 +196,7 @@ public FollowBody(boolean following) {
}
}

@Keep
final class ReadBody {
@SerializedName("read")
private boolean read;
Expand Down

0 comments on commit deef32f

Please sign in to comment.