mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-07-07 16:29:46 +03:00
Compare commits
1 commit
dd32e4edbc
...
34d567df17
Author | SHA1 | Date | |
---|---|---|---|
|
34d567df17 |
6 changed files with 10 additions and 12 deletions
|
@ -129,7 +129,7 @@
|
||||||
|
|
||||||
tasks.register('dumpProguard', Copy) {
|
tasks.register('dumpProguard', Copy) {
|
||||||
duplicatesStrategy = 'EXCLUDE'
|
duplicatesStrategy = 'EXCLUDE'
|
||||||
into "$buildDir/libs/proguard-libraries"
|
into "$buildDir/libs/proguard"
|
||||||
from configurations.proguardPack
|
from configurations.proguardPack
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,9 +113,7 @@ public CompletedProfile pushUpdate(UncompletedProfile profile, String tag, Clien
|
||||||
if(!Files.exists(assetDirPath)) {
|
if(!Files.exists(assetDirPath)) {
|
||||||
Files.createDirectories(assetDirPath);
|
Files.createDirectories(assetDirPath);
|
||||||
}
|
}
|
||||||
var assetsHDir = new HashedDir(assetDirPath, null, true, true);
|
updatesDirMap.put("assets", new HashedDir(assetDirPath, null, true, true));
|
||||||
updatesDirMap.put("assets", assetsHDir);
|
|
||||||
localProfile.assetDir = assetsHDir;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(assetActions != null && !assetActions.isEmpty()) {
|
if(assetActions != null && !assetActions.isEmpty()) {
|
||||||
|
@ -184,7 +182,7 @@ private void writeCache(Path file) throws IOException {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void readCache(Path file) throws IOException {
|
private void readCache(Path file) throws IOException {
|
||||||
Map<String, HashedDir> updatesDirMap = new ConcurrentHashMap<>(16);
|
Map<String, HashedDir> updatesDirMap = new HashMap<>(16);
|
||||||
try (HInput input = new HInput(IOHelper.newInput(file))) {
|
try (HInput input = new HInput(IOHelper.newInput(file))) {
|
||||||
int size = input.readLength(0);
|
int size = input.readLength(0);
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
|
@ -194,7 +192,7 @@ private void readCache(Path file) throws IOException {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.debug("Found {} updates from cache", updatesDirMap.size());
|
logger.debug("Found {} updates from cache", updatesDirMap.size());
|
||||||
this.updatesDirMap = updatesDirMap;
|
this.updatesDirMap = Collections.unmodifiableMap(updatesDirMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readProfilesDir() throws IOException {
|
public void readProfilesDir() throws IOException {
|
||||||
|
@ -250,7 +248,7 @@ public void sync(Collection<String> dirs) throws IOException {
|
||||||
newUpdatesDirMap.put(name, updateHDir);
|
newUpdatesDirMap.put(name, updateHDir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updatesDirMap = newUpdatesDirMap;
|
updatesDirMap = Collections.unmodifiableMap(newUpdatesDirMap);
|
||||||
if (cacheUpdates) {
|
if (cacheUpdates) {
|
||||||
try {
|
try {
|
||||||
writeCache(Path.of(cacheFile));
|
writeCache(Path.of(cacheFile));
|
||||||
|
|
|
@ -129,6 +129,7 @@ protected void initProps(BuildContext context) {
|
||||||
String unlockSecret = SecurityHelper.randomStringToken();
|
String unlockSecret = SecurityHelper.randomStringToken();
|
||||||
context.pipelineContext.putProperty("unlockSecret", unlockSecret);
|
context.pipelineContext.putProperty("unlockSecret", unlockSecret);
|
||||||
context.properties.put("runtimeconfig.unlockSecret", unlockSecret);
|
context.properties.put("runtimeconfig.unlockSecret", unlockSecret);
|
||||||
|
context.properties.put("runtimeconfig.buildNumber", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] transformClass(byte[] bytes, String classname, BuildContext context) {
|
public byte[] transformClass(byte[] bytes, String classname, BuildContext context) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ protected boolean showApplyDialog(String text) throws IOException {
|
||||||
return response.equals("y");
|
return response.equals("y");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Downloader downloadWithProgressBar(String taskName, List<Downloader.SizedFile> list, String baseUrl, Path targetDir) throws Exception {
|
protected static Downloader downloadWithProgressBar(String taskName, List<Downloader.SizedFile> list, String baseUrl, Path targetDir) throws Exception {
|
||||||
long total = 0;
|
long total = 0;
|
||||||
for (Downloader.SizedFile file : list) {
|
for (Downloader.SizedFile file : list) {
|
||||||
if(file.size < 0) {
|
if(file.size < 0) {
|
||||||
|
|
|
@ -297,9 +297,6 @@ public UUID getUUID() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getMinecraftVersion() {
|
public String getMinecraftVersion() {
|
||||||
if(version == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return version.toString();
|
return version.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,6 +316,8 @@ public boolean hasFlag(CompatibilityFlags flag) {
|
||||||
|
|
||||||
public void verify() {
|
public void verify() {
|
||||||
// Version
|
// Version
|
||||||
|
getMinecraftVersion();
|
||||||
|
IOHelper.verifyFileName(getAssetIndex());
|
||||||
|
|
||||||
// Client
|
// Client
|
||||||
VerifyHelper.verify(getTitle(), VerifyHelper.NOT_EMPTY, "Profile title can't be empty");
|
VerifyHelper.verify(getTitle(), VerifyHelper.NOT_EMPTY, "Profile title can't be empty");
|
||||||
|
|
2
modules
2
modules
|
@ -1 +1 @@
|
||||||
Subproject commit e6b8af9b107ea8c7dab4fc5968cfd0cff05b7d61
|
Subproject commit 3ce7d4feb1b95152917c9ed85a5186c145a9376c
|
Loading…
Reference in a new issue