Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
a9c90718
Commit
a9c90718
authored
Apr 02, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update some dependencies
parent
cc77a245
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
68 deletions
+4
-68
build.gradle
app/build.gradle
+1
-1
TarEntry.java
...rc/main/java/com/topjohnwu/magisk/container/TarEntry.java
+0
-64
MagiskInstaller.java
...main/java/com/topjohnwu/magisk/tasks/MagiskInstaller.java
+2
-2
build.gradle
build.gradle
+1
-1
No files found.
app/build.gradle
View file @
a9c90718
...
@@ -27,7 +27,7 @@ dependencies {
...
@@ -27,7 +27,7 @@ dependencies {
implementation
project
(
':signing'
)
implementation
project
(
':signing'
)
implementation
'ru.noties:markwon:2.0.1'
implementation
'ru.noties:markwon:2.0.1'
implementation
'com.caverock:androidsvg-aar:1.3'
implementation
'com.caverock:androidsvg-aar:1.3'
implementation
'
org.kamranzafar:jtar:2.3
'
implementation
'
com.github.topjohnwu:jtar:1.0.0
'
implementation
'net.sourceforge.streamsupport:android-retrostreams:1.7.0'
implementation
'net.sourceforge.streamsupport:android-retrostreams:1.7.0'
implementation
'com.github.sevar83:indeterminate-checkbox:1.0.5'
implementation
'com.github.sevar83:indeterminate-checkbox:1.0.5'
...
...
app/src/main/java/com/topjohnwu/magisk/container/TarEntry.java
deleted
100644 → 0
View file @
cc77a245
package
com
.
topjohnwu
.
magisk
.
container
;
import
org.kamranzafar.jtar.TarHeader
;
import
java.io.File
;
import
java.util.Arrays
;
public
class
TarEntry
extends
org
.
kamranzafar
.
jtar
.
TarEntry
{
public
TarEntry
(
File
file
,
String
entryName
)
{
super
(
file
,
entryName
);
}
/*
* Workaround missing java.nio.file.attribute.PosixFilePermission
* Simply just assign a default permission to the file
* */
@Override
public
void
extractTarHeader
(
String
entryName
)
{
int
permissions
=
file
.
isDirectory
()
?
000755
:
000644
;
header
=
TarHeader
.
createHeader
(
entryName
,
file
.
length
(),
file
.
lastModified
()
/
1000
,
file
.
isDirectory
(),
permissions
);
header
.
userName
=
new
StringBuffer
(
""
);
header
.
groupName
=
header
.
userName
;
}
/*
* Rewrite the header to GNU format
* */
@Override
public
void
writeEntryHeader
(
byte
[]
outbuf
)
{
super
.
writeEntryHeader
(
outbuf
);
System
.
arraycopy
(
"ustar \0"
.
getBytes
(),
0
,
outbuf
,
257
,
TarHeader
.
USTAR_MAGICLEN
);
getOctalBytes
(
header
.
mode
,
outbuf
,
100
,
TarHeader
.
MODELEN
);
getOctalBytes
(
header
.
userId
,
outbuf
,
108
,
TarHeader
.
UIDLEN
);
getOctalBytes
(
header
.
groupId
,
outbuf
,
116
,
TarHeader
.
GIDLEN
);
getOctalBytes
(
header
.
size
,
outbuf
,
124
,
TarHeader
.
SIZELEN
);
getOctalBytes
(
header
.
modTime
,
outbuf
,
136
,
TarHeader
.
MODTIMELEN
);
Arrays
.
fill
(
outbuf
,
148
,
148
+
TarHeader
.
CHKSUMLEN
,
(
byte
)
' '
);
Arrays
.
fill
(
outbuf
,
329
,
329
+
TarHeader
.
USTAR_DEVLEN
,
(
byte
)
'\0'
);
Arrays
.
fill
(
outbuf
,
337
,
337
+
TarHeader
.
USTAR_DEVLEN
,
(
byte
)
'\0'
);
// Recalculate checksum
getOctalBytes
(
computeCheckSum
(
outbuf
),
outbuf
,
148
,
TarHeader
.
CHKSUMLEN
);
}
/*
* Proper octal to ASCII conversion
* */
private
void
getOctalBytes
(
long
value
,
byte
[]
buf
,
int
offset
,
int
length
)
{
int
idx
=
length
-
1
;
buf
[
offset
+
idx
]
=
0
;
--
idx
;
for
(
long
val
=
value
;
idx
>=
0
;
--
idx
)
{
buf
[
offset
+
idx
]
=
(
byte
)
((
byte
)
'0'
+
(
byte
)
(
val
&
7
));
val
=
val
>>
3
;
}
}
}
app/src/main/java/com/topjohnwu/magisk/tasks/MagiskInstaller.java
View file @
a9c90718
...
@@ -10,7 +10,6 @@ import androidx.annotation.WorkerThread;
...
@@ -10,7 +10,6 @@ import androidx.annotation.WorkerThread;
import
com.topjohnwu.magisk.App
;
import
com.topjohnwu.magisk.App
;
import
com.topjohnwu.magisk.Config
;
import
com.topjohnwu.magisk.Config
;
import
com.topjohnwu.magisk.Const
;
import
com.topjohnwu.magisk.Const
;
import
com.topjohnwu.magisk.container.TarEntry
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.net.DownloadProgressListener
;
import
com.topjohnwu.net.DownloadProgressListener
;
import
com.topjohnwu.net.Networking
;
import
com.topjohnwu.net.Networking
;
...
@@ -23,6 +22,7 @@ import com.topjohnwu.superuser.io.SuFile;
...
@@ -23,6 +22,7 @@ import com.topjohnwu.superuser.io.SuFile;
import
com.topjohnwu.superuser.io.SuFileInputStream
;
import
com.topjohnwu.superuser.io.SuFileInputStream
;
import
com.topjohnwu.superuser.io.SuFileOutputStream
;
import
com.topjohnwu.superuser.io.SuFileOutputStream
;
import
org.kamranzafar.jtar.TarEntry
;
import
org.kamranzafar.jtar.TarInputStream
;
import
org.kamranzafar.jtar.TarInputStream
;
import
org.kamranzafar.jtar.TarOutputStream
;
import
org.kamranzafar.jtar.TarOutputStream
;
...
@@ -182,7 +182,7 @@ public abstract class MagiskInstaller {
...
@@ -182,7 +182,7 @@ public abstract class MagiskInstaller {
if
(
Utils
.
getNameFromUri
(
App
.
self
,
bootUri
).
endsWith
(
".tar"
))
{
if
(
Utils
.
getNameFromUri
(
App
.
self
,
bootUri
).
endsWith
(
".tar"
))
{
// Extract boot.img from tar
// Extract boot.img from tar
TarInputStream
tar
=
new
TarInputStream
(
new
BufferedInputStream
(
in
));
TarInputStream
tar
=
new
TarInputStream
(
new
BufferedInputStream
(
in
));
org
.
kamranzafar
.
jtar
.
TarEntry
entry
;
TarEntry
entry
;
while
((
entry
=
tar
.
getNextEntry
())
!=
null
)
{
while
((
entry
=
tar
.
getNextEntry
())
!=
null
)
{
if
(
entry
.
getName
().
equals
(
"boot.img"
))
if
(
entry
.
getName
().
equals
(
"boot.img"
))
break
;
break
;
...
...
build.gradle
View file @
a9c90718
...
@@ -16,7 +16,7 @@ buildscript {
...
@@ -16,7 +16,7 @@ buildscript {
}
}
}
}
dependencies
{
dependencies
{
classpath
'com.android.tools:r8:1.4.7
2
'
classpath
'com.android.tools:r8:1.4.7
9
'
classpath
'com.android.tools.build:gradle:3.5.0-alpha09'
classpath
'com.android.tools.build:gradle:3.5.0-alpha09'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment