mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2026-08-01 14:19:12 -06:00
Add some newlines to make it look cleaner
This commit is contained in:
parent
03c2a53403
commit
401e604763
1 changed files with 5 additions and 1 deletions
|
|
@ -323,17 +323,21 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
|||
try (ZipFile zipFile = new ZipFile(modFile)){
|
||||
ZipEntry manifest = zipFile.getEntry("META-INF/MANIFEST.MF");
|
||||
if(manifest == null) return -1;
|
||||
|
||||
String manifestString = Tools.read(zipFile.getInputStream(manifest));
|
||||
String mainClass = Tools.extractUntilCharacter(manifestString, "Main-Class:", '\n');
|
||||
if(mainClass == null) return -1;
|
||||
|
||||
mainClass = mainClass.trim().replace('.', '/') + ".class";
|
||||
ZipEntry mainClassFile = zipFile.getEntry(mainClass);
|
||||
if(mainClassFile == null) return -1;
|
||||
|
||||
InputStream classStream = zipFile.getInputStream(mainClassFile);
|
||||
byte[] bytesWeNeed = new byte[8];
|
||||
int readCount = classStream.read(bytesWeNeed);
|
||||
if(readCount < 8) return -1;
|
||||
classStream.close();
|
||||
if(readCount < 8) return -1;
|
||||
|
||||
ByteBuffer byteBuffer = ByteBuffer.wrap(bytesWeNeed);
|
||||
if(byteBuffer.getInt() != 0xCAFEBABE) return -1;
|
||||
short minorVersion = byteBuffer.getShort();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue