Files
sdk/pkg/dart2js_tools/bin/read.dart
T
Sigmund Cherem 7c77ed04f4 Move deobfuscation tools to the SDK repo
This is an initial implementation of the dart deobfuscator tool.

Let me know your thoughts on the package name. I used to have this named as
`package:deobfuscate`, but it feels like we will want to add more tools that are
not about deobfuscation in the future, so I picked `package:dart2js_tools`
instead. That also gives us the opportunity to move over the dart2js_info code
here too.

Change-Id: I2ff948982969c9c76bc84cdc78cbe237abc87378
Reviewed-on: https://dart-review.googlesource.com/69243
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-08-09 22:55:04 +00:00

18 lines
441 B
Dart

import 'dart:io';
import 'dart:convert';
import 'package:source_maps/source_maps.dart';
main(List<String> args) {
if (args.length != 1) {
print('usage: read.dart <source-map-file>');
exit(1);
}
var sourcemapFile = new File.fromUri(Uri.base.resolve(args[0]));
if (!sourcemapFile.existsSync()) {
print('no source-map-file in ${args[0]}');
}
var bytes = sourcemapFile.readAsBytesSync();
parse(utf8.decode(bytes));
}