Open Dilettante258 opened 1 month ago
看branchtbclient
不要看main
https://github.com/n0099/tbclient.protobuf/blame/tbclient/proto/UserPost/DataReq.proto#L31-L32
https://github.com/n0099/tbclient.protobuf/blame/9eabdc71110125a93461adeae3505baa06b66a78/java/UserPost/DataReq.java#L61-L64
jadx将其重命名 https://github.com/skylot/jadx/blob/b5e3dcf70fb388c46e27c2acd3411e7bc52eb2d4/jadx-core/src/main/java/jadx/core/codegen/utils/CodeGenUtils.java#L114 https://github.com/skylot/jadx/blob/b5e3dcf70fb388c46e27c2acd3411e7bc52eb2d4/jadx-core/src/main/java/jadx/core/dex/visitors/rename/RenameVisitor.java#L235 为f64788common
并插了行注释(根据 https://github.com/skylot/jadx/blob/b5e3dcf70fb388c46e27c2acd3411e7bc52eb2d4/jadx-core/src/main/java/jadx/core/codegen/utils/CodeGenUtils.java#L111 https://github.com/skylot/jadx/blob/b5e3dcf70fb388c46e27c2acd3411e7bc52eb2d4/jadx-cli/src/main/java/jadx/cli/JadxCLIArgs.java#L244-L249 可以用高于info
的--comments-level
关)导致这个regex不匹配 https://github.com/n0099/tbclient.protobuf/blob/31383157abcfbaefcdc8dfffac1e296da2ca0f0e/squareWireProtoBufJavaGeneratedClassesDecompiler.php#L40
更好的是换个 https://github.com/javaparser/javaparser 来处理ast而非拿regex锤子 https://en.wikipedia.org/wiki/Law_of_the_instrument 钉字符串钉子 https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 https://z.n0099.net/#narrow/near/87047
但即便大脑升级ast也无法把f64788common
变回common
除非又写regex来对其f\d+(\w+)
https://github.com/n0099/tbclient.protobuf/blob/926f0a2f365fcefe3d705598418fe52d541a0b88/proto/UserPost/DataReq.proto#L30-L33
缺了个
我最近在重构项目将会从你的repo里面引用一些proto文件,感谢了。