Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 10    Views: 76

Yash Kumar
buzztouch Evangelist
Profile
Posts: 66
Reg: Jan 29, 2012
Jharkhand
660
05/12/12 07:42 AM (13 years ago)

Auto Download Config Data

I want to enable auto download config data in BT 2.0 as the user install the app like the feature of BT 1.4 I does not want all the data store in my application's config file because some of the users had decompile my app and browsed my all the premium contents of my app. So anything can be possible here ? or how can i upload BT_config.txt in my server ?
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/12/12 09:50 AM (13 years ago)
Copy & paste BT_config.txt Do you need a copy packaged in the app? BT1.4 does have one. Perhaps that's all you need for the Project files. Question is can you access the cached Config file? Fred
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/12/12 01:21 PM (13 years ago)
For Android: Using the Internal Storage You can save files directly on the device's internal storage. By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). When the user uninstalls your application, these files are removed. Fred
 
Sandeep
Android Fan
Profile
Posts: 1260
Reg: Feb 01, 2012
Miraj, India
25,250
like
05/12/12 09:40 PM (13 years ago)
Hello Fred, i think the app by default is set to internal storage unless we set the preference to the external storage. Do you mean to say that, if we set preference of the app to external storage, there is possibility of someone decompiling the application?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/12/12 09:58 PM (13 years ago)
Hey Yash, I'm not quite sure you can do what you're asking. In all cases...online or offline apps, v1.4 or others, the configuration data file, in one form or another, is cached on the device. Even in v1.4, where the config file resides on the buzztouch server, it still gets cached to the device after the first time it gets loaded. Additionally, the URL of the configuration data file is included in all versions of the app, so, if they can decompile it, then they probably have access to that URL. and can grab it that way. Ultimately, if a person wants to break open your app and grab the premium content, there's probably not much you can do about that at the moment. Mark
 
Yash Kumar
buzztouch Evangelist
Profile
Posts: 66
Reg: Jan 29, 2012
Jharkhand
660
like
05/12/12 11:17 PM (13 years ago)
Thanks Fred,GoNorthWest for the helpful answer. Actually I regularly update my app from Android Developer Console with the new updates of BT App's Configuration Data because some of the user not want to manually update their app after installing. I was thinking that all the App's Configuration Data should auto download after installing the app, like in BT 1.4. i not want to keep "BT_config.txt" inside my app, rather i want to upload it to my server. Then after the user installs my app then All the App's Configuration should save in cached config data. After doing this all the fear will be removed. Can it is possible ? I think am very close to it, i have found where i have to do changes to download all the data from my own server "www.myserver.com/BT_config.txt" when the user installs my application. I not want to keep BT_config.txt file inside my application. In BT_activity_root.java Line No. 381 ......................................................................... if(BT_fileManager.doesProjectAssetExist("", configurationFileName)){ eclipseConfigData = BT_fileManager.readTextFileFromAssets("", configurationFileName); BT_debugger.showIt(activityName + ":loadAppData loaded BT_config.txt from /assets folder successfully..."); } ......................................................................... here i want to change below line to call the BT_cofig.txt from my own server """"BT_fileManager.readTextFileFromAssets("", configurationFileName);"""" Here please help . . . ..
 
Yash Kumar
buzztouch Evangelist
Profile
Posts: 66
Reg: Jan 29, 2012
Jharkhand
660
like
05/13/12 03:45 AM (13 years ago)
Guys I have done .. . . . I have created a Page when the app will run first time then that page will give instruction to my users then at the bottom of the page, i have created a button namely "continue" which let to Update all the content of the app. By doing this now no one can browse my premium content. I have done following steps :- ...................................... 1. In My server, created new App with a single screen namely BT_screen_blank. 2. Downloaded the project or config file from my server. 3. Modified BT_screen_blank.java Here are code i used. ...................................................... package com.mypackagename; import com.hackershome.BT_activity_base.BackgroundImageWorkerThread; import com.hackershome.BT_activity_base.ReportToCloudWorkerThread; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.Intent; import android.graphics.drawable.Drawable; import android.location.LocationManager; import android.os.Bundle; import android.os.Handler; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.Toast; public class BT_screen_blank extends Activity{ protected String activityName = "BT_activity_base"; public static Activity thisActivity = null; public BackgroundImageWorkerThread backgroundImageWorkerThread = null; public Handler backgroundImageWorkerHandler = null; public boolean downloadInProgress = false; public Drawable backgroundImage = null; public AlertDialog myAlert = null; public AlertDialog confirmRefreshAlert = null; public ProgressDialog progressBox = null; public BT_progressSpinner progressSpinner = null; public BT_item screenData = null; public BT_item tapScreenLoadObject = null; public BT_item tapMenuItemObject = null; public ReportToCloudWorkerThread reportToCloudWorkerThread = null; public Handler reportToCloudHandler = null; public String appLastModifiedOnServer = ""; public RelativeLayout backgroundSolidColorView = null; public RelativeLayout backgroundGradientColorView = null; public ImageView backgroundImageView = null; public LinearLayout baseContentView = null; public LinearLayout titleContainerView = null; public LocationManager locationManager; public int locationUpdateCount = 0; public String locationListenerType = ""; //visible / showing public static final int INVISIBLE = 4; public static final int VISIBLE = 0; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.screen_blank); Button buttonStart = (Button)findViewById(R.id.button55); buttonStart.setOnClickListener(startListener); // Register the onClick listener with the implementation above } //Create an anonymous implementation of OnClickListener private OnClickListener startListener = new OnClickListener() { public void onClick(View v) { refreshAppData(); } } ; public void showToast(String theMessage, String shortOrLong){ Toast toast = null; if(shortOrLong.equalsIgnoreCase("short")){ toast = Toast.makeText(getBaseContext(), theMessage, Toast.LENGTH_SHORT); }else{ toast = Toast.makeText(hackershome_appDelegate.getContext(), theMessage, Toast.LENGTH_LONG); } toast.show(); } private void refreshAppData(){ BT_debugger.showIt(activityName + ":refreshAppData"); //showToast... showToast(getString(R.string.loadingTitle), "long"); //finish this activity... this.finish(); //start BT_activity_root with "1" as payload to signal we are refreshing... Intent i = new Intent(this, BT_activity_root.class); i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); i.putExtra("isRefreshing", 1); startActivity(i); overridePendingTransition(R.anim.fadein, R.anim.fadeout);} } .................................................................. 4. Modified screen_blank.xml <?xml version="1.0" encoding="UTF-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerView" android:background="@android:color/transparent" android:layout_width="fill_parent" android:layout_height="fill_parent"> <Button android:id="@+id/button55" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:layout_marginTop="157dp" android:text="continue" /> </RelativeLayout> ................................................................. That's all I know that some of the codes in BT_screen_blank.java is written unnecessary :)
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/13/12 06:46 AM (13 years ago)
From developer.android site: (Not my sides) *** For Android: Using the Internal Storage You can save files directly on the device's internal storage. By default, files saved to the internal storage are private to your application and other applications cannot access them (nor can the user). When the user uninstalls your application, these files are removed. *** This is referring to to Config data, not where the app is installed. So none of app's content can be viewed. However as noted above the app would need to update via a URL. Even the modified blank screen will have a URL. So, the trick would be to not display the URL. Fred
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/13/12 06:53 AM (13 years ago)
Regarding: Hello Fred, i think the app by default is set to internal storage unless we set the preference to the external storage. Do you mean to say that, if we set preference of the app to external storage, there is possibility of someone decompiling the application? If the config file saved to external then the cached data would be viewable. This is not what you want so no need to do this. However I would like like to know how to accomplish this. I might come in handy one day. Fred
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/13/12 07:37 AM (13 years ago)
Hiding the data question aside, you do bring up an interesting question. How to enable auto download? Fred
 
Yash Kumar
buzztouch Evangelist
Profile
Posts: 66
Reg: Jan 29, 2012
Jharkhand
660
like
05/13/12 01:41 PM (13 years ago)
leave Decompiling topic, I am totally confused :P I have got the solution How to Enable Auto Download. . . but require some more tweaks .. . . I have posted the steps in my previous post. but some more changes require to enable auto download in "BT_screen_blank.java" In BT_screen_blank.java i have called OnClickListener function, instead of that we have to call directly, then the problem will be solve.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.