Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aafm and Nougat (Cyanogenmod) #70

Open
dlord2 opened this issue Nov 27, 2016 · 1 comment
Open

aafm and Nougat (Cyanogenmod) #70

dlord2 opened this issue Nov 27, 2016 · 1 comment

Comments

@dlord2
Copy link

dlord2 commented Nov 27, 2016

Hello,

to get aafm up and running on Nougat (Android 7.1 on Cyanogenmod) you need to change line 107 of src/Aafm.py to the following

before:
pattern = re.compile(r"^(?P<permissions>[dl\-][rwx\-]+) (?P<owner>\w+)\W+(?P<group>[\w_]+)\W*(?P<size>\d+)?\W+(?P<datetime>\d{4}-\d{2}-\d{2} \d{2}:\d{2}) (?P<name>.+)$")

after:
pattern = re.compile(r"^(?P<permissions>[dl\-][rwx\-]+)\s+(?P<hardlinks>\d+)\s+(?P<owner>\w+)\W+(?P<group>[\w_]+)\W*(?P<size>\d+)?\W+(?P<datetime>\d{4}-\d{2}-\d{2} \d{2}:\d{2}) (?P<name>.+)$")

and to get the thing with copying files right, a modification of the section around line 180 is neccessary.

if entry['is_directory']:
    if not filename.startswith('.'):                                  # Added!
        entry_full_path = os.path.join(dirpath, filename)             # indent changed
        queue.append(entry_full_path)                                 # indent changed
        dirnames.append(filename)                                     # indent changed

Around line 90 the code needs to look like the following to get the disksize right.

splitted = lines[1].split()
if len(splitted) != 6:                                                   # was 5 before
     return '-'

mountpoint, size, used, free, blksize, dfpath = splitted  # df path was missing before

for some tweeking of the debug output (avoiding to get annoyed with that total...bogus output add a line before the print output in line 147. Afterwards it looks like the following.

if not line.startswith('total '):                                            # Added!
     print line, "wasn't matched, please report to the developer!"   # Indent changed

hmm, by the time a diff would be more usefull ;-)

Best regards

Daniel

@mdminhazulhaque
Copy link

Same issue happened for me. Using LineageOS 14.1. I used the following solution.

def device_list_files_parsed(self, device_dir):
        command = ['ls', '-l', '-a', device_dir]
        entries = {}
        reader = csv.DictReader(self.adb_shell(*command),
                delimiter=' ',
                skipinitialspace=True,
                fieldnames=['permissions', 'links', 'owner', 'group', 'size', 'date', 'time', 'name']
                )
        for line in reader:
                filename = line['name']
                is_directory = line['permissions'].startswith('d')
                entries[filename] = { 
                        'is_directory': ,
                        'size': 0 if fsize is None else line['size'],
                        'timestamp': 0.0, # TODO
                        'permissions': line['permissions'],
                        'owner': line['owner'],
                        'group': line['group']
                }
        return entries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants