[Q] MIUI v6 patchrom - Galaxy Note II, Galaxy S III Developer Discussion

Hey all,
I'm trying to port MIUI V6 to my beloved s3 lte. I've battled through numerous errors but now I'm a bit stuck.
I've followed the instructions as per miui's git page up to 'make firstpatch'. Now i get lots of 'hunk failed' errors and I can't figure out how to use .rej files to make patches. Below is an example of part of a .rej file. I'm using cyanogenmod as my base rom.
How should I progress editing these files and what commands should I use to patch? Many thanks in advance.
*** 261,267 ****
.field mForcingShowNavBarLayer:I
! .field mGlobalActions:Lcom/android/internal/policy/impl/GlobalActions;
.field private mGlobalKeyManager:Lcom/android/internal/policy/impl/GlobalKeyManager;
--- 263,269 ----
.field mForcingShowNavBarLayer:I
! .field mGlobalActions:Lcom/android/internal/policy/impl/MiuiGlobalActions;
.field private mGlobalKeyManager:Lcom/android/internal/policy/impl/GlobalKeyManager;
***************

Related

[MOD][12.11] Your own OTA for custom roms [DEVS ONLY]

I use this technology to update my roms in Russia, and now i want to share it
You must have own server to use it.
Step 1. Preparing ROM
build.prop mods:
Code:
#Version of your rom in format: Name X.X.X for example: ViperY 1.0.1
ro.product.version = <YOUR ROM NAME> <VERSION>
#Path to checkin script
ro.htc.checkin.url = http://ruhdrom.ru/cgi-bin/checkin
#Path to script [JUST BLOCK]
ro.htc.checkin.crashurl = http://ruhdrom.ru/cgi-bin/crash
#Path to checkin script
ro.htc.checkin.url_CN = http://ruhdrom.ru/cgi-bin/checkin
#Path to script [JUST BLOCK]
ro.htc.checkin.crashurl_CN = http://ruhdrom.ru/cgi-bin/crash
#Path to script [JUST BLOCK]
ro.htc.checkin.exmsg.url = http://ruhdrom.ru/cgi-bin/extra
#Path to script [JUST BLOCK]
ro.htc.checkin.exmsg.url_CN = http://ruhdrom.ru/cgi-bin/extra
ro.htc.appupdate.url = http://ruhdrom.ru/cgi-bin/appupdate
ro.htc.appupdate.url_CN = http://apu-chin.htccomm.com.cn/check-in/rws/and-app/update
#Path to script [JUST BLOCK]
ro.htc.iappupdate.url = http://ruhdrom.ru/cgi-bin/iappupdate
#Path to script [JUST BLOCK]
ro.htc.iappupdate.url_CN = http://ruhdrom.ru/cgi-bin/iappupdate
#Path to script [JUST BLOCK]
ro.htc.appupdate.exmsg.url = http://ruhdrom.ru/cgi-bin/appupdate_extra
#Path to script [JUST BLOCK]
ro.htc.appupdate.exmsg.url_CN = http://ruhdrom.ru/cgi-bin/appupdate_extra
Adding certs
pack pem cert that you use for signing rom's zip with name releasekey.x509.pem to the zip archive and name it otacerts.zip
place otacerts.zip in /system/etc/security in your Rom
HTCCheckin modification
1. Extract and decompile file HTCOTAClient.apk or HTCCheckin.apk from you rom
2. Find word "ro.build.version.sdk" in all smali files and replace it with "ro.product.version"
3. Find word "apiLevel" in all smali files and replace it with "rom_version"
4. Compile HTCOTAClient and put it in your rom
ROM Modification DONE
Step 2: Setting up server
You need perl installed on server and mysql db, to use my solution
Creating DBS
Just import my sql files to create dbs
Whats containing in tables:
Users table:
IMEI - user imei
User - user nick
Version - current rom version
BetaTester - is this your beta tester
device - user device - value from ro.product.device
LastCheck - last update check
CheckResult - teh field - talk if user request update, but not download it yet
Fota table:
Device - for what device this update ( value from ro.product.device of build.prop )
FromVer - for what version this update
ToVer - to what version rom will be updated
FileName - direct link to flashable zip file
FileSize - file size in mbytes
Description - description of update
IsBeta - send this update only for beta testers
Installing perl scripts
Edit file checkin
Code:
my $server = ''; #server
my $db_user_name = ''; #DB User
my $db_password = ''; #DB Password
my $db_server = ''; #DB Server
my $db = ''; #DB
place both files into cgi-bin directory on server
change permission for scripts to 0755
CHECK UPDATE))))
Using beta testers function:
Say you beta tester to check update
Find his imei in users table, and set BetaTester=1 and User=<UserNick>
Insert record about update in fota table, and set isBeta = 1
This is brilliant and could lead to a very cool way of providing Rom updates
Thanks, this sounds really cool
Just noticed your guide and thx for that.
But i have a few questions and hope you'll could help a bit.
I trying to implant this into my Sense 4.0 for pyramid rom.
First of all when following your guide and monitoring my phones traffic via proxy there is no outbound traffic.
When using (for testing purpose) your ViperSs rom modded files there is some traffic to your server.
Editing them to connect mine it does seems to work.
Also the checking script seems to work due the fact it is writing some data into MySQL.
But this was just for testing purposes, kanging aint my thing.
Also i think this guide i missing some essential scripts or guide lines.
Because until now the available scripts here only writes some data to MySQL and are doing nothing besides that, right.
Here are my question:
- Where should the OTA zip be placed
- How should the OTA look like (usual rom.zip, ota style like HTC, ect)
- Which script is needed so the OTA is distributed automatically instead of modding the fota table manually
- Whichis smali modifications should be made so the OTA can be found and downloaded, installed automaticly (only have checkin now)
- Seems your ViperSs rom uses a lot more perl scripts, are these missing here
thx in advanced
Nice idea, i have tried it, but from where i get the appupdate files? The phone always request a app_update too?
I don't know why the CyanogenMod team never did this from day 1. The amount of nightly releases they go through, it would be a lot easier than having to download rom on computer, then onto SD card.
V6-Maniac said:
Here are my question:
- Where should the OTA zip be placed
- How should the OTA look like (usual rom.zip, ota style like HTC, ect)
- Which script is needed so the OTA is distributed automatically instead of modding the fota table manually
- Whichis smali modifications should be made so the OTA can be found and downloaded, installed automaticly (only have checkin now)
- Seems your ViperSs rom uses a lot more perl scripts, are these missing here
thx in advanced
Click to expand...
Click to collapse
The OTA file should be placed in the directory defined in "my $server="http://xxx/fota";"
E.g Venom OneX ROM is in:
http://***********/fota/endavourU/ViperXOTA_2.5.0-2.6.0.zip
so
my $server="http://***********/fota/endavourU/";
Note: I have starred out the URL .com domain.
OTA file should be usual custom ROM zip file
As to the others, I cant answer them yet but there are perl scripts missing - iapp_update and app_update
It is a good sharing, thank you very much!
Jonny said:
As to the others, I cant answer them yet but there are perl scripts missing - iapp_update and app_update
Click to expand...
Click to collapse
Yeah, that i mean Can anyone upload the files?!
ONeill123 said:
Yeah, that i mean Can anyone upload the files?!
Click to expand...
Click to collapse
Nope because m0narx and j4n87 are not replying to my pm's (m0narx has been ignoring my pm's for over 5 months) - I'll try to catch j4n87 on IRC but I dont think he'll reply.
Then i think, that this thread is very unuseful.
@m0narx:
If you create those threads, then plz upload all files needed and give us all information, if not, this threads are not goo seen here.
I hope, that m0narx do the uploads, it give not another OTA method, or?
I upload all needed files, no more files needed for ota
Sorry for the question. But must it be a speciall server or a "normal"??
Simple server with MySQL, Perl and apache
M0narx, i habe Tester this method, übt Not funct. And Chat i mist Type for the appupdate in Bild.Prop?
Sent from my HTC Sensation XE with Beats Audio Z715e using xda app-developers app
m0narx said:
I upload all needed files, no more files needed for ota
Click to expand...
Click to collapse
What do you do with the checkin script in Venom ROM though because you have edited smali, not build.prop
Code:
.field public static CLIENT_VERSION:Ljava/lang/String; = null
.field private static final COTA_DFT_CHECKIN_URL:Ljava/lang/String; = "http://ruhdrom.net/cgi-bin/cota"
.field private static final COTA_DFT_CHECKIN_URL_CN:Ljava/lang/String; = "http://ruhdrom.net/cgi-bin/cota"
.field private static final COTA_ENABLE_PROPERTY:Ljava/lang/String; = "ro.config.venom.enableCOTA"
.field private static final COTA_PROP_CHECKIN_URL:Ljava/lang/String; = "ro.venom.cota.url"
.field private static final COTA_PROP_CHECKIN_URL_CN:Ljava/lang/String; = "ro.venom.cota.url"
.field private static final FOLDER_CW_OUTPUT:Ljava/lang/String; = "/data/data/cwtemp/"
.field public static LOCAL_LOGV:Z
.field public static TAG:Ljava/lang/String;
Code:
invoke-virtual {v11, v0, v4}, Lorg/json/JSONObject;->put(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
const-string v19, "ro.product.version"
invoke-static/range {v19 .. v19}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;
move-result-object v16
if-nez v16, :cond_c
const-string v16, "N/A"
:cond_c
const-string v19, "romVersion"
move-object/from16 v0, v19
move-object/from16 v1, v16
In COTAReceiver.smali so you must have changed something in your checkin perl file to adapt it to use ro.product.version instead of my.rom.version - because ro.product.version is not in 1.x.x format, its ro.product.version=ViperS 1.2.1 so what edit did you do to the checkin script?
---------- Post added at 08:03 PM ---------- Previous post was at 08:02 PM ----------
ONeill123 said:
M0narx, i habe Tester this method, übt Not funct. And Chat i mist Type for the appupdate in Bild.Prop?
Sent from my HTC Sensation XE with Beats Audio Z715e using xda app-developers app
Click to expand...
Click to collapse
I think a way round the appupdate problem is create an empty script file named appupdate - maybe thats what m0narx meant by [JUST BLOCK]?
Maybe, but the Script will Not fetzen anhing. Udo Chat the Rom ota Service think then.
Sent from my HTC Sensation XE with Beats Audio Z715e using xda app-developers app
Code:
.field private static final COTA_DFT_CHECKIN_URL:Ljava/lang/String; = "http://ruhdrom.net/cgi-bin/cota"
.field private static final COTA_DFT_CHECKIN_URL_CN:Ljava/lang/String; = "http://ruhdrom.net/cgi-bin/cota"
There appears to also be a cota perl script missing that is present in Viper ROMs
This its just block from going to HTC site. It's just empty Perl script
m0narx said:
This its just block from going to HTC site. It's just empty Perl script
Click to expand...
Click to collapse
how about the checkin mod to get ro.product.version recognised though because in OP you say my.rom.version bust be in x.x.x format but in COTAReceiver.smali you have replaced "<SHORTROMNAME>_version" with "romVersion and "my.rom.version" with ro.product.version"

broodROM RC5 UsbSettings force close

Hi to everyone,
I would like to reply to this post about a force close entering the UsbSettings in broodRom RC5 rev 1 & 2(prerelease).
Specifically the exception is this: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.UsbSettings}: java.lang.NumberFormatException: unable to parse '' as integer
Unfortunately I'm not able to post there since I've just registered my accout; I hope this is the best section to post and that someone will notice it anyway.
After a couple of hours of serious digging I found that the problem depends on the fact that build prop lacks:
Code:
persist.service.usb.setting=0
which sets the default mode (kies) for usb.
that value is requested by com.android.settings.UsbSettings.onCreate of Settings.apk
Code:
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
int i = Integer.parseInt(SystemProperties.get("persist.service.usb.setting"));
this.mUSB_mode = i;
---cut---
restoring the above line in build prop fixes the issue!
yota73 said:
Hi to everyone,
I would like to reply to this post about a force close entering the UsbSettings in broodRom RC5 rev 1 & 2(prerelease).
Specifically the exception is this: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.UsbSettings}: java.lang.NumberFormatException: unable to parse '' as integer
Unfortunately I'm not able to post there since I've just registered my accout; I hope this is the best section to post and that someone will notice it anyway.
After a couple of hours of serious digging I found that the problem depends on the fact that build prop lacks:
Code:
persist.service.usb.setting=0
which sets the default mode (kies) for usb.
that value is requested by com.android.settings.UsbSettings.onCreate of Settings.apk
Code:
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
int i = Integer.parseInt(SystemProperties.get("persist.service.usb.setting"));
this.mUSB_mode = i;
---cut---
restoring the above line in build prop fixes the issue!
Click to expand...
Click to collapse
Thanks! , I saw it before but didn't knew if this was the right fix^^
thanks for the solution..im sorry but im newbie but where to locate that in the script manager?im still learning about this android..thanks
The file is /system/build.prop, you need to be root to edit it and to mount /system read write.
Both things are enabled by default in broodrom, and any detail can be easily found by searching the forum.
Please note that this has nothing to do with scriptmanager and is best achieved though ADB.
If you have not the android SDK installed, maybe it would be better if you just wait Rev 2, which hopefully will integrate the fix
Colors fixes
Hi brood,
still posting here until I (if ever) reach 10 posts.
I've managed to fix color-issue (at least for most colors) in your rom by editing the twframework-res.apk.
It seems that samsung apps are using it instead of framework-res.apk.
The quickest way to improve the situation is modify .xmls that are using tw_color002 to use tw_color001 instead.
As you can see in /res/values/colors.xml tw_color002 is black while tw_color001 is white.
Obviously there is not one unique solution, but is more a matter of choosing the right palette to fit with the dark theme, either by changing color reference in each xml or by changing them all at once in /res/values/colors.xml
I hope this can help!

[Q] Implement intell_plug

I'm attempting to implement faux123's intelli_plug into my kernel. It was added in this commit and enabled in "make menuconfig". However, it throws me errors during compilation:
Code:
arch/arm/hotplug/intelli_plug.c:166: error: undefined reference to 'avg_nr_running'
arch/arm/hotplug/intelli_plug.c:227: error: undefined reference to 'avg_cpu_nr_running'
make: *** [.tmp_vmlinux1] Error 1
I have reached out prior to this post, but that has gotten me nowhere.
Thanks in advance.
I have the same problem. Did you fix it?
take a look at the commit here:
https://github.com/faux123/android_kernel_oppo_n1/commit/64f86a98a0b70c42dc9d0a875164543b890012f4
i found the solution here and compile worked well
http://forum.xda-developers.com/showthread.php?p=55894825#post55894825
br,
nosedive
That's how you implement Intelliplug 4.0 properly.
https://github.com/olokos/OK-Kernel-Z1-LP/commit/bdda0d6b2edf66734f9a7b2b72797896028fbf16
Please do mention me when you use my commit as it took me a few hours to track down every single intelliplug change (it's spread between three different devices) and then merge it into a single working commit.
Op if it works please release it.
Hello I have the sam eproblem with implementaion of Intelli_plug to Samsung Exynos platform:
the same errors with avg_nr_running - Ive added codes to the core.c but in shed.h I have not the same codes as You have means no for ex. :
Code:
static inline void inc_nr_running(struct rq *rq) - I HAVE NO this function..
{
#ifdef CONFIG_INTELLI_PLUG
struct nr_stats_s *nr_stats = &per_cpu(runqueue_stats, rq->cpu);
#endif
sched_update_nr_prod(cpu_of(rq), rq->nr_running, true);
#ifdef CONFIG_INTELLI_PLUG
write_seqcount_begin(&nr_stats->ave_seqcnt);
nr_stats->ave_nr_running = do_avg_nr_running(rq);
nr_stats->nr_last_stamp = rq->clock_task;
#endif
rq->nr_running++;
#ifdef CONFIG_INTELLI_PLUG
write_seqcount_end(&nr_stats->ave_seqcnt);
#endif
and alwyas I have compilling error .
I put my shed.h file
View attachment sched.h
Thx for any help

Fixing boot on custom kernels support that targets CyanogenMod

I get a lot of question that my custom kernel breaks support their own AOSP-based ROMs.
So I'm here to how to fix that from your side.
The culprit is CyanogenMod's /init.environ.rc.
CM has been messing around that in recent months.
Changing BOOTCLASSPATH does not break cross-compatibility between different AOSP forks, as long as they don't remove stuffs and just adds stuff.
The problem is SYSTEMSERVERCLASSPATH. If any new stuffs are added, Android RunTime will just abort itself and refuse to boot.
And recently, CyanogenMod added Cyanogen Platform API.
That additionally adds /system/framework/org.cyanogenmod.platform.jar to the /init.environ.rc's SYSTEMSERVERCLASSPATH.
That breaks other AOSP-forks that doesn't use Cyanogen Platform API.
So those ROM developers have 3 options.
They can..
1. Just go and use Cyanogen Platform API. Undoubtedly, this would be super hard if your ROM is not already based on CyanogenMod.
2. Ask custom kernel developers to release a separate version just for your ROM. Very unlikely.
3. Solution below.
Most elegant solution I ended up so far is patch your Android RunTime(android_art) to just bypass extra SYSTEMSERVERCLASSPATH.
Just go to art/runtime/native/dalvik_system_DexFile.cc.
Around line 380..
Code:
diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc
index 3298b46..50aa44c 100644
--- a/runtime/native/dalvik_system_DexFile.cc
+++ b/runtime/native/dalvik_system_DexFile.cc
@@ -382,14 +382,6 @@ static jbyte IsDexOptNeededInternal(JNIEnv* env, const char* filename,
// Logging of reason for returning kDexoptNeeded or kPatchoatNeeded.
const bool kReasonLogging = true;
- if ((filename == nullptr) || !OS::FileExists(filename)) {
- LOG(ERROR) << "DexFile_isDexOptNeeded file '" << filename << "' does not exist";
- ScopedLocalRef<jclass> fnfe(env, env->FindClass("java/io/FileNotFoundException"));
- const char* message = (filename == nullptr) ? "<empty file name>" : filename;
- env->ThrowNew(fnfe.get(), message);
- return kUpToDate;
- }
-
// Always treat elements of the bootclasspath as up-to-date. The
// fact that code is running at all means that this should be true.
Runtime* runtime = Runtime::Current();
Remove those 7 lines and your ROM will be now compatible with custom kernels targeting CyanogenMod.
(Git style patch is added for 'git am' command. I'd appreciate it if you maintain Git repository, apply that Git patch for authorship.)
The only problem so far would be that this will break compatibility with Xposed, which replaces Android RunTime thus reverting this modification.

[GUIDE] How to add support for all third party apps to multiwindow

I've been looking for a guide to make multiwindow support all apps, but I couldn't find any simple guides with the way I wanted. So, just decided to write my own one.
This guide should be compatible with samsung lollipop (5.0+) only, though I've tested it only on my G906K (5.0.1).
What you need :
Deodexed framework.jar
Apktool or baksmali.jar to decompile framework.jar
Minimum knowledge for de/recompiling framework.jar
At least two hands to grab your mouse and keyboard
Now let's get started.
STEP 1)
Decompile your framework.jar and open smali/android/content/Intent.smali
Look for the following line :
Code:
.field public static final CATEGORY_MULTIWINDOW_LAUNCHER:Ljava/lang/String; = "android.intent.category.MULTIWINDOW_LAUNCHER"
and replace it with
Code:
.field public static final CATEGORY_MULTIWINDOW_LAUNCHER:Ljava/lang/String; = "android.intent.category.[B]LAUNCHER[/B]"
STEP 2)
I'm not sure if this modification is necessary, but it won't do any harm to us anyways.
Open smali/com/samsung/android/multiwindow/MultiWindowApplicationInfos.smali
(If you can't find it, look into smali_classes2 folder. It might vary depending on operator even on the same model.)
Look for the following method :
Code:
.method public isSupportApp(Ljava/lang/String;)Z
and replace the whole method with this :
Code:
.method public isSupportApp(Ljava/lang/String;)Z
.locals 1
.prologue
const/4 v0, 0x1
return v0
.end method
Now recompile your framework.jar, and voila! It's all done!
Please note that I'm a super noob and not familiar with those smali stuffs, so there could be errors. In fact, I'm quite sure, but it works well as of know
Please let me know if there's something I missed, or any simpler ways to do this. Thanks.

Categories

Resources