@@ -49,6 +49,10 @@ public final class App implements JsonUnknown, JsonSerializable {
4949 * visible to the user.
5050 */
5151 private @ Nullable Boolean inForeground ;
52+ /** A flag indicating whether the app is split into multiple APKs */
53+ private @ Nullable Boolean isSplitApks ;
54+ /* The list of split APKs */
55+ private @ Nullable List <String > splitNames ;
5256
5357 public App () {}
5458
@@ -64,6 +68,8 @@ public App() {}
6468 this .inForeground = app .inForeground ;
6569 this .viewNames = CollectionUtils .newArrayList (app .viewNames );
6670 this .startType = app .startType ;
71+ this .isSplitApks = app .isSplitApks ;
72+ this .splitNames = app .splitNames ;
6773 this .unknown = CollectionUtils .newConcurrentHashMap (app .unknown );
6874 }
6975
@@ -163,6 +169,22 @@ public void setStartType(final @Nullable String startType) {
163169 this .startType = startType ;
164170 }
165171
172+ public @ Nullable Boolean getSplitApks () {
173+ return isSplitApks ;
174+ }
175+
176+ public void setSplitApks (final @ Nullable Boolean splitApks ) {
177+ isSplitApks = splitApks ;
178+ }
179+
180+ public @ Nullable List <String > getSplitNames () {
181+ return splitNames ;
182+ }
183+
184+ public void setSplitNames (final @ Nullable List <String > splitNames ) {
185+ this .splitNames = splitNames ;
186+ }
187+
166188 @ Override
167189 public boolean equals (Object o ) {
168190 if (this == o ) return true ;
@@ -178,7 +200,9 @@ public boolean equals(Object o) {
178200 && Objects .equals (permissions , app .permissions )
179201 && Objects .equals (inForeground , app .inForeground )
180202 && Objects .equals (viewNames , app .viewNames )
181- && Objects .equals (startType , app .startType );
203+ && Objects .equals (startType , app .startType )
204+ && Objects .equals (isSplitApks , app .isSplitApks )
205+ && Objects .equals (splitNames , app .splitNames );
182206 }
183207
184208 @ Override
@@ -194,7 +218,9 @@ public int hashCode() {
194218 permissions ,
195219 inForeground ,
196220 viewNames ,
197- startType );
221+ startType ,
222+ isSplitApks ,
223+ splitNames );
198224 }
199225
200226 // region json
@@ -222,6 +248,8 @@ public static final class JsonKeys {
222248 public static final String IN_FOREGROUND = "in_foreground" ;
223249 public static final String VIEW_NAMES = "view_names" ;
224250 public static final String START_TYPE = "start_type" ;
251+ public static final String IS_SPLIT_APKS = "is_split_apks" ;
252+ public static final String SPLIT_NAMES = "split_names" ;
225253 }
226254
227255 @ Override
@@ -261,6 +289,12 @@ public void serialize(final @NotNull ObjectWriter writer, final @NotNull ILogger
261289 if (startType != null ) {
262290 writer .name (JsonKeys .START_TYPE ).value (startType );
263291 }
292+ if (isSplitApks != null ) {
293+ writer .name (JsonKeys .IS_SPLIT_APKS ).value (isSplitApks );
294+ }
295+ if (splitNames != null && !splitNames .isEmpty ()) {
296+ writer .name (JsonKeys .SPLIT_NAMES ).value (logger , splitNames );
297+ }
264298 if (unknown != null ) {
265299 for (String key : unknown .keySet ()) {
266300 Object value = unknown .get (key );
@@ -319,6 +353,15 @@ public static final class Deserializer implements JsonDeserializer<App> {
319353 case JsonKeys .START_TYPE :
320354 app .startType = reader .nextStringOrNull ();
321355 break ;
356+ case JsonKeys .IS_SPLIT_APKS :
357+ app .isSplitApks = reader .nextBooleanOrNull ();
358+ break ;
359+ case JsonKeys .SPLIT_NAMES :
360+ final @ Nullable List <String > splitNames = (List <String >) reader .nextObjectOrNull ();
361+ if (splitNames != null ) {
362+ app .setSplitNames (splitNames );
363+ }
364+ break ;
322365 default :
323366 if (unknown == null ) {
324367 unknown = new ConcurrentHashMap <>();
0 commit comments