mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-03 23:41:21 +00:00 
			
		
		
		
	utils.adb_shell: Move from 'echo CMD | su' to '-c'
Move from the current implementation (piping the command to su) which has unexpected behaviours to the '-c' su flag (which then becomes required).
This commit is contained in:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							0d798f1c4f
						
					
				
				
					commit
					6b414cc291
				
			@@ -431,7 +431,7 @@ def adb_shell(device, command, timeout=None, check_exit_code=False,
 | 
			
		||||
    if device is not None:
 | 
			
		||||
        parts += ['-s', device]
 | 
			
		||||
    parts += ['shell',
 | 
			
		||||
              command if not as_root else 'echo {} | su'.format(quote(command))]
 | 
			
		||||
              command if not as_root else 'su -c {}'.format(quote(command))]
 | 
			
		||||
 | 
			
		||||
    logger.debug(' '.join(quote(part) for part in parts))
 | 
			
		||||
    # On older combinations of ADB/Android versions, the adb host command always
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user