Skip to content

Instantly share code, notes, and snippets.

View shriduttkothari's full-sized avatar
🎯
Focusing

Shridutt Kothari shriduttkothari

🎯
Focusing
View GitHub Profile
@shriduttkothari
shriduttkothari / RemoveOldKeys.sh
Last active December 21, 2015 12:29
Remove the existing AOSP keys
$ rm build/target/product/security/*.p*
@shriduttkothari
shriduttkothari / CreateNewKeys.sh
Created August 22, 2013 11:43
Create New Keys for Android
$ /development/tools/make_key build/target/product/security/media ‘/C=US/ST=Utah/L=Salt Lake City/O=Android/OU=Android/CN=Android/emailAddress=android@example.com’
$ /development/tools/make_key build/target/product/security/platform ‘/C=US/ST=Utah/L=Salt Lake City/O=Android/OU=Android/CN=Android/emailAddress=android@example.com’
$ /development/tools/make_key build/target/product/security/shared ‘/C=US/ST=Utah/L=Salt Lake City/O=Android/OU=Android/CN=Android/emailAddress=android@example.com’
$ /development/tools/make_key build/target/product/security/testkey ‘/C=US/ST=Utah/L=Salt Lake City/O=Android/OU=Android/CN=Android/emailAddress=android@example.com’
@shriduttkothari
shriduttkothari / VerifyKeys.sh
Created August 22, 2013 11:48
Verify the Keys
$ build/target/product/security/openssl x509 -noout -subject -issuer -in media.x509.pem
$ build/target/product/security/openssl x509 -noout -subject -issuer -in shared.x509.pem
$ build/target/product/security/openssl x509 -noout -subject -issuer -in platform.x509.pem
$ build/target/product/security/openssl x509 -noout -subject -issuer -in testkey.x509.pem
@shriduttkothari
shriduttkothari / Re-signOTAfile.sh
Created August 22, 2013 11:52
Re-sign the OTA file Content
$ /build/tools/releasetools/sign_target_files_apks -d build/target/product/security/ out/target/product/ product_name/someotafile.zip out/target/product/ product_name/signed-target_files.zip
@shriduttkothari
shriduttkothari / Re-signManuallyBySignApk.jar.sh
Created August 22, 2013 11:55
Re-sign the OTA file manually with SignApk.jar
$ java -jar /build/tools/signapk/signapk.jar testkey.x509.pem testkey.pk8 [update.zip] [update-signed.zip]
@shriduttkothari
shriduttkothari / MakeOtapackage.sh
Created August 22, 2013 12:00
make otapackage
$ make otapackage
@shriduttkothari
shriduttkothari / Maketarget-files-package.sh
Last active December 21, 2015 12:29
make target-files-package
$ make target-files-package
@shriduttkothari
shriduttkothari / AndroidMenifestPermissions.xml
Created August 22, 2013 12:27
Create an Android application with following permissions:
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_CACHE_FILESYSTEM" />
<uses-permission android:name="android.permission.DELETE_CACHE_FILES" />
<uses-permission android:name="android.permission.REBOOT" />
@shriduttkothari
shriduttkothari / AndroidMenifest.xml
Created August 22, 2013 12:56
Activity with intent filter SYSTEM_UPDATE_SETTINGS
<activity
android:name=".FOTAUpdaterActivity"
android:label="System Updates">
<intent-filter>
<action android:name="android.settings.SYSTEM_UPDATE_SETTINGS" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
@shriduttkothari
shriduttkothari / RomCheckerAyncTask.java
Last active December 21, 2015 12:38
Create an AsyncTask, which can be called whenever polling is required to be performed to check the update on server, the doInBackground() method will have pseudo code as follows:
private RomInfo doInBackground(Void... notused) {
//Check Network availability
ArrayList<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();
params.add(new BasicNameValuePair("device",android.os.Build.DEVICE.toLowerCase()));
params.add(new BasicNameValuePair("rom", Utils.getRomID()));
HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet(SERVER_PULL_URL + "?" + URLEncodedUtils.format(params, "UTF-8"));
HttpResponse r = client.execute(get);
int status = r.getStatusLine().getStatusCode();