Flutter 逆向工程:如何将字符串更改为另一个更短或更长的字符串?

问题描述 投票:0回答:1

我正在翻译一个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
来实现这一点。

  1. 这可以实现吗?
  2. 如何实现这一目标? 谢谢!
flutter reverse-engineering
1个回答
0
投票

使用工具010Editor。 当新字符串的长度等于旧字符串的长度时,只需替换它即可。 如果较短,请用填充物

\0
替换它。 时间长了,我还不知道该怎么办。

© www.soinside.com 2019 - 2024. All rights reserved.