Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#8 - Try the suggested patch for EventBus RB
- Loading branch information
1 parent
7031000
commit 3bfee78
Showing
3 changed files
with
79 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import re | ||
import sys | ||
|
||
|
||
def rearrange(filename): | ||
with open(filename, 'r') as file: | ||
content = file.read() | ||
|
||
# Regex to find the blocks of code to rearrange | ||
pattern = re.compile(r'(putIndex\(new SimpleSubscriberInfo\(.*?\)\);)', re.DOTALL) | ||
blocks = pattern.findall(content) | ||
|
||
# Sort blocks based on the class names mentioned in SimpleSubscriberInfo instances | ||
sorted_blocks = sorted(blocks, key=lambda x: re.search(r'SimpleSubscriberInfo\((.*?),', x).group(1)) | ||
|
||
# Replace the original blocks with the sorted blocks | ||
sorted_content = pattern.sub(lambda match: sorted_blocks.pop(0), content) | ||
|
||
with open(filename, 'w') as file: | ||
file.write(sorted_content) | ||
|
||
|
||
# Project root relative to the script | ||
project_root = __file__[:-len('/scripts/fixEventBus.py')] | ||
|
||
path = './build/generated/ap_generated_sources/release/out/eu/basicairdata/graziano/gpslogger/EventBusIndex.java' | ||
|
||
# Print the path to the file to stderr | ||
print(path, file=sys.stderr) | ||
|
||
# Call the function with the path to EventBusIndex.java | ||
rearrange(path) |
3bfee78
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to compile some times the signed app with the patch here above, and now the diffoscope shows only one difference: the APK Signing block.
It should be good.