Created
June 27, 2016 00:32
-
-
Save USA-RedDragon/293d196b6e2035b87e0fb3d4291234ef to your computer and use it in GitHub Desktop.
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
package com.mcswainsoftware.substitute.structs; | |
import java.io.Serializable; | |
import java.util.ArrayList; | |
public class LayersPackage implements Serializable { | |
private String name, developer, enabled, pkg; | |
private String logoUri; | |
private long lastModified; | |
private ArrayList<String> supportedApps; | |
public String friendlyName; | |
public LayersPackage(String pkg, String name, String developer, String enabled, String logoUri, long lastModified) { | |
this.pkg = pkg; | |
this.name = name; | |
this.developer = developer; | |
this.enabled = enabled; | |
this.logoUri = logoUri; | |
this.lastModified = lastModified; | |
friendlyName = name.replaceAll("\\s+", "").replaceAll("[^a-zA-Z0-9]+", ""); | |
} | |
public String getName() { | |
return name; | |
} | |
public String getDeveloper() { | |
return developer; | |
} | |
public boolean getEnabled() { | |
return !(enabled.isEmpty()); | |
} | |
public String getPkg() { | |
return pkg; | |
} | |
public String getLogoUri() { | |
return logoUri; | |
} | |
public long getLastModifiedTime() { | |
return lastModified; | |
} | |
public ArrayList<String> getSupportedApps() { | |
return supportedApps; | |
} | |
public void setSupportedApps(ArrayList<String> supportedApps) { | |
this.supportedApps = supportedApps; | |
} | |
} |
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
...... | |
String[] fileList = new File(Consts.overlaysDir.getAbsolutePath() + "/" + layersPackage.getPkg() + "/assets/overlays/").list(); | |
ArrayList<String> fileArrayList = new ArrayList<>(); | |
for (String file : fileList) { | |
if(knownInstalledPackages.contains(file)) { | |
fileArrayList.add(file); | |
} | |
} | |
Collections.sort(fileArrayList); | |
layersPackage.setSupportedApps(fileArrayList); | |
...... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment