A comprehensive Thrift IDL extractor and compiler for LINE APK decompiled sources.
- Complete Thrift IDL extraction from decompiled Java sources
- Automatic type resolution for obfuscated class names
- Response/Request mapping using toString() patterns
- Support for complex types (lists, maps, sets, enums)
- E2EE components extraction including LetterSealing
- Service method typing with proper request/response types
pip install -r requirements.txtpython src/thrift_compiler.pyThis will:
- Parse all Java files in
/workspaces/LINE/line_decompiled/sources - Extract enums, structs, and services
- Generate
line.thriftwith complete Thrift IDL
The compiler extracts:
- 2,014 structs with proper field definitions
- 508 enums with values
- 105 services with 421 methods
- 387 type aliases for obfuscated names
- Enum Parser - Extracts Java enums with values
- Struct Parser - Parses Thrift struct implementations with fields
- Service Parser - Extracts service definitions and methods
- Type Resolver - Maps obfuscated names to real types
- Response/Request Mapper - Uses toString() patterns to identify types
Maps obfuscated class names (e.g., E0, X3) to actual types (e.g., GetContactsV3Response, DeleteOtherFromChatResponse) using:
- toString() method patterns
- StringBuilder patterns with field names
- Handles primitive types (bool, byte, i16, i32, i64, string)
- Complex types (list, map, set) with nested type resolution
- Struct references with automatic aliasing
Complete extraction of:
- E2EE services (E2eeKeyBackupService, E2eeTalkService)
- Key exchange methods and structs
- LetterSealing components
- Error codes and notification types
compiler/
├── src/
│ └── thrift_compiler.py # Main compiler
├── docs/
│ └── API.md # API documentation
├── examples/
│ └── example_output.thrift # Sample output
├── tests/
│ └── test_compiler.py # Unit tests
├── README.md
└── requirements.txt
enum TalkErrorCode {
E2EE_INVALID_PROTOCOL = 81,
E2EE_RETRY_ENCRYPT = 82,
...
}
struct GetContactsV3Response {
1: list<i32> responses
}
service GroupTalkService {
CancelChatInvitationResponse cancelChatInvitation(1: C12999i2 request),
DeleteOtherFromChatResponse deleteOtherFromChat(1: W3 request),
...
}- Fork the repository
- Create your feature branch
- Add tests for new functionality
- Submit a pull request
This tool is for educational and research purposes only.