Created
July 4, 2024 03:55
-
-
Save CaiJingLong/a439bc217f4275285253053796f8a42e to your computer and use it in GitHub Desktop.
Show the package for libapp.so
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
import 'dart:io'; | |
void main(List<String> args) { | |
final file = File('/Users/cai/Downloads/base.apk/lib/arm64-v8a/libapp.so'); | |
final content = file.readAsBytesSync(); | |
// convert to ascii | |
final text = content.map((e) => String.fromCharCode(e)).join(); | |
// find by regex | |
final pattern = RegExp(r'package:([a-zA-Z0-9_]+)/'); | |
final allMatches = pattern.allMatches(text); | |
final allPkg = allMatches.map((e) => e.group(1)).toSet(); | |
final pkgList = allPkg.toList()..sort(); | |
for (final pkg in pkgList) { | |
print(pkg); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment