Archive

Posts Tagged ‘gaming’

Your Google Play Publisher Console has been terminated, because of Copyright infringement..

September 4, 2013 4 comments

This morning I found an email in my inbox that looked like this:
fake email google console
The first impression was like “What?!”. It’s true that recently Google Play Developer Policies were modified, and I heard stories from developers who had their accounts terminated because of violations of content policy. So in the current context this email seemed like true.

However, after a closer examination I noticed a few suspect things.
1. Firstly, the email address ivopi44@abv.bg was too suspicious to believe that it is from Google.
2. Secondly, the email was sent not only to me, but to a list of people.
3. All the links appearing in the email pointed to the same and one url.
4. And lastly, the real urls were masked behind goo.gl URL Shortener, which again I found it suspicious.

So I opened one of the links in the email in a private window, and the following page was displayed.
fake_google
The google Sign in box, the text that appears in the page, and the color scheme, makes it appear as something known for an Android developer.
However if you take a closer look at the page url, you may notice that the page is not hosted on Google servers, but on some address, savegaselectricity(dot)com. Also, it has a parameter named “continue” with the real google play page as value. Probably after successfully logging, to redirect you to real Google Play Developer Console page, so you won’t see notice anything strange.

The technique used by the attacker in fact is not new, it is one variation of impersonation attacks, where an attacker impersonates a legitimate site, tricking the users to log in and stealing their passwords.

So, if you will receive such an email, delete it, your google play account most probably is ok. If however you already used the fake page to login, change your password immediately.

As a rule of thumb, always be skeptical.
Do not click on links, download files or open attachments in emails from unknown senders. If you get one of these emails and are worried that there may be a real problem with your account, open up a new browser window, go directly to your Developer Console site and sign in there.

Taking a screenshot of current Activity in Android

January 6, 2013 15 comments

In this post I’ll show how you can take a screenshot of your current Activity and save the resulting image on /sdcard.

The idea behind taking a screenshot actually is pretty simple: what we need to do is to get a reference of the root view andĀ  generate a bitmap copy of this view.

screenshot

Considering that we want to take the screenshot when a button is clicked, the code will look like this:

findViewById(R.id.button1).setOnClickListener(new OnClickListener() {
   @Override
   public void onClick(View v) {
       Bitmap bitmap = takeScreenshot();
       saveBitmap(bitmap);
   }
});

 

First of all we should retrieve the topmost view in the current view hierarchy, then enable the drawing cache, and after that call getDrawingCache().

Calling getDrawingCache(); will return the bitmap representing the view or null if cache is disabled, that’s why setDrawingCacheEnabled(true); should be set to true prior invokingĀ  getDrawingCache().

public Bitmap takeScreenshot() {
   View rootView = findViewById(android.R.id.content).getRootView();
   rootView.setDrawingCacheEnabled(true);
   return rootView.getDrawingCache();
}

 

And the method that saves the bitmap image to external storage:

 public void saveBitmap(Bitmap bitmap) {
    File imagePath = new File(Environment.getExternalStorageDirectory() + "/screenshot.png");
    FileOutputStream fos;
    try {
        fos = new FileOutputStream(imagePath);
        bitmap.compress(CompressFormat.JPEG, 100, fos);
        fos.flush();
        fos.close();
    } catch (FileNotFoundException e) {
        Log.e("GREC", e.getMessage(), e);
    } catch (IOException e) {
        Log.e("GREC", e.getMessage(), e);
    }
}

 

Since the image is saved on external storage, the WRITE_EXTERNAL_STORAGE permission should be added AndroidManifest to file:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Follow

Get every new post delivered to your Inbox.

Join 510 other followers

%d bloggers like this: