This file contains hidden or 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
import com.android.apksig.ApkSigner | |
import com.android.apksig.apk.ApkUtils | |
import com.android.apksig.internal.apk.v1.V1SchemeVerifier | |
import com.android.apksig.util.DataSource | |
import com.android.apksig.util.DataSources | |
def f = new RandomAccessFile(args[0], "r") | |
def apk = DataSources.asDataSource(f, 0, f.length()) | |
def zipSections = ApkUtils.findZipSections(apk) | |
def cdRecords = V1SchemeVerifier.parseZipCentralDirectory(apk, zipSections) |
This file contains hidden or 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
#!/usr/bin/python3 | |
# encoding: utf-8 | |
# SPDX-FileCopyrightText: 2024 FC (Fay) Stegerman <[email protected]> | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
from typing import Optional | |
from elftools.elf.elffile import ELFFile | |
from elftools.elf.sections import NoteSection |
This file contains hidden or 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
#!/usr/bin/python3 | |
import sys | |
import zipfile | |
# Usage: zipdup.py ZIPFILE ENTRY_NAME ENTRY_DATA | |
zfile, zentry, data = sys.argv[1:] | |
with zipfile.ZipFile(zfile, "w") as zf: | |
info = zipfile.ZipInfo(filename=zentry) | |
zf.writestr(info, data) |
This file contains hidden or 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
#!/usr/bin/python3 | |
# encoding: utf-8 | |
# SPDX-FileCopyrightText: 2024 FC (Fay) Stegerman <[email protected]> | |
# SPDX-License-Identifier: AGPL-3.0-or-later | |
import fnmatch | |
import os | |
import struct | |
import sys |
This file contains hidden or 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
import java.io.File; | |
import java.io.IOException; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.cert.CertificateEncodingException; | |
import java.security.cert.X509Certificate; | |
import java.util.List; | |
import com.android.apksig.ApkVerificationIssue; | |
import com.android.apksig.ApkVerifier; | |
import com.android.apksig.apk.ApkFormatException; |
This file contains hidden or 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
import zipfile | |
def test(filename): | |
_orig_EndRecData = zipfile._EndRecData | |
eocd_offset = None | |
def _EndRecData(fh): | |
endrec = _orig_EndRecData(fh) | |
if endrec: |
This file contains hidden or 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
#!/usr/bin/python3 | |
# encoding: utf-8 | |
# SPDX-FileCopyrightText: 2024 FC (Fay) Stegerman <[email protected]> | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
import hashlib | |
import os | |
import re | |
import struct | |
import zipfile |
This file contains hidden or 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
#!/usr/bin/python3 | |
# encoding: utf-8 | |
# SPDX-FileCopyrightText: 2024 FC (Fay) Stegerman <[email protected]> | |
# SPDX-License-Identifier: AGPL-3.0-or-later | |
import argparse | |
import json | |
import os | |
from typing import Any, Dict |
This file contains hidden or 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
+ git clone --recurse-submodules -b 1.0.0 -- https://github.com/FossifyOrg/File-Manager.git /build/repo | |
++ git rev-parse HEAD | |
+ test feef6998a0fc79aa859f54699d783df4f0a0c147 = feef6998a0fc79aa859f54699d783df4f0a0c147 | |
+ '[' yes = yes ']' | |
+ git clone https://github.com/obfusk/gradle-wrapper-verify /tmp/gradle-wrapper-verify | |
Cloning into '/tmp/gradle-wrapper-verify'... | |
+ shopt -s globstar | |
+ /tmp/gradle-wrapper-verify/gradle-wrapper-verify ./gradle/wrapper/gradle-wrapper.jar | |
checking ./gradle/wrapper/gradle-wrapper.jar ... | |
OK |
This file contains hidden or 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
import base64 | |
import hashlib | |
import sys | |
t = str.maketrans("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", "ybndrfg8ejkmcpqxot1uwisza345h769") | |
print(base64.b32encode(hashlib.sha1(sys.argv[1].encode().lower()).digest()).decode().translate(t)) |