我正在翻译一个flutter应用程序,我没有源代码。所以我尝试修改
libapp.so
来翻译一些 UI 文本字符串,这些文本字符串硬编码在 dart 代码中。
翻译后的字符串可能比原始字符串更短或更长。
例如: 这是 flutter 演示应用程序
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}
我想将文本
You have pushed the button this many times:
更改为hello
(较短)或You have pushed the button this many times, hello:
(较长)。现在我没有源代码。我想通过修改 libapp.so
来实现这一点。
使用工具010Editor。 当新字符串的长度等于旧字符串的长度时,只需替换它即可。 如果较短,请用填充物
\0
替换它。
时间长了,我还不知道该怎么办。