Skip to content

Instantly share code, notes, and snippets.

@ma34s
Created May 18, 2013 15:30
Show Gist options
  • Save ma34s/5604821 to your computer and use it in GitHub Desktop.
Save ma34s/5604821 to your computer and use it in GitHub Desktop.
grep ro\.sf\.lcd_density $PROP_PATH | cut -d'=' -f2 するもの
/*---------------------------------------------------------------------------**
ma34s. All rights reserved.
**---------------------------------------------------------------------------**
$HeadURL: $
$LastChangedDate:: 2011-07-19 12:39:07 #$
$LastChangedRevision: 22 $
$LastChangedBy: $
**------------------------------------------------------------------------*//**
@file
@author ma34s
@date 2012/06/19 start
*//*-------------------------------------------------------------------------*/
/*=============================================================================
Include
==============================================================================*/
#include <stdio.h>
#if 1
#include <string.h>
#include <stdlib.h>
#else
#include <time.h>
#include <errno.h>
#include <unistd.h>
#include <utime.h>
#endif
//#include "android_filesystem_config.h"
/*=============================================================================
Macro
==============================================================================*/
/*=============================================================================
Typedef
==============================================================================*/
/*=============================================================================
Prototype
==============================================================================*/
/*=============================================================================
Variable
==============================================================================*/
/*===========================================================================**
Functiuon
**============================================================================*/
int main(int argc, char *argv[])
{
char tmp[100];
char tmp2[100];
char* prop;
FILE* fp;
fp = fopen(argv[1],"rt");
if( fp == NULL )
{
return -1;
}
while( fgets(tmp ,sizeof(tmp),fp)){
//printf( "%c", c );
if(strncmp(argv[2], tmp, strlen(argv[2]))==0)
{
prop = strstr(tmp,"\n");
*prop = '\0';
prop = strstr(tmp,"=");
if(prop)
{
prop++;
printf("%s",prop);
}
break;
}
}
fclose( fp );
#if 0
setuid( AID_GRAPHICS );
system( "/system/bin/samsungani" );
setuid( 0 );
#endif
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment