2016-02-25 4 views
0

Мне недавно пришлось удалить Android Studio с моего компьютера, и он удалил все мои файлы проекта, к счастью, у меня все еще был APK из последней версии и я смог правильно декомпилировать код. Все мои файлы есть, и я смог увидеть код класса java с помощью блокнота, но похоже, что некоторые вещи были изменены в коде. Вернутся ли они обратно, когда я импортирую проект обратно в Android Studio? Вот пример моей основной деятельности.Декомпиляция кода из APK измененного кода

public class MainActivity 
    extends AppCompatActivity 
{ 
    private static final String TAG = MainActivity.class.getName(); 
    private static final String hasUserRatedAppKey = "hasUserRatedApp"; 
    private static final String settingsKey = "MyAppSettings"; 
    private String SENDER_ID = "993190397898"; 
    private CustomAdapter adapter; 
    Fragment fragment; 
    private DrawerLayout mDrawerLayout; 
    private ListView mDrawerList; 
    private CharSequence mDrawerTitle; 
    private ActionBarDrawerToggle mDrawerToggle; 
    private CharSequence mTitle; 
    String[] menutitles; 
    private List<RowItem> rowItems; 

    private void selectItem(int paramInt) 
    { 
    switch (paramInt) 
    { 
    } 
    for (;;) 
    { 
     this.mDrawerList.setItemChecked(paramInt, true); 
     setTitle("Converjz"); 
     this.mDrawerLayout.closeDrawer(this.mDrawerList); 
     return; 
     startActivity(new Intent(this, MainActivity.class)); 
     finish(); 
     continue; 
     startActivity(new Intent(this, Time.class)); 
     finish(); 
     continue; 
     startActivity(new Intent(this, Temperature.class)); 
     finish(); 
     continue; 
     startActivity(new Intent(this, Weight.class)); 
     finish(); 
     continue; 
     startActivity(new Intent(this, Length.class)); 
     finish(); 
     continue; 
     startActivity(new Intent(this, Money.class)); 
     finish(); 
     continue; 
     startActivity(new Intent(this, Metric.class)); 
     finish(); 
     continue; 
     startActivity(new Intent(this, Food.class)); 
     finish(); 
     continue; 
     startActivity(new Intent(this, Data.class)); 
     finish(); 
     continue; 
     startActivity(new Intent(this, Frequency.class)); 
     finish(); 
     continue; 
     startActivity(new Intent(this, Numeral.class)); 
     finish(); 
    } 
    } 

    public void onConfigurationChanged(Configuration paramConfiguration) 
    { 
    super.onConfigurationChanged(paramConfiguration); 
    this.mDrawerToggle.onConfigurationChanged(paramConfiguration); 
    } 

    protected void onCreate(Bundle paramBundle) 
    { 
    super.onCreate(paramBundle); 
    setContentView(2130968609); 
    paramBundle = ((AnalyticsTracker)getApplication()).getTracker(AnalyticsTracker.TrackerName.APP_TRACKER); 
    paramBundle.enableAdvertisingIdCollection(true); 
    paramBundle.setScreenName("Home"); 
    paramBundle.send(new HitBuilders.AppViewBuilder().build()); 
    this.menutitles = getResources().getStringArray(2131558424); 
    this.mDrawerLayout = ((DrawerLayout)findViewById(2131689566)); 
    this.mDrawerList = ((ListView)findViewById(2131689573)); 
    this.mDrawerList.setAdapter(new ArrayAdapter(this, 2130968608, 2131689522, this.menutitles)); 
    paramBundle = getTitle(); 
    this.mDrawerTitle = paramBundle; 
    this.mTitle = paramBundle; 
    this.mDrawerList.setOnItemClickListener(new DrawerItemClickListener(null)); 
    this.mDrawerToggle = new ActionBarDrawerToggle(this, this.mDrawerLayout, 2131230781, 2131230780) 
    { 
     public void onDrawerClosed(View paramAnonymousView) 
     { 
     super.onDrawerClosed(paramAnonymousView); 
     MainActivity.this.getSupportActionBar().setTitle(MainActivity.this.mTitle); 
     MainActivity.this.invalidateOptionsMenu(); 
     } 

     public void onDrawerOpened(View paramAnonymousView) 
     { 
     super.onDrawerOpened(paramAnonymousView); 
     MainActivity.this.getSupportActionBar().setTitle(MainActivity.this.mDrawerTitle); 
     MainActivity.this.invalidateOptionsMenu(); 
     } 
    }; 
    this.mDrawerLayout.setDrawerListener(this.mDrawerToggle); 
    getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
    getSupportActionBar().setHomeButtonEnabled(true); 
    getResources().getConfiguration(); 
    getFragmentManager().beginTransaction().replace(16908290, new adView()); 
    ((AdView)findViewById(2131689565)).loadAd(new AdRequest.Builder().build()); 
    paramBundle = (Button)findViewById(2131689593); 
    final ObjectAnimator localObjectAnimator = ObjectAnimator.ofPropertyValuesHolder((RelativeLayout)findViewById(2131689592), new PropertyValuesHolder[] { PropertyValuesHolder.ofFloat("scaleX", new float[] { 1.2F }), PropertyValuesHolder.ofFloat("scaleY", new float[] { 1.2F }) }); 
    localObjectAnimator.setRepeatCount(-1); 
    localObjectAnimator.setRepeatMode(2); 
    paramBundle.setOnClickListener(new View.OnClickListener() 
    { 
     public void onClick(View paramAnonymousView) 
     { 
     localObjectAnimator.start(); 
     new Handler().postDelayed(new Runnable() 
     { 
      public void run() 
      { 
      Intent localIntent = new Intent(MainActivity.this, Metric.class); 
      MainActivity.this.startActivity(localIntent); 
      MainActivity.this.finish(); 
      } 
     }, 500L); 
     } 
    }); 
    paramBundle = (Button)findViewById(2131689580); 
    localObjectAnimator = ObjectAnimator.ofPropertyValuesHolder((RelativeLayout)findViewById(2131689579), new PropertyValuesHolder[] { PropertyValuesHolder.ofFloat("scaleX", new float[] { 1.2F }), PropertyValuesHolder.ofFloat("scaleY", new float[] { 1.2F }) }); 
    localObjectAnimator.setRepeatCount(-1); 
    localObjectAnimator.setRepeatMode(2); 
    paramBundle.setOnClickListener(new View.OnClickListener() 
    { 
     public void onClick(View paramAnonymousView) 
     { 
     localObjectAnimator.start(); 
     new Handler().postDelayed(new Runnable() 
     { 
      public void run() 
      { 
      Intent localIntent = new Intent(MainActivity.this, Time.class); 
      MainActivity.this.startActivity(localIntent); 
      MainActivity.this.finish(); 
      } 
     }, 500L); 
     } 
    }); 
    paramBundle = (Button)findViewById(2131689583); 
    localObjectAnimator = ObjectAnimator.ofPropertyValuesHolder((RelativeLayout)findViewById(2131689581), new PropertyValuesHolder[] { PropertyValuesHolder.ofFloat("scaleX", new float[] { 1.2F }), PropertyValuesHolder.ofFloat("scaleY", new float[] { 1.2F }) }); 
    localObjectAnimator.setRepeatCount(-1); 
    localObjectAnimator.setRepeatMode(2); 
    paramBundle.setOnClickListener(new View.OnClickListener() 
    { 
     public void onClick(View paramAnonymousView) 
     { 
     localObjectAnimator.start(); 
     new Handler().postDelayed(new Runnable() 
     { 
      public void run() 
      { 
      Intent localIntent = new Intent(MainActivity.this, Temperature.class); 
      MainActivity.this.startActivity(localIntent); 
      MainActivity.this.finish(); 
      } 
     }, 500L); 
     } 
    }); 
    paramBundle = (Button)findViewById(2131689585); 
    localObjectAnimator = ObjectAnimator.ofPropertyValuesHolder((RelativeLayout)findViewById(2131689584), new PropertyValuesHolder[] { PropertyValuesHolder.ofFloat("scaleX", new float[] { 1.2F }), PropertyValuesHolder.ofFloat("scaleY", new float[] { 1.2F }) }); 
    localObjectAnimator.setRepeatCount(-1); 
    localObjectAnimator.setRepeatMode(2); 
    paramBundle.setOnClickListener(new View.OnClickListener() 
    { 
     public void onClick(View paramAnonymousView) 
     { 
     localObjectAnimator.start(); 
     new Handler().postDelayed(new Runnable() 
     { 
      public void run() 
      { 
      Intent localIntent = new Intent(MainActivity.this, Weight.class); 
      MainActivity.this.startActivity(localIntent); 
      MainActivity.this.finish(); 
      } 
     }, 500L); 
     } 
    }); 
    paramBundle = (Button)findViewById(2131689589); 
    localObjectAnimator = ObjectAnimator.ofPropertyValuesHolder((RelativeLayout)findViewById(2131689586), new PropertyValuesHolder[] { PropertyValuesHolder.ofFloat("scaleX", new float[] { 1.2F }), PropertyValuesHolder.ofFloat("scaleY", new float[] { 1.2F }) }); 
    localObjectAnimator.setRepeatCount(-1); 
    localObjectAnimator.setRepeatMode(2); 
    paramBundle.setOnClickListener(new View.OnClickListener() 
    { 
     public void onClick(View paramAnonymousView) 
     { 
     localObjectAnimator.start(); 
     new Handler().postDelayed(new Runnable() 
     { 
      public void run() 
      { 
      Intent localIntent = new Intent(MainActivity.this, Length.class); 
      MainActivity.this.startActivity(localIntent); 
      MainActivity.this.finish(); 
      } 
     }, 500L); 
     } 
    }); 
    paramBundle = (Button)findViewById(2131689591); 
    localObjectAnimator = ObjectAnimator.ofPropertyValuesHolder((RelativeLayout)findViewById(2131689574), new PropertyValuesHolder[] { PropertyValuesHolder.ofFloat("scaleX", new float[] { 1.2F }), PropertyValuesHolder.ofFloat("scaleY", new float[] { 1.2F }) }); 
    localObjectAnimator.setRepeatCount(-1); 
    localObjectAnimator.setRepeatMode(2); 
    paramBundle.setOnClickListener(new View.OnClickListener() 
    { 
     public void onClick(View paramAnonymousView) 
     { 
     localObjectAnimator.start(); 
     new Handler().postDelayed(new Runnable() 
     { 
      public void run() 
      { 
      Intent localIntent = new Intent(MainActivity.this, Money.class); 
      MainActivity.this.startActivity(localIntent); 
      MainActivity.this.finish(); 
      } 
     }, 500L); 
     } 
    }); 
    paramBundle = (Button)findViewById(2131689597); 
    localObjectAnimator = ObjectAnimator.ofPropertyValuesHolder((RelativeLayout)findViewById(2131689596), new PropertyValuesHolder[] { PropertyValuesHolder.ofFloat("scaleX", new float[] { 1.2F }), PropertyValuesHolder.ofFloat("scaleY", new float[] { 1.2F }) }); 
    localObjectAnimator.setRepeatCount(-1); 
    localObjectAnimator.setRepeatMode(2); 
    paramBundle.setOnClickListener(new View.OnClickListener() 
    { 
     public void onClick(View paramAnonymousView) 
     { 
     localObjectAnimator.start(); 
     new Handler().postDelayed(new Runnable() 
     { 
      public void run() 
      { 
      Intent localIntent = new Intent(MainActivity.this, Food.class); 
      MainActivity.this.startActivity(localIntent); 
      MainActivity.this.finish(); 
      } 
     }, 500L); 
     } 
    }); 
    paramBundle = (Button)findViewById(2131689599); 
    localObjectAnimator = ObjectAnimator.ofPropertyValuesHolder((RelativeLayout)findViewById(2131689598), new PropertyValuesHolder[] { PropertyValuesHolder.ofFloat("scaleX", new float[] { 1.2F }), PropertyValuesHolder.ofFloat("scaleY", new float[] { 1.2F }) }); 
    localObjectAnimator.setRepeatCount(-1); 
    localObjectAnimator.setRepeatMode(2); 
    paramBundle.setOnClickListener(new View.OnClickListener() 
    { 
     public void onClick(View paramAnonymousView) 
     { 
     localObjectAnimator.start(); 
     new Handler().postDelayed(new Runnable() 
     { 
      public void run() 
      { 
      Intent localIntent = new Intent(MainActivity.this, Data.class); 
      MainActivity.this.startActivity(localIntent); 
      MainActivity.this.finish(); 
      } 
     }, 500L); 
     } 
    }); 
    paramBundle = (Button)findViewById(2131689602); 
    localObjectAnimator = ObjectAnimator.ofPropertyValuesHolder((RelativeLayout)findViewById(2131689600), new PropertyValuesHolder[] { PropertyValuesHolder.ofFloat("scaleX", new float[] { 1.2F }), PropertyValuesHolder.ofFloat("scaleY", new float[] { 1.2F }) }); 
    localObjectAnimator.setRepeatCount(-1); 
    localObjectAnimator.setRepeatMode(2); 
    paramBundle.setOnClickListener(new View.OnClickListener() 
    { 
     public void onClick(View paramAnonymousView) 
     { 
     localObjectAnimator.start(); 
     new Handler().postDelayed(new Runnable() 
     { 
      public void run() 
      { 
      Intent localIntent = new Intent(MainActivity.this, Frequency.class); 
      MainActivity.this.startActivity(localIntent); 
      MainActivity.this.finish(); 
      } 
     }, 500L); 
     } 
    }); 
    paramBundle = (Button)findViewById(2131689605); 
    localObjectAnimator = ObjectAnimator.ofPropertyValuesHolder((RelativeLayout)findViewById(2131689604), new PropertyValuesHolder[] { PropertyValuesHolder.ofFloat("scaleX", new float[] { 1.2F }), PropertyValuesHolder.ofFloat("scaleY", new float[] { 1.2F }) }); 
    localObjectAnimator.setRepeatCount(-1); 
    localObjectAnimator.setRepeatMode(2); 
    paramBundle.setOnClickListener(new View.OnClickListener() 
    { 
     public void onClick(View paramAnonymousView) 
     { 
     localObjectAnimator.start(); 
     new Handler().postDelayed(new Runnable() 
     { 
      public void run() 
      { 
      Intent localIntent = new Intent(MainActivity.this, Numeral.class); 
      MainActivity.this.startActivity(localIntent); 
      MainActivity.this.finish(); 
      } 
     }, 500L); 
     } 
    }); 
    } 

    public boolean onCreateOptionsMenu(Menu paramMenu) 
    { 
    getMenuInflater().inflate(2131755008, paramMenu); 
    return true; 
    } 

    public boolean onOptionsItemSelected(MenuItem paramMenuItem) 
    { 
    if (this.mDrawerToggle.onOptionsItemSelected(paramMenuItem)) { 
     return true; 
    } 
    switch (paramMenuItem.getItemId()) 
    { 
    } 
    for (;;) 
    { 
     return super.onOptionsItemSelected(paramMenuItem); 
     startActivity(new Intent(this, About.class)); 
     continue; 
     Object localObject = new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=com.TechnologyForTomorrow.Converjz")); 
     try 
     { 
     startActivity((Intent)localObject); 
     localObject = ((AnalyticsTracker)getApplication()).getTracker(AnalyticsTracker.TrackerName.APP_TRACKER); 
     ((Tracker)localObject).enableAdvertisingIdCollection(true); 
     ((Tracker)localObject).setScreenName("EULA"); 
     ((Tracker)localObject).send(new HitBuilders.AppViewBuilder().build()); 
     } 
     catch (ActivityNotFoundException localActivityNotFoundException) {} 
     continue; 
     startActivity(new Intent(this, EULA.class)); 
    } 
    } 

    protected void onPostCreate(Bundle paramBundle) 
    { 
    super.onPostCreate(paramBundle); 
    this.mDrawerToggle.syncState(); 
    } 

    public boolean onPrepareOptionsMenu(Menu paramMenu) 
    { 
    this.mDrawerLayout.isDrawerOpen(this.mDrawerList); 
    return super.onPrepareOptionsMenu(paramMenu); 
    } 

    public void setTitle(CharSequence paramCharSequence) 
    { 
    this.mTitle = paramCharSequence; 
    getSupportActionBar().setTitle(this.mTitle); 
    } 

    private class DrawerItemClickListener 
    implements AdapterView.OnItemClickListener 
    { 
    private DrawerItemClickListener() {} 

    public void onItemClick(AdapterView paramAdapterView, View paramView, int paramInt, long paramLong) 
    { 
     MainActivity.this.selectItem(paramInt); 
    } 
    } 
} 


/* Location:    C:\Noah's stuff\dex2jar-2.0\Converjz-dex2jar.jar!\course\labs\converjz\MainActivity.class 
* Java compiler version: 6 (50.0) 
* JD-Core Version:  0.7.1 
*/ 
+0

Попробуйте и сообщите нам результат! – TheGreatContini

+0

Я надеюсь, что он будет работать после завершения установки студии Android. Я просто хотел узнать, должен ли кто-то проходить тот же процесс, что и я, и это сработало для них. –

ответ

1

Будут ли они изменить назад, когда я импортировать проект обратно в Android Studio?

Нет, потому что нет «спины». Android Studio не знает, что это не тот код, который вы хотите.

Именно поэтому вместо декомпиляции APK вам необходимо восстановить проект из резервной копии вашего компьютера или из вашей системы контроля версий.

Вы, безусловно, можете найти другой декомпилятор и посмотреть, дает ли он вам больше результатов по вашему вкусу. Я бы порекомендовал вам это сделать после настройки ночного резервного копирования для вашего компьютера.

+0

Ну, вот что, я не мог сделать это раньше, поэтому надеюсь, что все может быть исправлено, видимо, это сработало для других людей, чтобы он мог работать для меня. –

+0

Получите это, это сработало, android смог поставить код, который он изменяет при компиляции, обратно в исходное состояние. Я очень благодарен, что все вернулось к нормальной жизни. –

Смежные вопросы